public class JsonConfig extends IConfig
JsonConfig class.
| Modifier and Type | Field and Description |
|---|---|
protected String |
name |
MOVE_DOWN, MOVE_FIRST, MOVE_LAST, MOVE_UPcompiledCache, compiler| Constructor and Description |
|---|
JsonConfig()
Constructor for JsonConfig.
|
JsonConfig(org.codehaus.jackson.node.ObjectNode node)
Constructor for JsonConfig.
|
JsonConfig(String json)
Constructor for JsonConfig.
|
JsonConfig(String name2,
JsonConfig jsonConfig,
org.codehaus.jackson.node.TextNode textNode)
Constructor for JsonConfig.
|
JsonConfig(String name,
WritableResourceNode parent,
org.codehaus.jackson.node.ObjectNode node)
Constructor for JsonConfig.
|
| Modifier and Type | Method and Description |
|---|---|
WritableResourceNode |
createConfig(String key)
Create a new config and append it at the end of the list.
|
protected int |
findPosOf(org.codehaus.jackson.node.ArrayNode array,
JsonConfig config)
findPosOf.
|
InputStream |
getInputStream(String key)
Return the input stream of a content resource.
|
String |
getName()
Return a name of this config element could also be null.
|
org.codehaus.jackson.node.ObjectNode |
getNode()
Getter for the field
node. |
WritableResourceNode |
getNode(String name)
Returns a inner configuration by the name.
|
String[] |
getNodeKeys()
Return all possible, existing inner configuration names.
|
WritableResourceNode[] |
getNodes()
Return all inner configurations ignoring the name.
|
WritableResourceNode[] |
getNodes(String name)
Return all inner configurations by the given name.
|
WritableResourceNode |
getParent()
return the parent config if possible.
|
Object |
getProperty(String name)
Overwrite this function to provide values in string format.
|
String[] |
getPropertyKeys()
Return all existing keys.
|
URL |
getUrl()
getUrl.
|
boolean |
isEditable()
Overwrite this function and return true if the property set can be edited.
|
boolean |
isProperty(String name)
Return true if the property exists.
|
int |
moveConfig(ResourceNode config,
int newPos)
Move the position of the configuration in the hole set of configurations.
|
void |
removeConfig(ResourceNode config)
Remove a config element from the set.
|
void |
removeProperty(String name)
Remove the property field in the list of properties.
|
void |
setProperty(String name,
Object value)
Overwrite this function to allow changes in properties.
|
void |
write(OutputStream os)
write.
|
void |
write(Writer os)
write.
|
hasContent, isValidesetStringgetExtracted, getExtracted, getExtracted, getInputStream, getNodeByPath, keysgetBoolean, getBoolean, getCalendar, getDate, getDouble, getFloat, getInt, getLong, getNumber, getProperty, getString, getString, iterator, setBoolean, setCalendar, setDate, setDouble, setFloat, setInt, setLong, setNumber, toMapbase, base, createBase, forkBase, installBase, isBase, leaveBase, toStringclone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitforEach, spliteratorprotected String name
public JsonConfig(org.codehaus.jackson.node.ObjectNode node)
Constructor for JsonConfig.
node - a ObjectNode object.public JsonConfig(String name, WritableResourceNode parent, org.codehaus.jackson.node.ObjectNode node)
Constructor for JsonConfig.
name - a String object.parent - a WritableResourceNode object.node - a ObjectNode object.public JsonConfig()
throws Exception
Constructor for JsonConfig.
Exception - if any.public JsonConfig(String name2, JsonConfig jsonConfig, org.codehaus.jackson.node.TextNode textNode) throws Exception
Constructor for JsonConfig.
name2 - a String object.jsonConfig - a JsonConfig object.textNode - a TextNode object.Exception - if any.public WritableResourceNode getNode(String name)
getNode in class ResourceNodename - a String object.ResourceNode object.public WritableResourceNode[] getNodes(String name)
getNodes in class ResourceNodename - a String object.ResourceNode objects.public WritableResourceNode[] getNodes()
getNodes in class ResourceNodeResourceNode objects.public String[] getNodeKeys()
getNodeKeys in class ResourceNodeString objects.public Object getProperty(String name)
getProperty in class IPropertiesname - a String object.public String[] getPropertyKeys()
getPropertyKeys in class ResourceNodeString objects.public boolean isProperty(String name)
isProperty in class IPropertiesname - a String object.public void removeProperty(String name)
removeProperty in class IPropertiesname - a String object.public void setProperty(String name, Object value)
setProperty in class IPropertiesname - a String object.value - a Object object.public org.codehaus.jackson.node.ObjectNode getNode()
Getter for the field node.
ObjectNode object.public String getName()
getName in class ResourceNodeString object.public WritableResourceNode createConfig(String key) throws MException
createConfig in class WritableResourceNodekey - a String object.WritableResourceNode object.MException - if editing is not possiblepublic int moveConfig(ResourceNode config, int newPos) throws MException
moveConfig in class WritableResourceNodeconfig - The config object which you want to movenewPos - Absolute new position or one of the move operators MOVE_UP, MOVE_DOWN, MOVE_FIRST, MOVE_LASTMException - if editing is not possible or the position is out of rangepublic void removeConfig(ResourceNode config) throws MException
removeConfig in class WritableResourceNodeconfig - The config object which should be removed.MException - if editing is not possibleprotected int findPosOf(org.codehaus.jackson.node.ArrayNode array,
JsonConfig config)
findPosOf.
array - a ArrayNode object.config - a JsonConfig object.public boolean isEditable()
isEditable in class IPropertiespublic WritableResourceNode getParent()
getParent in class ResourceNodeResourceNode object.public void write(OutputStream os) throws IOException
write.
os - a OutputStream object.IOException - if any.public void write(Writer os) throws IOException
write.
os - a Writer object.IOException - if any.public InputStream getInputStream(String key)
getInputStream in class ResourceNodekey - Name of a rendition or null for the default contentInputStream object.public URL getUrl()
getUrl.
getUrl in class ResourceNodeURL object.Copyright © 2016. All Rights Reserved.