public final class ModelBuilder
extends java.lang.Object
Modifier and Type | Field and Description |
---|---|
private java.util.Properties |
handlerMapping
The handler mapping.
|
private static ModelBuilder |
instance
The single instance.
|
Modifier | Constructor and Description |
---|---|
private |
ModelBuilder()
Creates a single instance.
|
Modifier and Type | Method and Description |
---|---|
void |
addAttributeHandlers(java.util.Properties p)
Adds attribute handlers.
|
DescriptionModel |
buildModel(SourceCollector c,
DescriptionModel model)
Builds a model from the classes provided by the
SourceCollector . |
private boolean |
contains(java.lang.Class[] cAll,
java.lang.Class c)
Checks, whether the class
c is contained in the given
class array. |
private ClassDescription |
createClassDescription(java.beans.BeanInfo beanInfo,
ClassDescription parent)
Creates a
ClassDescription object for the specified bean info. |
PropertyInfo |
createSimplePropertyInfo(java.beans.PropertyDescriptor pd)
Creates a
PropertyInfo object from a PropertyDescriptor . |
private java.lang.Class[] |
fillModel(java.lang.Class[] classes,
DescriptionModel model)
Updates the model to contain the given classes.
|
private void |
fillSuperClasses(DescriptionModel model)
Fills the super class for all object descriptions of the model.
|
private java.lang.Class[] |
findElementTypes(DescriptionModel model) |
private java.lang.String |
getHandlerClass(java.lang.Class c)
Returns the class name for the attribute handler for a property of the specified class.
|
static ModelBuilder |
getInstance()
Returns the single instance of this class.
|
private boolean |
isAttributeProperty(java.lang.Class c)
Checks, whether the given class can be handled as attribute.
|
static boolean |
isValidMethod(java.lang.reflect.Method method)
Checks, whether the given method can be called from the generic object factory.
|
private static ModelBuilder instance
private java.util.Properties handlerMapping
public static ModelBuilder getInstance()
public void addAttributeHandlers(java.util.Properties p)
p
- the handlers.public DescriptionModel buildModel(SourceCollector c, DescriptionModel model)
SourceCollector
.
The DescriptionGenerator
class invokes this.
c
- the source collector.model
- the model under construction (null
permitted).private java.lang.Class[] findElementTypes(DescriptionModel model)
private void fillSuperClasses(DescriptionModel model)
model
- the model which should get its superclasses updated.private java.lang.Class[] fillModel(java.lang.Class[] classes, DescriptionModel model)
classes
- a list of classes which should be part of the model.model
- the model which is updatedprivate ClassDescription createClassDescription(java.beans.BeanInfo beanInfo, ClassDescription parent)
ClassDescription
object for the specified bean info.beanInfo
- the bean info.parent
- the parent class description.public static boolean isValidMethod(java.lang.reflect.Method method)
method
- the method descriptorpublic PropertyInfo createSimplePropertyInfo(java.beans.PropertyDescriptor pd)
PropertyInfo
object from a PropertyDescriptor
.pd
- the property descriptor.null
possible).private boolean isAttributeProperty(java.lang.Class c)
c
- the class which should be checkedprivate java.lang.String getHandlerClass(java.lang.Class c)
c
- the class for which to search an attribute handlerprivate boolean contains(java.lang.Class[] cAll, java.lang.Class c)
c
is contained in the given
class array.cAll
- the list of all classesc
- the class to be searched