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. |
boolean |
isPrivate()
Deprecated.
use
getVisibility() instead |
void |
setPrivate(boolean isPrivate)
Deprecated.
use
setVisibility(Visibility) instead |
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
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>
@Deprecated public boolean isPrivate()
getVisibility()
instead
EmittedArtifacts that return true
for this method will not
be emitted into the normal module output location, but will instead be
written into a directory that is a sibling to the module output directory.
The partial path of the EmittedArtifact will be prepended with the
short-name of the Linker type that created the EmittedArtifact.
Private EmittedArtifacts are intended for resources that generally should not be deployed to the server in the same location as the module compilation artifacts.
@Deprecated public void setPrivate(boolean isPrivate)
setVisibility(Visibility)
insteadisPrivate
- true if this artifact is privatepublic 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.