SolarMetric Kodo JDO 2.5.0 Reverse Schema Tool

com.solarmetric.rd.meta
Class ClassArgParser

java.lang.Object
  |
  +--org.xml.sax.helpers.DefaultHandler
        |
        +--com.solarmetric.rd.meta.XMLMetaDataParser
              |
              +--com.solarmetric.rd.meta.CFMetaDataParser
                    |
                    +--com.solarmetric.rd.meta.ClassArgParser
All Implemented Interfaces:
org.xml.sax.ContentHandler, org.xml.sax.DTDHandler, org.xml.sax.EntityResolver, org.xml.sax.ErrorHandler, MetaDataParser

public class ClassArgParser
extends CFMetaDataParser

Concrete metadata parser used to resolve arguments into java classes. Interprets command-line args as either class names, .class files or resources, .java files or resource, or metadata files or resources conforming to the common format defined by CFMetaDataParser. Transforms the information in these args into Class instances.

Note that when parsing .java files, only the main class in the file is detected. Other classes defined in the file, such as inner classes, are not added to the returned classes list.

Unlike other MetaDataParsers, you do not have to call MetaDataParser.clear() on the class arg parser.

See Also:
ClassLoader.getResource(java.lang.String)

Constructor Summary
ClassArgParser()
           
 
Method Summary
protected  void endClass(java.lang.String className)
          Override this method marking the end of a declared <class>.
protected  void endClassElement(java.lang.String name)
          Override this method marking the end of an element within a declared <class>.
protected  java.lang.String getExtension()
          Override this method to return the extension used for metadata resources.
 java.lang.Class[] parseClasses(java.lang.String arg)
          Return the Class representation of the class(es) named in the given arg.
 java.lang.String[] parseClassNames(java.lang.String arg)
          Return the names of the class(es) from the given arg.
protected  void startClass(java.lang.String name, org.xml.sax.Attributes attrs)
          Override this method marking the start of a declared <class>.
protected  void startClassElement(java.lang.String name, org.xml.sax.Attributes attrs)
          Override this method marking the start of an element within a declared <class>.
 
Methods inherited from class com.solarmetric.rd.meta.CFMetaDataParser
classForName, endElement, getDeclaredClass, getDeclaredPackage, reset, startElement
 
Methods inherited from class com.solarmetric.rd.meta.XMLMetaDataParser
addResult, characters, clear, currentClassLoader, endElement, error, fatalError, findMetaData, finish, getClassLoader, getCurrentLocation, getDocType, getLocation, getLog, getResults, getSourceFile, getSourceName, getText, isValidating, parse, parse, parse, parse, setClassLoader, setDocumentLocator, setLocation, setLog, setValidating, startElement, throwException, throwException
 
Methods inherited from class org.xml.sax.helpers.DefaultHandler
endDocument, endPrefixMapping, ignorableWhitespace, notationDecl, processingInstruction, resolveEntity, skippedEntity, startDocument, startPrefixMapping, unparsedEntityDecl, warning
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ClassArgParser

public ClassArgParser()
Method Detail

parseClasses

public java.lang.Class[] parseClasses(java.lang.String arg)
Return the Class representation of the class(es) named in the given arg.

Parameters:
arg - a class name, .java file, .class file, or metadata file naming the type(s) to act on

parseClassNames

public java.lang.String[] parseClassNames(java.lang.String arg)
Return the names of the class(es) from the given arg.

Parameters:
arg - a class name, .java file, .class file, or metadata file naming the type(s) to act on
Throws:
java.lang.IllegalArgumentException - with appropriate message on error

getExtension

protected java.lang.String getExtension()
Description copied from class: XMLMetaDataParser
Override this method to return the extension used for metadata resources.

Specified by:
getExtension in class XMLMetaDataParser

startClass

protected void startClass(java.lang.String name,
                          org.xml.sax.Attributes attrs)
                   throws org.xml.sax.SAXException
Description copied from class: CFMetaDataParser
Override this method marking the start of a declared <class>. The given class name will not include the package.

Specified by:
startClass in class CFMetaDataParser
org.xml.sax.SAXException

endClass

protected void endClass(java.lang.String className)
                 throws org.xml.sax.SAXException
Description copied from class: CFMetaDataParser
Override this method marking the end of a declared <class>. The given class name will not include the package.

Specified by:
endClass in class CFMetaDataParser
org.xml.sax.SAXException

startClassElement

protected void startClassElement(java.lang.String name,
                                 org.xml.sax.Attributes attrs)
                          throws org.xml.sax.SAXException
Description copied from class: CFMetaDataParser
Override this method marking the start of an element within a declared <class>.

Specified by:
startClassElement in class CFMetaDataParser
org.xml.sax.SAXException

endClassElement

protected void endClassElement(java.lang.String name)
                        throws org.xml.sax.SAXException
Description copied from class: CFMetaDataParser
Override this method marking the end of an element within a declared <class>.

Specified by:
endClassElement in class CFMetaDataParser
org.xml.sax.SAXException

SolarMetric Kodo JDO 2.5.0 Reverse Schema Tool

Copyright 2001,2002,2003 SolarMetric, Inc. All Rights Reserved.