Package com.google.gwt.core.ext.linker
Class EmittedArtifact
java.lang.Object
com.google.gwt.core.ext.linker.Artifact<EmittedArtifact>
com.google.gwt.core.ext.linker.EmittedArtifact
- All Implemented Interfaces:
Serializable
,Comparable<Artifact<?>>
- Direct Known Subclasses:
BinaryEmittedArtifact
,GeneratedResource
,PublicResource
,SyntheticArtifact
An artifact that will be emitted into the output. All EmittedArtifacts
contained in the
ArtifactSet
at the end of the Linking process will
be emitted by the compiler into the module's output directory. This type may
be extended by Linker providers to provide alternative implementations of
getContents(TreeLogger)
.
TODO(bobv): provide a timestamp so we can make the time on output files match
that of input files?- See Also:
-
Nested Class Summary
Modifier and TypeClassDescriptionstatic enum
Describes the visibility of an artifact. -
Constructor Summary
ModifierConstructorDescriptionprotected
EmittedArtifact
(Class<? extends Linker> linker, String partialPath) -
Method Summary
Modifier and TypeMethodDescriptionprotected final int
Performs comparison with an artifact of a compatible base type.protected final Class
<EmittedArtifact> Returns the base type to use for comparisons between Artifacts.abstract InputStream
getContents
(TreeLogger logger) Provides access to the contents of the EmittedResource.long
Returns the time, measured in milliseconds from the epoch, at which the Artifact was last modified.final String
Returns the partial path within the output directory of the EmittedArtifact.final int
hashCode()
The class which is returned fromArtifact.getComparableArtifactType()
must declare a final implementation which returns the same hash code for objects for whichArtifact.compareToComparableArtifact(Artifact)
returns 0.void
setVisibility
(EmittedArtifact.Visibility visibility) toString()
void
writeTo
(TreeLogger logger, OutputStream out) Provides access to the contents of the EmittedResource.Methods inherited from class com.google.gwt.core.ext.linker.Artifact
compareTo, equals, getLinker, isTransferableFromShards
-
Constructor Details
-
EmittedArtifact
-
-
Method Details
-
getContents
Provides access to the contents of the EmittedResource.- Throws:
UnableToCompleteException
-
getLastModified
public long getLastModified()Returns the time, measured in milliseconds from the epoch, at which the Artifact was last modified. This will be used to set the last-modified timestamp on the files written to disk.The default implementation always returns the current time. Subclasses should override this method to provide a type-appropriate value.
- Returns:
- the time at which the Artifact was last modified
-
getPartialPath
Returns the partial path within the output directory of the EmittedArtifact. -
getVisibility
- Returns:
- the visibility
-
hashCode
public final int hashCode()Description copied from class:Artifact
The class which is returned fromArtifact.getComparableArtifactType()
must declare a final implementation which returns the same hash code for objects for whichArtifact.compareToComparableArtifact(Artifact)
returns 0.- Specified by:
hashCode
in classArtifact<EmittedArtifact>
-
setVisibility
- Parameters:
visibility
- the visibility to set
-
toString
- Overrides:
toString
in classArtifact<EmittedArtifact>
-
writeTo
Provides access to the contents of the EmittedResource.- Throws:
UnableToCompleteException
-
compareToComparableArtifact
Description copied from class:Artifact
Performs comparison with an artifact of a compatible base type. Objects which compare to 0 are assumed equal, and must return the sameArtifact.hashCode()
.- Specified by:
compareToComparableArtifact
in classArtifact<EmittedArtifact>
-
getComparableArtifactType
Description copied from class:Artifact
Returns the base type to use for comparisons between Artifacts. All concrete implementations of this methods must be final.- Specified by:
getComparableArtifactType
in classArtifact<EmittedArtifact>
-