public abstract class XmlDynamicConfiguration extends FileDynamicConfiguration
Extends this class to manage new XML file values.
Modifier and Type | Field and Description |
---|---|
protected static String |
REF_ATTRIBUTE_NAME |
protected static String |
XPATH_ARRAY_PREFIX |
protected static String |
XPATH_ARRAY_SUFIX |
protected static String |
XPATH_ATTRIBUTE_PREFIX |
protected static String |
XPATH_ELEMENT_SEPARATOR |
protected static String |
XPATH_EQUALS_SYMBOL |
protected static String |
XPATH_NAMESPACE_SUFIX |
protected static String |
XPATH_STRING_DELIMITER |
Constructor and Description |
---|
XmlDynamicConfiguration() |
Modifier and Type | Method and Description |
---|---|
protected DynPropertyList |
getProperties(String baseName,
NodeList nodes)
Generate a dynamic property list from a list of XML nodes.
|
protected DynPropertyList |
getPropertyAttributes(Node node,
String xpath)
Create the dynamic properties related to this node attributes.
|
protected String |
getPropertyXpath(String baseName,
NodeList nodes,
int i)
Generate the xpath expression that points to property.
|
protected Document |
getXmlDocument(org.springframework.roo.process.manager.MutableFile file)
Get a document from a file.
|
protected boolean |
isValidNode(Node node)
The node is a valid type to be generated as dynamic property ?
|
DynPropertyList |
read() |
protected String |
removeNamespaces(String xpath)
Remove possible namespaces from a xpath expression.
|
protected void |
setProperties(Element root,
DynPropertyList dynProps)
Update the root element property values with dynamic properties.
|
void |
write(DynPropertyList dynProps) |
getFile, getFilePath
protected static final String REF_ATTRIBUTE_NAME
protected static final String XPATH_ELEMENT_SEPARATOR
protected static final String XPATH_NAMESPACE_SUFIX
protected static final String XPATH_ATTRIBUTE_PREFIX
protected static final String XPATH_ARRAY_SUFIX
protected static final String XPATH_ARRAY_PREFIX
protected static final String XPATH_EQUALS_SYMBOL
protected static final String XPATH_STRING_DELIMITER
public DynPropertyList read()
public void write(DynPropertyList dynProps)
protected Document getXmlDocument(org.springframework.roo.process.manager.MutableFile file)
file
- Mutable fileprotected DynPropertyList getProperties(String baseName, NodeList nodes)
Only TEXT_NODE, TEXT_NODE and ATTRIBUTE_NODE nodes are considered. On ATTRIBUTE_NODE nodes references neither are considered.
baseName
- Parent node name of node listnodes
- XML node list to convertprotected boolean isValidNode(Node node)
TEXT_NODE, TEXT_NODE and ATTRIBUTE_NODE nodes are valid.
node
- Node to checkprotected DynPropertyList getPropertyAttributes(Node node, String xpath)
node
- Node to add to listxpath
- Xpath expression of this nodeprotected String getPropertyXpath(String baseName, NodeList nodes, int i)
The xpath expression could be an array or not.
baseName
- Base name of current nodenodes
- List of brother nodesi
- Index of current nodeprotected String removeNamespaces(String xpath)
xpath
- Xpath expressión with optional namespacesprotected void setProperties(Element root, DynPropertyList dynProps)
root
- Parent elementdynProps
- Dynamic property listCopyright © 2010–2015 General Directorate for Information Technologies (DGTI) of the Regional Ministry of Finance and Public Administration of the Generalitat Valenciana.. All rights reserved.