Package org.apache.fop.tools
Class EventProducerCollector
- java.lang.Object
-
- org.apache.fop.tools.EventProducerCollector
-
class EventProducerCollector extends java.lang.Object
Finds EventProducer interfaces and builds the event model for them.
-
-
Field Summary
Fields Modifier and Type Field Description private static java.lang.String
CLASSNAME_EVENT_PRODUCER
private java.util.List<EventModel>
models
private static java.util.Map<java.lang.String,java.lang.Class<?>>
PRIMITIVE_MAP
-
Constructor Summary
Constructors Constructor Description EventProducerCollector()
Creates a new EventProducerCollector.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description private EventMethodModel
createMethodModel(com.thoughtworks.qdox.model.JavaMethod method)
java.util.List<EventModel>
getModels()
Returns the event model that has been accumulated.private boolean
implementsInterface(com.thoughtworks.qdox.model.JavaClass clazz, java.lang.String intf)
protected void
processEventProducerInterface(com.thoughtworks.qdox.model.JavaClass clazz)
Processes an EventProducer interface and creates an EventProducerModel from it.boolean
scanFile(java.io.File src)
Scans a file and processes it if it extends theEventProducer
interface.
-
-
-
Field Detail
-
CLASSNAME_EVENT_PRODUCER
private static final java.lang.String CLASSNAME_EVENT_PRODUCER
-
PRIMITIVE_MAP
private static final java.util.Map<java.lang.String,java.lang.Class<?>> PRIMITIVE_MAP
-
models
private java.util.List<EventModel> models
-
-
Method Detail
-
scanFile
public boolean scanFile(java.io.File src) throws java.io.IOException, EventConventionException, java.lang.ClassNotFoundException
Scans a file and processes it if it extends theEventProducer
interface.- Parameters:
src
- the source file (a Java source file)- Returns:
- true if the file contained an EventProducer interface
- Throws:
java.io.IOException
- if an I/O error occursEventConventionException
- if the EventProducer conventions are violatedjava.lang.ClassNotFoundException
- if a required class cannot be found
-
implementsInterface
private boolean implementsInterface(com.thoughtworks.qdox.model.JavaClass clazz, java.lang.String intf)
-
processEventProducerInterface
protected void processEventProducerInterface(com.thoughtworks.qdox.model.JavaClass clazz) throws EventConventionException, java.lang.ClassNotFoundException
Processes an EventProducer interface and creates an EventProducerModel from it.- Parameters:
clazz
- the EventProducer interface- Throws:
EventConventionException
- if the event producer conventions are violatedjava.lang.ClassNotFoundException
- if a required class cannot be found
-
createMethodModel
private EventMethodModel createMethodModel(com.thoughtworks.qdox.model.JavaMethod method) throws EventConventionException, java.lang.ClassNotFoundException
- Throws:
EventConventionException
java.lang.ClassNotFoundException
-
getModels
public java.util.List<EventModel> getModels()
Returns the event model that has been accumulated.- Returns:
- the event model.
-
-