java.lang.Cloneable
, java.lang.Comparable<Resource>
, java.lang.Iterable<Resource>
, ResourceCollection
public class MappedResource extends ResourceDecorator
Strips the FileProvider interface from decorated resources since it may be used to circumvent name mapping.
description, location, project
MAGIC, UNKNOWN_DATETIME, UNKNOWN_SIZE
Constructor | Description |
---|---|
MappedResource(Resource r,
FileNameMapper m) |
Wraps an existing resource.
|
Modifier and Type | Method | Description |
---|---|---|
<T> T |
as(java.lang.Class<T> clazz) |
Suppress FileProvider
|
boolean |
equals(java.lang.Object other) |
Equality check based on the resource's name in addition to the
resource itself.
|
java.lang.String |
getName() |
Maps the name.
|
int |
hashCode() |
Get the hash code for this Resource.
|
void |
setRefid(Reference r) |
Not really supported since mapper is never null.
|
java.lang.String |
toString() |
Get the string representation of this Resource.
|
checkAttributesAllowed, checkChildrenAllowed, circularReference, dieOnCircularReference, dieOnCircularReference, getCheckedRef, getCheckedRef, getCheckedRef, getDataTypeName, getRefid, invokeCircularReferenceCheck, isChecked, isReference, noChildrenAllowed, pushAndInvokeCircularReferenceCheck, setChecked, tooManyAttributes
finalize, getClass, notify, notifyAll, wait, wait, wait
getDescription, getLocation, getProject, log, log, setDescription, setLocation, setProject
asOptional, clone, getCheckedRef, getMagicNumber, iterator, size, toLongString
isEmpty, stream
addConfigured, compareTo, dieOnCircularReference, getInputStream, getLastModified, getOutputStream, getResource, getSize, isDirectory, isExists, isFilesystemOnly, setDirectory, setExists, setLastModified, setName, setSize
public MappedResource(Resource r, FileNameMapper m)
r
- Resource to wrapm
- FileNameMapper that handles mappingpublic java.lang.String getName()
getName
in class ResourceDecorator
public void setRefid(Reference r)
setRefid
in class ResourceDecorator
r
- reference to setpublic <T> T as(java.lang.Class<T> clazz)
as
in class ResourceDecorator
T
- desired typeclazz
- the type to implementpublic int hashCode()
hashCode
in class ResourceDecorator
public boolean equals(java.lang.Object other)