@Experimental @Generated @ThreadSafe @Immutable public class Resource extends FileSet implements Serializable, InputLocationTracker
Modifier and Type | Class and Description |
---|---|
static class |
Resource.Builder
Builder class used to create Resource instances.
|
Modifier and Type | Method and Description |
---|---|
String |
getFiltering()
Whether resources are filtered to replace tokens with parameterised values or not.
|
InputLocation |
getLocation(Object key)
Gets the location of the specified field in the input source.
|
String |
getMergeId()
FOR INTERNAL USE ONLY.
|
String |
getTargetPath()
Describe the resource target path.
|
boolean |
isFiltering() |
static Resource.Builder |
newBuilder()
Creates a new
Resource builder instance. |
static Resource.Builder |
newBuilder(boolean withDefaults)
Creates a new
Resource builder instance using default values or not. |
static Resource.Builder |
newBuilder(Resource from)
Creates a new
Resource builder instance using the specified object as a basis. |
static Resource.Builder |
newBuilder(Resource from,
boolean forceCopy)
Creates a new
Resource builder instance using the specified object as a basis. |
static Resource |
newInstance()
Creates a new
Resource instance. |
static Resource |
newInstance(boolean withDefaults)
Creates a new
Resource instance using default values or not. |
String |
toString() |
Resource.Builder |
with()
Creates a new builder with this object as the basis.
|
Resource |
withDirectory(String directory)
Creates a new
Resource instance using the specified directory. |
Resource |
withExcludes(Collection<String> excludes)
Creates a new
Resource instance using the specified excludes. |
Resource |
withFiltering(String filtering)
Creates a new
Resource instance using the specified filtering. |
Resource |
withIncludes(Collection<String> includes)
Creates a new
Resource instance using the specified includes. |
Resource |
withMergeId(String mergeId)
Creates a new
Resource instance using the specified mergeId. |
Resource |
withTargetPath(String targetPath)
Creates a new
Resource instance using the specified targetPath. |
getDirectory, newBuilder, newBuilder
getExcludes, getIncludes, newBuilder, newBuilder
public String getTargetPath()
${project.build.outputDirectory}
).
For example, if you want that resource to appear in a specific package
(org.apache.maven.messages
), you must specify this
element with this value: org/apache/maven/messages
.
This is not required if you simply put the resources in that directory
structure at the source, however.String
public String getFiltering()
properties
element and from the
properties in the files listed in the filters
element. Note: While the type
of this field is String
for technical reasons, the semantic type is actually
Boolean
. Default value is false
.String
public String getMergeId()
String
public InputLocation getLocation(Object key)
getLocation
in interface InputLocationTracker
getLocation
in class FileSet
@Nonnull public Resource.Builder with()
@Nonnull public Resource withIncludes(Collection<String> includes)
Resource
instance using the specified includes.withIncludes
in class FileSet
includes
- the new Collection<String>
to useResource
with the specified includes@Nonnull public Resource withExcludes(Collection<String> excludes)
Resource
instance using the specified excludes.withExcludes
in class FileSet
excludes
- the new Collection<String>
to useResource
with the specified excludes@Nonnull public Resource withDirectory(String directory)
Resource
instance using the specified directory.withDirectory
in class FileSet
directory
- the new String
to useResource
with the specified directory@Nonnull public Resource withTargetPath(String targetPath)
Resource
instance using the specified targetPath.targetPath
- the new String
to useResource
with the specified targetPath@Nonnull public Resource withFiltering(String filtering)
Resource
instance using the specified filtering.filtering
- the new String
to useResource
with the specified filtering@Nonnull public Resource withMergeId(String mergeId)
Resource
instance using the specified mergeId.mergeId
- the new String
to useResource
with the specified mergeId@Nonnull public static Resource newInstance()
Resource
instance.
Equivalent to newInstance( true )
.Resource
newInstance(boolean)
@Nonnull public static Resource newInstance(boolean withDefaults)
Resource
instance using default values or not.
Equivalent to newBuilder( withDefaults ).build()
.withDefaults
- the boolean indicating whether default values should be usedResource
@Nonnull public static Resource.Builder newBuilder()
Resource
builder instance.
Equivalent to newBuilder( true )
.Builder
newBuilder(boolean)
@Nonnull public static Resource.Builder newBuilder(boolean withDefaults)
Resource
builder instance using default values or not.withDefaults
- the boolean indicating whether default values should be usedBuilder
@Nonnull public static Resource.Builder newBuilder(Resource from)
Resource
builder instance using the specified object as a basis.
Equivalent to newBuilder( from, false )
.from
- the Resource
instance to use as a basisBuilder
@Nonnull public static Resource.Builder newBuilder(Resource from, boolean forceCopy)
Resource
builder instance using the specified object as a basis.from
- the Resource
instance to use as a basisforceCopy
- the boolean indicating if a copy should be forcedBuilder
public boolean isFiltering()
public String toString()
toString
in class FileSet
Object.toString()
Copyright © 2001–2022 The Apache Software Foundation. All rights reserved.