|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.objectweb.jorm.xml2mi.lib.ParserHelper
org.objectweb.jorm.xml2mi.lib.BasicMappingParser
ProxyParser is an implementation of the Parser interface. This object defines a parser which is able to dispatch operation to specific mapping parser, and able to build the corresponding meta information.
Field Summary | |
protected Class |
currentClass
The current Class object. |
protected java.util.Map |
idvalue2genclassref
A Map of String objects. |
protected Manager |
metaInfoManager
The meta information manager for managing meta-objects within the context of a mapper. |
protected PathExplorer |
pathExplorer
pathExplorer is able to return input or output stream from a given file. |
Fields inherited from class org.objectweb.jorm.xml2mi.lib.ParserHelper |
logger, loggerFactory, motable |
Constructor Summary | |
BasicMappingParser()
|
Method Summary | |
protected NameDef |
getClassRefNameDef(Class clazz,
java.lang.String fieldName,
java.lang.String name)
Seeks for a ClassRef object given a class, a field name. |
protected java.lang.String |
getFieldName(org.w3c.dom.Element nameDef)
Seeks for a father node of type field from a name-def node and returns the corresponding field name. |
protected int |
getGenClassNestingLevel(org.w3c.dom.Element fromElem,
java.lang.String fieldName)
Seeks for a father node of type field from a gen-class element or a name-def element. |
protected GenClassRef |
getGenClassRef(Class clazz,
java.lang.String fieldName,
int nestingLevel)
Seeks for a GenClassRef object given a class, a field name and a nesting level. |
protected NameDef |
getGenClassRefNameDef(Class clazz,
java.lang.String fieldName,
java.lang.String name,
int nestingLevel)
Seeks for a GenClassRef object given a class, a field name and a nesting level. |
Logger |
getLogger()
Returns a logger to an component that wants to log things. |
LoggerFactory |
getLoggerFactory()
Returns a logger factory that allows the creation of new loggers. |
protected NameDef |
getNameDefFromSuper(java.lang.String linkend)
Returns a NameDef object given the full qualified class name of an inherited class and possibly a NameDef name. |
protected PrimitiveElement |
getPrimitiveElement(java.lang.String linkend)
|
protected NameDef |
getRefNameDef(java.lang.String linkend,
java.lang.String tagName)
Returns a NameDef object given a NameDef name (name), a field or a scalarfield name (fn) and possibly the full qualified class name where it is defined. |
abstract void |
parseMapping(org.w3c.dom.Element mappingElem,
Mapping mapping)
Parses the mapping information related to a particular mapper and builds the corresponding Jorm meta-information. |
void |
setCurrentClass(Class currentClass)
Assigns the current Class object to a parser in order from it to retrieve the meta-objects (for example, PrimitiveElement objects) that are referenced from XML mapping elements. |
void |
setidvalue2genclassref(java.util.Map idvalue2genclassref)
Assigns an HashTable object to the MappingParser object. |
void |
setLogger(Logger logger)
Defines a logger object. |
void |
setLoggerFactory(LoggerFactory loggerfactory)
Defines the logger factory to obtain new loggers. |
void |
setMetaInfoManager(Manager mim)
Assigns a meta-information manager to a parser in order from it to create the meta-information related to the XML files it parses. |
void |
setmotable(java.util.Hashtable motable)
Assigns an HashTable object to the MappingParser object. |
void |
setPathExplorer(PathExplorer pathExpl)
Assigns a PathExplorer object for locating files that have to be parsed. |
Methods inherited from class org.objectweb.jorm.xml2mi.lib.ParserHelper |
getIdNameDef, getIdNameDef |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
protected Manager metaInfoManager
protected Class currentClass
protected PathExplorer pathExplorer
protected java.util.Map idvalue2genclassref
Constructor Detail |
public BasicMappingParser()
Method Detail |
public void setMetaInfoManager(Manager mim)
setMetaInfoManager
in interface MappingParser
mim
- the meta-information Manager to be associated to this
parserpublic void setPathExplorer(PathExplorer pathExpl)
setPathExplorer
in interface MappingParser
pathExpl
- The PathExplorer to be used for file locationpublic void setCurrentClass(Class currentClass)
setCurrentClass
in interface MappingParser
currentClass
- the Jorm meta-object associated to the parsed class.protected NameDef getRefNameDef(java.lang.String linkend, java.lang.String tagName)
linkend
- a String object whose structure is defined as follows: /fqcn/fn/name or fn/name,
tagName a String object whose value matches "rdb-class-ref-mapping" or
"rdb-gen-class-ref-mapping".
protected NameDef getNameDefFromSuper(java.lang.String linkend)
linkend
- a String object whose structure is defined as follows:
/fqcn or /fqcn/name,
protected PrimitiveElement getPrimitiveElement(java.lang.String linkend)
protected java.lang.String getFieldName(org.w3c.dom.Element nameDef)
nameDef
- the name-def element.
protected NameDef getClassRefNameDef(Class clazz, java.lang.String fieldName, java.lang.String name)
protected int getGenClassNestingLevel(org.w3c.dom.Element fromElem, java.lang.String fieldName)
protected NameDef getGenClassRefNameDef(Class clazz, java.lang.String fieldName, java.lang.String name, int nestingLevel)
protected GenClassRef getGenClassRef(Class clazz, java.lang.String fieldName, int nestingLevel)
public abstract void parseMapping(org.w3c.dom.Element mappingElem, Mapping mapping) throws PException
parseMapping
in interface MappingParser
mappingElem
- the current XML node.mapping
- a Mapping object.
PException
public void setidvalue2genclassref(java.util.Map idvalue2genclassref)
setidvalue2genclassref
in interface MappingParser
idvalue2genclassref
- an HashTable that associates an id value with a GenClassRef object.public void setmotable(java.util.Hashtable motable)
setmotable
in interface MappingParser
motable
- an HashTable that associates a pd file to its corresponding MetaObject.public void setLogger(Logger logger)
setLogger
in interface Loggable
setLogger
in class ParserHelper
logger
- the logger objectpublic void setLoggerFactory(LoggerFactory loggerfactory)
setLoggerFactory
in interface Loggable
setLoggerFactory
in class ParserHelper
loggerfactory
- The LoggerFactory object to obtain a logger objectpublic Logger getLogger()
Loggable
getLogger
in interface Loggable
getLogger
in class ParserHelper
public LoggerFactory getLoggerFactory()
Loggable
getLoggerFactory
in interface Loggable
getLoggerFactory
in class ParserHelper
|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |