org.objectweb.jorm.parser.lib.file
Class FileParser

org.objectweb.jorm.parser.lib.file.FileParser
All Implemented Interfaces:
Loggable

public class FileParser
implements Loggable

Author:
Sebastien Chassande-Barrioz

Field Summary
protected  org.objectweb.util.monolog.api.Logger logger
           
protected  org.objectweb.util.monolog.api.LoggerFactory loggerFactory
           
protected  java.lang.String mapperName
           
protected  java.lang.String mappingName
           
protected  Manager metaInfoManager
           
protected  org.objectweb.util.io.api.PathExplorer pathExplorer
           
 
Constructor Summary
FileParser()
           
 
Method Summary
 org.objectweb.util.monolog.api.Logger getLogger()
          Returns a logger to an component that wants to log things.
 org.objectweb.util.monolog.api.LoggerFactory getLoggerFactory()
          Returns a logger factory that allows the creation of new loggers.
 void parseMapping(org.w3c.dom.Element node, Class class_)
          Parses the mapping part of the XML file and builds the corresponding meta-information for a given Class object.
 void parseMapping(org.w3c.dom.Element node, GenClassRef genClassRef)
          Parses the mapping part of the XML file and builds the corresponding meta-information for a given GenClassRef object.
 void parseMapping(org.w3c.dom.Element node, PrimitiveElement primitiveElement)
          Parses the mapping part of the XML file and builds the corresponding meta-information for a given PrimitiveElement object.
 void setLogger(org.objectweb.util.monolog.api.Logger l)
          Assigns a logger to an component that wants to log things.
 void setLoggerFactory(org.objectweb.util.monolog.api.LoggerFactory lf)
          Assigns a logger factory that allows the creation of new loggers.
 void setMapperName(java.lang.String mn)
          Sets the name of the mapper to use.
 void setMappingName(java.lang.String mn)
          Sets the name of the mapping to use.
 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 setPathExplorer(org.objectweb.util.io.api.PathExplorer pe)
          Assigns a PathExplorer object for locating files that have to be parsed.
 

Field Detail

logger

protected org.objectweb.util.monolog.api.Logger logger

loggerFactory

protected org.objectweb.util.monolog.api.LoggerFactory loggerFactory

pathExplorer

protected org.objectweb.util.io.api.PathExplorer pathExplorer

mapperName

protected java.lang.String mapperName

mappingName

protected java.lang.String mappingName

metaInfoManager

protected Manager metaInfoManager
Constructor Detail

FileParser

public FileParser()
Method Detail

parseMapping

public void parseMapping(org.w3c.dom.Element node,
                         Class class_)
Parses the mapping part of the XML file and builds the corresponding meta-information for a given Class object. Manager, PathExplorer, MapperName and MappingName must be set before the call of this method.
Parameters:
node - the node to treat
class_ - the class to complete

parseMapping

public void parseMapping(org.w3c.dom.Element node,
                         PrimitiveElement primitiveElement)
Parses the mapping part of the XML file and builds the corresponding meta-information for a given PrimitiveElement object. Manager, PathExplorer, MapperName and MappingName must be set before the call of this method.
Parameters:
node - the node to treat
primitiveElement - the primitive element to complete

parseMapping

public void parseMapping(org.w3c.dom.Element node,
                         GenClassRef genClassRef)
Parses the mapping part of the XML file and builds the corresponding meta-information for a given GenClassRef object. Manager, PathExplorer, MapperName and MappingName must be set before the call of this method.
Parameters:
node - the node to treat
genClassRef - the generic class reference to complete

setMetaInfoManager

public 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.
Parameters:
mim - the meta-information Manager to be associated to this parser

setPathExplorer

public void setPathExplorer(org.objectweb.util.io.api.PathExplorer pe)
Assigns a PathExplorer object for locating files that have to be parsed.
Parameters:
pathexpl - The PathExplorer to be used for file location

setMapperName

public void setMapperName(java.lang.String mn)
Sets the name of the mapper to use. This name is passed on the command line or defined in a properties file.
Parameters:
mapperName - the name of the mapper

setMappingName

public void setMappingName(java.lang.String mn)
Sets the name of the mapping to use. This name is passed on the command line or defined in a properties file.
Parameters:
mappingName - the name of the mapping

getLogger

public org.objectweb.util.monolog.api.Logger getLogger()
Description copied from interface: Loggable
Returns a logger to an component that wants to log things.
Specified by:
getLogger in interface Loggable
Following copied from interface: org.objectweb.jorm.util.api.Loggable
Parameters:
logger - the logger object

getLoggerFactory

public org.objectweb.util.monolog.api.LoggerFactory getLoggerFactory()
Description copied from interface: Loggable
Returns a logger factory that allows the creation of new loggers.
Specified by:
getLoggerFactory in interface Loggable
Following copied from interface: org.objectweb.jorm.util.api.Loggable
Parameters:
loggerfactory - the LoggerFactory object to obtain new loggers

setLogger

public void setLogger(org.objectweb.util.monolog.api.Logger l)
Description copied from interface: Loggable
Assigns a logger to an component that wants to log things.
Specified by:
setLogger in interface Loggable
Following copied from interface: org.objectweb.jorm.util.api.Loggable
Parameters:
logger - the logger object

setLoggerFactory

public void setLoggerFactory(org.objectweb.util.monolog.api.LoggerFactory lf)
Description copied from interface: Loggable
Assigns a logger factory that allows the creation of new loggers.
Specified by:
setLoggerFactory in interface Loggable
Following copied from interface: org.objectweb.jorm.util.api.Loggable
Parameters:
loggerfactory - the LoggerFactory object to obtain new loggers