Class ClientlibResourceFolder
- java.lang.Object
-
- com.composum.sling.clientlibs.handle.ClientlibResourceFolder
-
- All Implemented Interfaces:
ClientlibElement
public class ClientlibResourceFolder extends Object implements ClientlibElement
Models a resource folder for aClientlib- this can be the folder js/css directly below it, or a lower level folder.
-
-
Field Summary
Fields Modifier and Type Field Description protected Map<String,String>additionalPropertiesprotected Booleanexpandedprotected Booleanoptionalprotected ClientlibResourceFolderparentstatic StringPROP_DEPENDSArray of strings with path patterns (ClientlibRef) for resources / client libraries that are required.static StringPROP_EMBEDArray of strings with path patterns (ClientlibRef) for resources / client libraries that are components of this client library.static StringPROP_EXPANDEDBoolean value, default false; if true at the resource folder, the embedded files are not compacted into one file.static StringPROP_OPTIONALBoolean value, default false; if false for a missing dependency / embedding a warning is logged.ResourceHandleresourceprotected Clientlib.Typetype
-
Constructor Summary
Constructors Modifier Constructor Description ClientlibResourceFolder(Clientlib.Type type, org.apache.sling.api.resource.Resource resource)protectedClientlibResourceFolder(Clientlib.Type type, org.apache.sling.api.resource.Resource resource, ClientlibResourceFolder parent)
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description voidaccept(ClientlibVisitor visitor, ClientlibVisitor.VisitorMode mode, ClientlibResourceFolder parent)Dispatcher for the appropriate method of visitor: just callsvisitor.visit(this, mode, parent);.booleanequals(Object o)Map<String,String>getAdditionalProperties()List<ClientlibElement>getChildren()Returns all children - eitherClientlibResourceFolderas well, orClientlibFile.protected @NotNull List<ClientlibRef>getClientlib2Refs(String property)@NotNull List<ClientlibRef>getDependencies()@NotNull List<ClientlibRef>getEmbedded()booleangetExpanded()booleangetOptional()ClientlibRefgetRef()Not supported.Clientlib.TypegetType()The resource-type for which it was created.inthashCode()static booleanisFile(org.apache.sling.api.resource.Resource resource)Distinguishes file resources from resource folders: child is considered a resource folder if this is false.booleanisValid()ClientlibLinkmakeLink()Not supported.StringtoString()
-
-
-
Field Detail
-
PROP_EXPANDED
public static final String PROP_EXPANDED
Boolean value, default false; if true at the resource folder, the embedded files are not compacted into one file. Always true when debugging mode is activated.- See Also:
- Constant Field Values
-
PROP_OPTIONAL
public static final String PROP_OPTIONAL
Boolean value, default false; if false for a missing dependency / embedding a warning is logged.- See Also:
- Constant Field Values
-
PROP_DEPENDS
public static final String PROP_DEPENDS
Array of strings with path patterns (ClientlibRef) for resources / client libraries that are required.- See Also:
- Constant Field Values
-
PROP_EMBED
public static final String PROP_EMBED
Array of strings with path patterns (ClientlibRef) for resources / client libraries that are components of this client library.- See Also:
- Constant Field Values
-
resource
public final ResourceHandle resource
-
parent
protected final ClientlibResourceFolder parent
-
type
protected final Clientlib.Type type
-
expanded
protected Boolean expanded
-
optional
protected Boolean optional
-
-
Constructor Detail
-
ClientlibResourceFolder
public ClientlibResourceFolder(Clientlib.Type type, org.apache.sling.api.resource.Resource resource)
-
ClientlibResourceFolder
protected ClientlibResourceFolder(Clientlib.Type type, org.apache.sling.api.resource.Resource resource, ClientlibResourceFolder parent)
-
-
Method Detail
-
isValid
public boolean isValid()
-
getExpanded
public boolean getExpanded()
-
getOptional
public boolean getOptional()
-
getDependencies
@NotNull public @NotNull List<ClientlibRef> getDependencies()
-
getEmbedded
@NotNull public @NotNull List<ClientlibRef> getEmbedded()
-
getType
public Clientlib.Type getType()
Description copied from interface:ClientlibElementThe resource-type for which it was created.- Specified by:
getTypein interfaceClientlibElement
-
getClientlib2Refs
@NotNull protected @NotNull List<ClientlibRef> getClientlib2Refs(String property)
-
getChildren
public List<ClientlibElement> getChildren()
Returns all children - eitherClientlibResourceFolderas well, orClientlibFile.
-
isFile
public static boolean isFile(org.apache.sling.api.resource.Resource resource)
Distinguishes file resources from resource folders: child is considered a resource folder if this is false.
-
accept
public void accept(ClientlibVisitor visitor, ClientlibVisitor.VisitorMode mode, ClientlibResourceFolder parent) throws IOException, javax.jcr.RepositoryException
Description copied from interface:ClientlibElementDispatcher for the appropriate method of visitor: just callsvisitor.visit(this, mode, parent);.- Specified by:
acceptin interfaceClientlibElement- Parameters:
visitor- the visitor we want to dispatch tomode- processing modeparent- if applicable, the parent of the visited resource- Throws:
IOExceptionjavax.jcr.RepositoryException
-
makeLink
public ClientlibLink makeLink()
Not supported.- Specified by:
makeLinkin interfaceClientlibElement
-
getRef
public ClientlibRef getRef()
Not supported.- Specified by:
getRefin interfaceClientlibElement
-
-