Package de.mhus.lib.core.directory
Class EmptyResourceNode<E extends ResourceNode<?>>
- java.lang.Object
-
- de.mhus.lib.core.MLog
-
- de.mhus.lib.core.lang.MObject
-
- de.mhus.lib.core.AbstractProperties
-
- de.mhus.lib.core.directory.ResourceNode<E>
-
- de.mhus.lib.core.directory.EmptyResourceNode<E>
-
- All Implemented Interfaces:
ILog,IProperties,IReadProperties,MNlsProvider,Nls,Serializable,Iterable<Map.Entry<String,Object>>,Map<String,Object>
public class EmptyResourceNode<E extends ResourceNode<?>> extends ResourceNode<E>
- See Also:
- Serialized Form
-
-
Field Summary
-
Fields inherited from class de.mhus.lib.core.directory.ResourceNode
compiledCache, compiler
-
-
Constructor Summary
Constructors Constructor Description EmptyResourceNode()EmptyResourceNode(String name)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidclear()InputStreamgetInputStream(String key)Return the input stream of a content resource.StringgetName()Return a name of this config element could also be null.EgetNode(String key)Returns a inner configuration by the name.List<String>getNodeKeys()Return all possible, existing inner configuration names.List<E>getNodes()Return all inner configurations ignoring the name.List<E>getNodes(String key)Return all inner configurations by the given name.ResourceNode<?>getParent()return the parent config if possible.ObjectgetProperty(String name)Overwrite this function to provide values in string format.List<String>getPropertyKeys()Return all existing keys.IPropertiesgetRenditionProperties(String rendition)Returns a set of properties to define the rendition.Collection<String>getRenditions()Returns a list of available renditions.URLgetUrl()booleanhasContent()booleanisEditable()Overwrite this function and return true if the property set can be edited.booleanisProperty(String name)Return true if the property exists.booleanisValid()voidremoveProperty(String key)Remove the property field in the list of properties.voidsetProperty(String key, Object value)Overwrite this function to allow changes in properties.-
Methods inherited from class de.mhus.lib.core.directory.ResourceNode
containsValue, dump, entrySet, getExtracted, getExtracted, getExtracted, getInputStream, getNodeByPath, getRenditionProperties, keys, size, values
-
Methods inherited from class de.mhus.lib.core.AbstractProperties
containsKey, get, getBoolean, getBoolean, getCalendar, getDate, getDouble, getFloat, getFormatted, getInt, getLong, getNumber, getString, getString, isEmpty, iterator, keySet, put, putAll, putReadProperties, remove, setBoolean, setCalendar, setDate, setDouble, setFloat, setInt, setLong, setNumber, setString, toMap
-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
-
Methods inherited from interface java.lang.Iterable
forEach, spliterator
-
Methods inherited from interface java.util.Map
compute, computeIfAbsent, computeIfPresent, equals, forEach, getOrDefault, hashCode, merge, putIfAbsent, remove, replace, replace, replaceAll
-
-
-
-
Constructor Detail
-
EmptyResourceNode
public EmptyResourceNode()
-
EmptyResourceNode
public EmptyResourceNode(String name)
-
-
Method Detail
-
getPropertyKeys
public List<String> getPropertyKeys()
Description copied from class:ResourceNodeReturn all existing keys. A property key is unique.- Specified by:
getPropertyKeysin classResourceNode<E extends ResourceNode<?>>- Returns:
- all keys
-
getNode
public E getNode(String key)
Description copied from class:ResourceNodeReturns a inner configuration by the name. Inner configurations are not unique. If more then one configurations exists it will return the first one. if no configuration exists it returns null.- Specified by:
getNodein classResourceNode<E extends ResourceNode<?>>- Returns:
- the node with the name
-
getNodes
public List<E> getNodes()
Description copied from class:ResourceNodeReturn all inner configurations ignoring the name. The order is like in the configuration file. This never returns null.- Specified by:
getNodesin classResourceNode<E extends ResourceNode<?>>- Returns:
- all nodes
-
getNodes
public List<E> getNodes(String key)
Description copied from class:ResourceNodeReturn all inner configurations by the given name. The order is like in the configuration file. This never returns null.- Specified by:
getNodesin classResourceNode<E extends ResourceNode<?>>- Returns:
- all nodes with the name
-
getNodeKeys
public List<String> getNodeKeys()
Description copied from class:ResourceNodeReturn all possible, existing inner configuration names.- Specified by:
getNodeKeysin classResourceNode<E extends ResourceNode<?>>- Returns:
- keys from nodes
-
getName
public String getName() throws de.mhus.lib.errors.MException
Description copied from class:ResourceNodeReturn a name of this config element could also be null. The name most time is the name of a sub config.- Specified by:
getNamein classResourceNode<E extends ResourceNode<?>>- Returns:
- node of this node
- Throws:
de.mhus.lib.errors.MException
-
getInputStream
public InputStream getInputStream(String key)
Description copied from class:ResourceNodeReturn the input stream of a content resource.- Specified by:
getInputStreamin classResourceNode<E extends ResourceNode<?>>- Parameters:
key- Name of a rendition or null for the default content- Returns:
- input stream
-
getParent
public ResourceNode<?> getParent()
Description copied from class:ResourceNodereturn the parent config if possible.- Specified by:
getParentin classResourceNode<E extends ResourceNode<?>>- Returns:
- parent node
-
getUrl
public URL getUrl()
- Specified by:
getUrlin classResourceNode<E extends ResourceNode<?>>
-
isValid
public boolean isValid()
- Specified by:
isValidin classResourceNode<E extends ResourceNode<?>>
-
hasContent
public boolean hasContent()
- Specified by:
hasContentin classResourceNode<E extends ResourceNode<?>>
-
getProperty
public Object getProperty(String name)
Description copied from class:AbstractPropertiesOverwrite this function to provide values in string format.- Specified by:
getPropertyin interfaceIReadProperties- Specified by:
getPropertyin classAbstractProperties- Returns:
- null if the property not exists or the property value.
-
isProperty
public boolean isProperty(String name)
Description copied from class:AbstractPropertiesReturn true if the property exists.- Specified by:
isPropertyin interfaceIReadProperties- Specified by:
isPropertyin classAbstractProperties- Returns:
- if exists
-
removeProperty
public void removeProperty(String key)
Description copied from class:AbstractPropertiesRemove the property field in the list of properties.- Specified by:
removePropertyin interfaceIProperties- Specified by:
removePropertyin classAbstractProperties
-
setProperty
public void setProperty(String key, Object value)
Description copied from class:AbstractPropertiesOverwrite this function to allow changes in properties.- Specified by:
setPropertyin classAbstractProperties
-
isEditable
public boolean isEditable()
Description copied from class:AbstractPropertiesOverwrite this function and return true if the property set can be edited.- Specified by:
isEditablein interfaceIProperties- Specified by:
isEditablein classAbstractProperties- Returns:
- if is editable
-
getRenditions
public Collection<String> getRenditions()
Description copied from class:ResourceNodeReturns a list of available renditions. Will not return the default rendition.- Specified by:
getRenditionsin classResourceNode<E extends ResourceNode<?>>- Returns:
- The list or null if hasContent() is false
-
clear
public void clear()
-
getRenditionProperties
public IProperties getRenditionProperties(String rendition)
Description copied from class:ResourceNodeReturns a set of properties to define the rendition.- Specified by:
getRenditionPropertiesin classResourceNode<E extends ResourceNode<?>>- Returns:
- properties
-
-