fixed formatting and indentation.
This commit is contained in:
parent
47ab428371
commit
443dd18158
1 changed files with 212 additions and 208 deletions
|
@ -75,7 +75,8 @@ public class XmlConverter implements XmlConstants {
|
|||
|
||||
public INode convert( Element element, INode helmaNode ) {
|
||||
offset++;
|
||||
if (DEBUG) debug("reading " + element.getNodeName() );
|
||||
if (DEBUG)
|
||||
debug("reading " + element.getNodeName() );
|
||||
helmaNode.setName( element.getNodeName() );
|
||||
String prototype = (String)props.get(element.getNodeName().toLowerCase()+"._prototype");
|
||||
if ( prototype == null )
|
||||
|
@ -124,15 +125,16 @@ public class XmlConverter implements XmlConstants {
|
|||
if( helmaKey.equals("") )
|
||||
// if property is set but without value, read elementname for this mapping
|
||||
helmaKey = childElement.getNodeName().replace(':',defaultSeparator);
|
||||
if (DEBUG) debug("childtext-2-property mapping, helmaKey " + helmaKey + " for domKey " + domKey );
|
||||
if (DEBUG)
|
||||
debug("childtext-2-property mapping, helmaKey " + helmaKey + " for domKey " + domKey );
|
||||
if ( helmaNode.getString(helmaKey,false)==null ) {
|
||||
helmaNode.setString( helmaKey, XmlUtil.getTextContent(childNode) );
|
||||
if (DEBUG) debug("childtext-2-property mapping, setting " + helmaKey + " as string" );
|
||||
if (DEBUG)
|
||||
debug("childtext-2-property mapping, setting " + helmaKey + " as string" );
|
||||
}
|
||||
continue;
|
||||
}
|
||||
|
||||
//
|
||||
// is there a simple child-2-property mapping?
|
||||
// (lets the user define to use only one element and make this a property
|
||||
// and simply ignore other elements of the same name)
|
||||
|
@ -141,16 +143,17 @@ public class XmlConverter implements XmlConstants {
|
|||
// if property is set but without value, read elementname for this mapping:
|
||||
if ( helmaKey.equals("") )
|
||||
helmaKey = childElement.getNodeName().replace(':',defaultSeparator);
|
||||
if (DEBUG) debug("child-2-property mapping, helmaKey " + helmaKey + " for domKey " + domKey);
|
||||
if (DEBUG)
|
||||
debug("child-2-property mapping, helmaKey " + helmaKey + " for domKey " + domKey);
|
||||
if ( helmaNode.getNode(helmaKey,false)==null ) {
|
||||
convert( childElement, helmaNode.createNode(helmaKey) );
|
||||
if (DEBUG) debug( "read " + childElement.toString() + helmaNode.getNode(helmaKey,false).toString() );
|
||||
if (DEBUG)
|
||||
debug( "read " + childElement.toString() + helmaNode.getNode(helmaKey,false).toString() );
|
||||
}
|
||||
continue;
|
||||
}
|
||||
|
||||
|
||||
//
|
||||
// map it to one of the children-lists
|
||||
helma.objectmodel.INode newHelmaNode = null;
|
||||
String childrenMapping = (String)props.get(element.getNodeName().toLowerCase()+"._children");
|
||||
|
@ -170,7 +173,8 @@ public class XmlConverter implements XmlConstants {
|
|||
// if virtual node doesn't exist, create it
|
||||
worknode = helmaNode.createNode( helmaKey );
|
||||
}
|
||||
if (DEBUG) debug( "mounting child "+ childElement.getNodeName() + " at worknode " + worknode.toString() );
|
||||
if (DEBUG)
|
||||
debug( "mounting child "+ childElement.getNodeName() + " at worknode " + worknode.toString() );
|
||||
// now mount it, possibly re-using the helmaNode that's been created before
|
||||
if ( newHelmaNode!=null ) {
|
||||
worknode.addNode(newHelmaNode);
|
||||
|
|
Loading…
Add table
Reference in a new issue