Save This Page
Home » apache-openjpa-1.1.0-source » org.apache.openjpa.lib » meta » [javadoc | source]
org.apache.openjpa.lib.meta
abstract public class: XMLMetaDataParser [javadoc | source]
java.lang.Object
   org.xml.sax.helpers.DefaultHandler
      org.apache.openjpa.lib.meta.XMLMetaDataParser

All Implemented Interfaces:
    MetaDataParser, LexicalHandler, ErrorHandler, EntityResolver, ContentHandler, DTDHandler

Direct Known Subclasses:
    XMLPersistenceMetaDataParser, ConfigurationParser, XMLSchemaParser, CFMetaDataParser

Custom SAX parser used by the system to quickly parse metadata files. Subclasses should handle the processing of the content.
Method from org.apache.openjpa.lib.meta.XMLMetaDataParser Summary:
addComments,   addResult,   characters,   clear,   comment,   currentClassLoader,   currentComments,   currentDepth,   currentLocation,   currentText,   endCDATA,   endDTD,   endElement,   endElement,   endEntity,   error,   fatalError,   finish,   getClassLoader,   getDocType,   getException,   getException,   getException,   getLexicalHandler,   getLocation,   getLog,   getParseComments,   getParseText,   getResults,   getSchemaSource,   getSourceFile,   getSourceIsSystemId,   getSourceName,   getSuffix,   ignoreContent,   isCaching,   isValidating,   parse,   parse,   parse,   parse,   parse,   parse,   parseNewResource,   parsed,   reset,   setCaching,   setClassLoader,   setDocumentLocator,   setLexicalHandler,   setLocation,   setLog,   setParseComments,   setParseText,   setSourceIsSystemId,   setSuffix,   setValidating,   startCDATA,   startDTD,   startElement,   startElement,   startEntity
Methods from org.xml.sax.helpers.DefaultHandler:
characters,   endDocument,   endElement,   endPrefixMapping,   error,   fatalError,   ignorableWhitespace,   notationDecl,   processingInstruction,   resolveEntity,   setDocumentLocator,   skippedEntity,   startDocument,   startElement,   startPrefixMapping,   unparsedEntityDecl,   warning
Methods from java.lang.Object:
equals,   getClass,   hashCode,   notify,   notifyAll,   toString,   wait,   wait,   wait
Method from org.apache.openjpa.lib.meta.XMLMetaDataParser Detail:
 protected  void addComments(Object obj) 
    Add current comments to the given entity. By default, assumes entity is Commentable .
 protected  void addResult(Object result) 
    Add a result to be returned from the current parse.
 public  void characters(char[] ch,
    int start,
    int length) 
 public  void clear() 
 public  void comment(char[] ch,
    int start,
    int length) throws SAXException 
 protected ClassLoader currentClassLoader() 
    Return the class loader to use when resolving resources and loading classes.
 protected String[] currentComments() 
    Array of comments for the current node, or empty array if none.
 protected int currentDepth() 
    Return the parse depth. Within the root element, the depth is 0, within the first nested element, it is 1, and so forth.
 protected String currentLocation() 
    Return the current location within the source file.
 protected String currentText() 
    Return the text value within the current node.
 public  void endCDATA() throws SAXException 
 public  void endDTD() throws SAXException 
 abstract protected  void endElement(String name) throws SAXException
    Override this method marking the end of some element.
 public  void endElement(String uri,
    String name,
    String qName) throws SAXException 
 public  void endEntity(String name) throws SAXException 
 public  void error(SAXParseException se) throws SAXException 
 public  void fatalError(SAXParseException se) throws SAXException 
 protected  void finish() 
    Override this method to finish up after a parse; this is only called if no errors are encountered during parsing. Subclasses should call super.finish() to resolve superclass state.
 public ClassLoader getClassLoader() 
    Classloader to use for class name resolution.
 protected Reader getDocType() throws IOException 
    Override this method to return any DOCTYPE declaration that should be dynamically included in xml documents that will be validated. Returns null by default.
 protected SAXException getException(String msg) 
    Returns a SAXException with the source file name and the given error message.
 protected SAXException getException(Message msg) 
    Returns a SAXException with the source file name and the given error message.
 protected SAXException getException(Message msg,
    Throwable cause) 
    Returns a SAXException with the source file name and the given error message.
 public LexicalHandler getLexicalHandler() 
    The lexical handler that should be registered with the SAX parser used by this class. Since the org.xml.sax.ext package is not a required part of SAX2, this handler might not be used by the parser.
 public Location getLocation() 
    The XML document location.
 public Log getLog() 
    The log to write to.
 public boolean getParseComments() 
    Whether to parse element comments.
 public boolean getParseText() 
    Whether to parse element text.
 public List getResults() 
 protected Object getSchemaSource() throws IOException 
    Implement to return the XML schema source for the document. Returns null by default. May return:
    • String pointing to schema URI.
    • InputStream containing schema contents.
    • InputSource containing schema contents.
    • File containing schema contents.
    • Array of any of the above elements.
 protected File getSourceFile() 
    Return the file of the source being parsed.
 public boolean getSourceIsSystemId() 
    Whether to use the source name as the XML system id.
 protected String getSourceName() 
    Return the name of the source file being parsed.
 public String getSuffix() 
    Expected suffix for metadata resources, or null if unknown.
 protected  void ignoreContent(boolean ignoreEnd) 
    Ignore all content below the current element.
 public boolean isCaching() 
    Whether parsed resource names are cached to avoid duplicate parsing.
 public boolean isValidating() 
    Whether this is a validating parser.
 public  void parse(String rsrc) throws IOException 
 public  void parse(URL url) throws IOException 
 public  void parse(File file) throws IOException 
 public  void parse(MetaDataIterator itr) throws IOException 
 public  void parse(Class cls,
    boolean topDown) throws IOException 
 public  void parse(Reader xml,
    String sourceName) throws IOException 
 protected  void parseNewResource(Reader xml,
    String sourceName) throws IOException 
    Parse a previously-unseen source. All parsing methods delegate to this one.
 protected boolean parsed(String src) 
    Return true if the given source is parsed. Otherwise, record that it will be parsed.
 protected  void reset() 
    Override this method to clear any state and ready the parser for a new document. Subclasses should call super.reset() to clear superclass state.
 public  void setCaching(boolean caching) 
    Whether parsed resource names are cached to avoid duplicate parsing.
 public  void setClassLoader(ClassLoader loader) 
    Classloader to use for class name resolution.
 public  void setDocumentLocator(Locator locator) 
 public  void setLexicalHandler(LexicalHandler lh) 
    The lexical handler that should be registered with the SAX parser used by this class. Since the org.xml.sax.ext package is not a required part of SAX2, this handler might not be used by the parser.
 public  void setLocation(Location location) 
    The XML document location.
 public  void setLog(Log log) 
    The log to write to.
 public  void setParseComments(boolean comments) 
    Whether to parse element comments.
 public  void setParseText(boolean text) 
    Whether to parse element text.
 public  void setSourceIsSystemId(boolean systemId) 
    Whether to use the source name as the XML system id.
 public  void setSuffix(String suffix) 
    Expected suffix for metadata resources, or null if unknown.
 public  void setValidating(boolean validating) 
    Whether this is a validating parser.
 public  void startCDATA() throws SAXException 
 public  void startDTD(String name,
    String publicId,
    String systemId) throws SAXException 
 abstract protected boolean startElement(String name,
    Attributes attrs) throws SAXException
    Override this method marking the start of some element. If this method returns false, the content of the element and the end element event will be ignored.
 public  void startElement(String uri,
    String name,
    String qName,
    Attributes attrs) throws SAXException 
 public  void startEntity(String name) throws SAXException