Class ClientlibRef
- java.lang.Object
-
- com.composum.sling.clientlibs.handle.ClientlibRef
-
public class ClientlibRef extends Object
Models a reference of a client-library to another client library, a category of client libraries, or a specific file.Unfortunately we cannot define something like
ClientlibLink.Kind
here, since there is no way to distinguish between a clientlib and a file at this point.
-
-
Field Summary
Fields Modifier and Type Field Description String
category
String
externalUri
boolean
optional
String
path
Pattern
pattern
static String
PREFIX_CATEGORY
Prefix for a pseudo-path that refers to all client libraries withClientlib.PROP_CATEGORY
.Map<String,String>
properties
Additional properties, e.g.String
rule
Original description how to locate the corresponding resource: absolute / relative path to clientlib / file, category, URI.Clientlib.Type
type
-
Constructor Summary
Constructors Constructor Description ClientlibRef(Clientlib.Type type, String theRule, boolean optional, Map<String,String> properties)
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description boolean
equals(Object o)
static ClientlibRef
forCategory(Clientlib.Type type, String category, boolean optional, Map<String,String> properties)
boolean
getExternalUri()
int
hashCode()
boolean
isCategory()
boolean
isExternalUri()
boolean
isSatisfiedby(ClientlibLink link)
Checks whether the link matches this, up to version patterns.boolean
isSatisfiedby(Collection<ClientlibLink> links)
Checks whether one of the links matches this, up to version patterns.protected String
ruleToPath(String rule)
protected Pattern
ruleToPattern(String rule)
String
toString()
-
-
-
Field Detail
-
PREFIX_CATEGORY
public static final String PREFIX_CATEGORY
Prefix for a pseudo-path that refers to all client libraries withClientlib.PROP_CATEGORY
.- See Also:
- Constant Field Values
-
rule
public final String rule
Original description how to locate the corresponding resource: absolute / relative path to clientlib / file, category, URI.
-
optional
public final boolean optional
-
pattern
public final Pattern pattern
-
path
public final String path
-
category
public final String category
-
externalUri
public final String externalUri
-
type
public final Clientlib.Type type
-
properties
public final Map<String,String> properties
Additional properties, e.g.ClientlibLink.PROP_REL
.
-
-
Constructor Detail
-
ClientlibRef
public ClientlibRef(Clientlib.Type type, String theRule, boolean optional, Map<String,String> properties)
-
-
Method Detail
-
forCategory
public static ClientlibRef forCategory(Clientlib.Type type, String category, boolean optional, Map<String,String> properties)
-
isCategory
public boolean isCategory()
-
isExternalUri
public boolean isExternalUri()
-
getExternalUri
public boolean getExternalUri()
-
isSatisfiedby
public boolean isSatisfiedby(ClientlibLink link)
Checks whether the link matches this, up to version patterns.
-
isSatisfiedby
public boolean isSatisfiedby(Collection<ClientlibLink> links)
Checks whether one of the links matches this, up to version patterns.
-
-