persistence
Class PDLParser

java.lang.Object
  extended bypersistence.PDLParser

public class PDLParser
extends java.lang.Object

Parser van persistentClass-tags uit persistentiebestand naar TableComponent-structuur.

Author:
bram 23-okt-2003

Nested Class Summary
private  class PDLParser.ContentTagList
          Contains queue of Maps which contains mappings: array -> Integer (default 0, dus geen array) compType -> String (verplicht !
 
Field Summary
private  boolean addArrayString
           
private static java.util.Collection allClassesToPersist
           
private  java.lang.String attributeName
           
private  TableComponent currentRoot
           
private  java.lang.String fullPrincipalClassName
           
private  java.lang.String getMethodName
           
private  org.w3c.dom.Node involvedNode
           
private  java.lang.String isAccessor
           
private  int maxSizeTableName
           
private  java.lang.String setMethodName
           
 
Constructor Summary
PDLParser(org.w3c.dom.Node involvedNode, java.lang.String fullPrincipalClassName)
           
 
Method Summary
private  void canonizeTableComponentNames(TableComponent parent)
          Embeds all table names belonging to parent tree between "$"s and creates aliases.
private  java.lang.String constructTableName(java.lang.String currentClassName, java.lang.String table, int major, int minor)
          Constructs table name by checking first for given alternative (table), otherwise making up a table name.
private  java.util.List filterWhiteSpaceNodes(org.w3c.dom.NodeList children)
          Filters empty #text-nodes out of NodeList
private  java.util.Collection getFKeys(TableComponent parent)
          Get Collection of FK-(Reference)Attributes for children of parent.
private  void getTables(TableComponent parent, java.util.Map contentTag)
          Add a KEY-field to a MapTable and add compType(Key)-properties to parent.
private  void getTables(TableComponent parent, PDLParser.ContentTagList contentTagList, boolean childOfRoot)
          Bouw TableComponent-tree op.
private  void initChildOfRoot(boolean childOfRoot, TableComponent attr)
           
static boolean isToPersist(java.lang.String fullClassName)
          Checks whether fullClassName has to be persisted.
 TableComponent parse()
          Recursive depth-first creation of TableComponent-treecomponents of currentRoot.
static void setAllClassesToPersist(java.util.Collection collection)
          Collection contains all classes which will have to be persisted.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

involvedNode

private org.w3c.dom.Node involvedNode

fullPrincipalClassName

private java.lang.String fullPrincipalClassName

currentRoot

private TableComponent currentRoot

allClassesToPersist

private static java.util.Collection allClassesToPersist

setMethodName

private java.lang.String setMethodName

getMethodName

private java.lang.String getMethodName

attributeName

private java.lang.String attributeName

isAccessor

private java.lang.String isAccessor

addArrayString

private boolean addArrayString

maxSizeTableName

private final int maxSizeTableName
See Also:
Constant Field Values
Constructor Detail

PDLParser

public PDLParser(org.w3c.dom.Node involvedNode,
                 java.lang.String fullPrincipalClassName)
Method Detail

parse

public TableComponent parse()
                     throws CompTypeRequiredException,
                            MissingContentTagException
Recursive depth-first creation of TableComponent-treecomponents of currentRoot.

Throws:
CompTypeRequiredException
MissingContentTagException

canonizeTableComponentNames

private void canonizeTableComponentNames(TableComponent parent)
Embeds all table names belonging to parent tree between "$"s and creates aliases.

Parameters:
parent -

constructTableName

private java.lang.String constructTableName(java.lang.String currentClassName,
                                            java.lang.String table,
                                            int major,
                                            int minor)
Constructs table name by checking first for given alternative (table), otherwise making up a table name.

Parameters:
currentClassName -
table - without major/minor pversion
major -
minor -
Returns:

filterWhiteSpaceNodes

private java.util.List filterWhiteSpaceNodes(org.w3c.dom.NodeList children)
Filters empty #text-nodes out of NodeList

Parameters:
children -
Returns:

getTables

private void getTables(TableComponent parent,
                       PDLParser.ContentTagList contentTagList,
                       boolean childOfRoot)
                throws MissingContentTagException
Bouw TableComponent-tree op.

Parameters:
parent -
contentTagList -
Throws:
MissingContentTagException

getFKeys

private java.util.Collection getFKeys(TableComponent parent)
Get Collection of FK-(Reference)Attributes for children of parent.

Parameters:
parent -
Returns:

initChildOfRoot

private void initChildOfRoot(boolean childOfRoot,
                             TableComponent attr)

getTables

private void getTables(TableComponent parent,
                       java.util.Map contentTag)
Add a KEY-field to a MapTable and add compType(Key)-properties to parent.

Parameters:
parent -
contentTag -
Throws:
MissingContentTagException

setAllClassesToPersist

public static void setAllClassesToPersist(java.util.Collection collection)
Collection contains all classes which will have to be persisted. This is needed for inheritance checks.

Parameters:
collection -

isToPersist

public static boolean isToPersist(java.lang.String fullClassName)
Checks whether fullClassName has to be persisted.

Parameters:
fullClassName -
Returns: