hibergui.generator.tool.xml
Class MappingReader

java.lang.Object
  extended by hibergui.generator.tool.xml.XMLReader
      extended by hibergui.generator.tool.xml.MappingReader

public class MappingReader
extends XMLReader

Reads HiberGUI mapping (hibergui-mapping) XML files. Validate it by DTD file which is specified at DOCTYPE element of mapping XML or if it is not available - file doesn't exist - then validate by DTD file in hibergui.jar archive.


Field Summary
private static java.lang.String DTD_FILE
           
private static java.lang.String DTD_FOLDER
           
private static java.lang.String FORM_ATTRIBUTE_NAME
           
private static java.lang.String FORM_NODE_NAME
           
private static java.lang.String ROOT_ATTRIBUTE_NAME
           
private static java.lang.String ROOT_NODE_NAME
           
 
Constructor Summary
MappingReader(java.lang.String file)
          Constructor of this class.
 
Method Summary
 java.lang.String getPackageName(boolean asFolder)
          Gets the name of package of target class.
 org.w3c.dom.Node getRootNode()
          Gets the node called hibergui-mapping.
 java.lang.String getTargetClassName()
          Gets the name of target class, e.g.: TargetClassName.
 
Methods inherited from class hibergui.generator.tool.xml.XMLReader
getDOM, getNode
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

ROOT_NODE_NAME

private static final java.lang.String ROOT_NODE_NAME
See Also:
Constant Field Values

ROOT_ATTRIBUTE_NAME

private static final java.lang.String ROOT_ATTRIBUTE_NAME
See Also:
Constant Field Values

FORM_NODE_NAME

private static final java.lang.String FORM_NODE_NAME
See Also:
Constant Field Values

FORM_ATTRIBUTE_NAME

private static final java.lang.String FORM_ATTRIBUTE_NAME
See Also:
Constant Field Values

DTD_FOLDER

private static final java.lang.String DTD_FOLDER
See Also:
Constant Field Values

DTD_FILE

private static final java.lang.String DTD_FILE
See Also:
Constant Field Values
Constructor Detail

MappingReader

public MappingReader(java.lang.String file)
              throws org.xml.sax.SAXException,
                     java.io.IOException,
                     javax.xml.parsers.ParserConfigurationException,
                     javax.xml.transform.TransformerException
Constructor of this class. Validates and reads content of XML.

Throws:
org.xml.sax.SAXException
java.io.IOException
javax.xml.parsers.ParserConfigurationException
javax.xml.transform.TransformerException
Method Detail

getTargetClassName

public java.lang.String getTargetClassName()
Gets the name of target class, e.g.: TargetClassName.

Returns:
Name of target class.

getPackageName

public java.lang.String getPackageName(boolean asFolder)
Gets the name of package of target class.

Parameters:
asFolder - Boolean value which determine form of the result. If value of this parameter is:
  • true: result will be formatted as a relative path, e.g. package/of/my/class.
  • false: result will be formatted as package name, e.g. package.of.my.class.
Returns:
Name of package of target class.

getRootNode

public org.w3c.dom.Node getRootNode()
Gets the node called hibergui-mapping. This node will be passed to the Freemarker to generate the java source code from this node tree.

Returns:
hibergui-mapping root node.