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.Kindhere, since there is no way to distinguish between a clientlib and a file at this point.
-
-
Field Summary
Fields Modifier and Type Field Description StringcategoryStringexternalUribooleanoptionalStringpathPatternpatternstatic StringPREFIX_CATEGORYPrefix for a pseudo-path that refers to all client libraries withClientlib.PROP_CATEGORY.Map<String,String>propertiesAdditional properties, e.g.StringruleOriginal description how to locate the corresponding resource: absolute / relative path to clientlib / file, category, URI.Clientlib.Typetype
-
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 booleanequals(Object o)static ClientlibRefforCategory(Clientlib.Type type, String category, boolean optional, Map<String,String> properties)booleangetExternalUri()inthashCode()booleanisCategory()booleanisExternalUri()booleanisSatisfiedby(ClientlibLink link)Checks whether the link matches this, up to version patterns.booleanisSatisfiedby(Collection<ClientlibLink> links)Checks whether one of the links matches this, up to version patterns.protected StringruleToPath(String rule)protected PatternruleToPattern(String rule)StringtoString()
-
-
-
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.
-
-