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>
additionalProperties
protected Boolean
expanded
protected Boolean
optional
protected ClientlibResourceFolder
parent
static String
PROP_DEPENDS
Array of strings with path patterns (ClientlibRef) for resources / client libraries that are required.static String
PROP_EMBED
Array of strings with path patterns (ClientlibRef) for resources / client libraries that are components of this client library.static String
PROP_EXPANDED
Boolean value, default false; if true at the resource folder, the embedded files are not compacted into one file.static String
PROP_OPTIONAL
Boolean value, default false; if false for a missing dependency / embedding a warning is logged.ResourceHandle
resource
protected Clientlib.Type
type
-
Constructor Summary
Constructors Modifier Constructor Description ClientlibResourceFolder(Clientlib.Type type, org.apache.sling.api.resource.Resource resource)
protected
ClientlibResourceFolder(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 void
accept(ClientlibVisitor visitor, ClientlibVisitor.VisitorMode mode, ClientlibResourceFolder parent)
Dispatcher for the appropriate method of visitor: just callsvisitor.visit(this, mode, parent);
.boolean
equals(Object o)
Map<String,String>
getAdditionalProperties()
List<ClientlibElement>
getChildren()
Returns all children - eitherClientlibResourceFolder
as well, orClientlibFile
.protected @NotNull List<ClientlibRef>
getClientlib2Refs(String property)
@NotNull List<ClientlibRef>
getDependencies()
@NotNull List<ClientlibRef>
getEmbedded()
boolean
getExpanded()
boolean
getOptional()
ClientlibRef
getRef()
Not supported.Clientlib.Type
getType()
The resource-type for which it was created.int
hashCode()
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.boolean
isValid()
ClientlibLink
makeLink()
Not supported.String
toString()
-
-
-
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:ClientlibElement
The resource-type for which it was created.- Specified by:
getType
in interfaceClientlibElement
-
getClientlib2Refs
@NotNull protected @NotNull List<ClientlibRef> getClientlib2Refs(String property)
-
getChildren
public List<ClientlibElement> getChildren()
Returns all children - eitherClientlibResourceFolder
as 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:ClientlibElement
Dispatcher for the appropriate method of visitor: just callsvisitor.visit(this, mode, parent);
.- Specified by:
accept
in interfaceClientlibElement
- Parameters:
visitor
- the visitor we want to dispatch tomode
- processing modeparent
- if applicable, the parent of the visited resource- Throws:
IOException
javax.jcr.RepositoryException
-
makeLink
public ClientlibLink makeLink()
Not supported.- Specified by:
makeLink
in interfaceClientlibElement
-
getRef
public ClientlibRef getRef()
Not supported.- Specified by:
getRef
in interfaceClientlibElement
-
-