public abstract class EmittedArtifact extends Artifact<EmittedArtifact>
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?Modifier and Type | Class and Description |
---|---|
static class |
EmittedArtifact.Visibility
Describes the visibility of an artifact.
|
Modifier | Constructor and Description |
---|---|
protected |
EmittedArtifact(Class<? extends Linker> linker,
String partialPath) |
Modifier and Type | Method and Description |
---|---|
protected int |
compareToComparableArtifact(EmittedArtifact o)
Performs comparison with an artifact of a compatible base type.
|
protected Class<EmittedArtifact> |
getComparableArtifactType()
Returns the base type to use for comparisons between Artifacts.
|
abstract InputStream |
getContents(TreeLogger logger)
Provides access to the contents of the EmittedResource.
|
long |
getLastModified()
Returns the time, measured in milliseconds from the epoch, at which the
Artifact was last modified.
|
String |
getPartialPath()
Returns the partial path within the output directory of the
EmittedArtifact.
|
EmittedArtifact.Visibility |
getVisibility() |
int |
hashCode()
The class which is returned from
Artifact.getComparableArtifactType() must
declare a final implementation which returns the same hash code for objects
for which Artifact.compareToComparableArtifact(Artifact) returns 0. |
void |
setVisibility(EmittedArtifact.Visibility visibility) |
String |
toString() |
void |
writeTo(TreeLogger logger,
OutputStream out)
Provides access to the contents of the EmittedResource.
|
compareTo, equals, getLinker, isTransferableFromShards
$isInstance
public abstract InputStream getContents(TreeLogger logger) throws UnableToCompleteException
UnableToCompleteException
public long getLastModified()
The default implementation always returns the current time. Subclasses should override this method to provide a type-appropriate value.
public final String getPartialPath()
public EmittedArtifact.Visibility getVisibility()
public final int hashCode()
Artifact
Artifact.getComparableArtifactType()
must
declare a final implementation which returns the same hash code for objects
for which Artifact.compareToComparableArtifact(Artifact)
returns 0.hashCode
in class Artifact<EmittedArtifact>
public void setVisibility(EmittedArtifact.Visibility visibility)
visibility
- the visibility to setpublic String toString()
toString
in class Artifact<EmittedArtifact>
public void writeTo(TreeLogger logger, OutputStream out) throws UnableToCompleteException
UnableToCompleteException
protected final int compareToComparableArtifact(EmittedArtifact o)
Artifact
Artifact.hashCode()
.compareToComparableArtifact
in class Artifact<EmittedArtifact>
protected final Class<EmittedArtifact> getComparableArtifactType()
Artifact
getComparableArtifactType
in class Artifact<EmittedArtifact>
Copyright © 2018. All rights reserved.