Package org.apache.openjpa.lib.meta
Class ClassArgParser
java.lang.Object
org.apache.openjpa.lib.meta.ClassArgParser
Parser used to resolve arguments into java classes.
Interprets command-line args as either class names, .class files or
resources, .java files or resources, 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.- Author:
- Abe White
-
Nested Class Summary
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionThe class loader with which to load parsed classes.Return a mapping of each metadata resource to an array of its contained class names.mapTypes
(MetaDataIterator itr) Return a mapping of each metadata resource to an array of its contained classes.String[]
parseTypeNames
(String arg) Return the names of the class(es) from the given arg.String[]
Return the names of the class(es) from the given metadatas.Class<?>[]
parseTypes
(String arg) Return theClass
representation of the class(es) named in the given arg.Class<?>[]
Return theClass
representation of the class(es) named in the given metadatas.void
setClassLoader
(ClassLoader loader) The class loader with which to load parsed classes.void
setMetaDataStructure
(String packageElementName, String packageAttributeName, String[] classElementNames, String classAttributeName) Set the the relevant metadata file structure so that metadata files containing class names can be parsed.
-
Constructor Details
-
ClassArgParser
public ClassArgParser()
-
-
Method Details
-
getClassLoader
The class loader with which to load parsed classes. -
setClassLoader
The class loader with which to load parsed classes. -
setMetaDataStructure
public void setMetaDataStructure(String packageElementName, String packageAttributeName, String[] classElementNames, String classAttributeName) Set the the relevant metadata file structure so that metadata files containing class names can be parsed. Null attribute names indicate that the text content of the element contains the data. -
parseTypes
Return theClass
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
-
parseTypes
Return theClass
representation of the class(es) named in the given metadatas. -
mapTypes
Return a mapping of each metadata resource to an array of its contained classes. -
parseTypeNames
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:
IllegalArgumentException
- with appropriate message on error
-
parseTypeNames
Return the names of the class(es) from the given metadatas. -
mapTypeNames
Return a mapping of each metadata resource to an array of its contained class names.
-