|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--attrib4j.AttributeFactory
Factory for creating ClassAnnotator
and
AttributeExtractor
instances, with discovery and
configuration features similar to that employed by standard Java APIs
such as JAXP. Current implementations are based on IBM CFParse and
Jakarta's BCEL bytecode manipulation libraries.
Note:These classes are not used by client code. The factory does not create 'Attribute' instances. Attributes can be any serializable class and are independent of which bytecode manipulation library is used.
Implementation taken from the jakarata commons logging package.
Field Summary | |
protected static java.util.Hashtable |
factories
The previously constructed AttributeFactory instances,
keyed by the ClassLoader with which it was created. |
static java.lang.String |
FACTORY_DEFAULT
The fully qualified class name of the fallback AttributeFactory
implementation class to use, if no other can be found. |
static java.lang.String |
FACTORY_PROPERTIES
The name of the properties file to search for. |
static java.lang.String |
FACTORY_PROPERTY
The name of the property used to identify the AttributeFactory implementation class name. |
protected static java.lang.String |
SERVICE_ID
JDK1.3+ 'Service Provider' specification ( http://java.sun.com/j2se/1.3/docs/guide/jar/jar.html ) |
Constructor Summary | |
protected |
AttributeFactory()
Protected constructor that is not available for public use. |
Method Summary | |
abstract AttributeExtractor |
getAttributeExtractor()
Method to return a AttributeExtractor . |
abstract ClassAnnotator |
getClassAnnotator(java.io.InputStream is,
java.lang.String classfileName)
Method to return a ClassAnnotator . |
protected static java.lang.ClassLoader |
getContextClassLoader()
Return the thread context class loader if available. |
static AttributeFactory |
getFactory()
Construct (if necessary) and return a AttributeFactory
instance, using the following ordered lookup procedure to determine
the name of the implementation class to be loaded. |
protected static AttributeFactory |
newFactory(java.lang.String factoryClass,
java.lang.ClassLoader classLoader)
Return a new instance of the specified AttributeFactory
implementation class, loaded by the specified class loader. |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
public static final java.lang.String FACTORY_PROPERTY
public static final java.lang.String FACTORY_DEFAULT
AttributeFactory
implementation class to use, if no other can be found.
public static final java.lang.String FACTORY_PROPERTIES
protected static final java.lang.String SERVICE_ID
protected static java.util.Hashtable factories
AttributeFactory
instances,
keyed by the ClassLoader
with which it was created.
Constructor Detail |
protected AttributeFactory()
Method Detail |
public static AttributeFactory getFactory() throws AttributeException
Construct (if necessary) and return a AttributeFactory
instance, using the following ordered lookup procedure to determine
the name of the implementation class to be loaded.
attrib4j.AttributeFactory
system property.attrib4j.properties
file, if found in the class path of this class. The configuration
file is in standard java.util.Properties
format and
contains the fully qualified name of the implementation class
with the key being the system property defined above.attrib4j.bcel.BCELFactory
).
AttributeException
- if the implementation class is not
available or cannot be instantiated.public abstract AttributeExtractor getAttributeExtractor() throws AttributeException
AttributeExtractor
.
AttributeException
- if a suitable AttributeExtractor
instance cannot be returnedpublic abstract ClassAnnotator getClassAnnotator(java.io.InputStream is, java.lang.String classfileName) throws AttributeException
ClassAnnotator
.
classfileName
- the name of the .class file.
AttributeException
- if a suitable AttributeFactor
instance cannot be returnedprotected static java.lang.ClassLoader getContextClassLoader() throws AttributeException
AttributeException
- if a suitable class loader
cannot be identified.protected static AttributeFactory newFactory(java.lang.String factoryClass, java.lang.ClassLoader classLoader) throws AttributeException
AttributeFactory
implementation class, loaded by the specified class loader.
If that fails, try the class loader used to load this
(abstract) AttributeFactory.
factoryClass
- Fully qualified name of the
AttributeFactory
implementation classclassLoader
- ClassLoader from which to load this class
AttributeException
- if a suitable instance
cannot be created
|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |