|
Joda System API | ||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--org.joda.property.JodaFactory
Factory used to create new PropertyTools. This can be used either by using the static create method, or by creating your own factory and calling create() on the instance.
In use, the code might look like:
Person person = (Person) PropertyFactory.create(Person.class);
Applications may choose to have their own class which provides more convenient typecast methods.
Constructor Summary | |
JodaFactory()
|
Method Summary | |
static Bean |
create(java.lang.Class intface)
Create a new Bean for the specified interface. |
static Bean |
create(java.lang.Class intface,
java.lang.String name)
Create a new Bean using the default factory. |
Bean |
createBean(java.lang.Class intface)
Create a new top level Bean. |
abstract Bean |
createBean(java.lang.Class intface,
java.lang.String name)
Create a new top level Bean. |
abstract BeanList |
createBeanList(java.lang.Class intface)
Create a wrapper for a list of beans that can have a typecast get method. |
static BeanList |
createList(java.lang.Class intface)
Create a new BeanList for the specified interface. |
abstract Property |
createProperty(Bean bean,
java.lang.String name,
java.lang.Class intface)
Create a new Property and attach it to a particular Bean. |
abstract Property |
createProperty(Bean bean,
java.lang.String name,
java.lang.Class intface,
java.lang.Class[] types)
Create a new Property and attach it to a particular Bean. |
abstract Property |
createProperty(Bean bean,
java.lang.String name,
java.lang.Class intface,
java.lang.Class[] types,
PropertyData data)
Create a new Property and attach it to a particular Bean. |
static JodaFactory |
getInstance()
Gets the default factory for use in the JVM. |
static boolean |
isFireEvents()
Gets whether to fire events. |
static void |
setFireEvents(boolean fireEvents)
Sets whether to fire events. |
static void |
setPropertyFactory(JodaFactory factory)
Sets the default factory for use in the JVM. |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
public JodaFactory()
Method Detail |
public static Bean create(java.lang.Class intface)
intface
- the bean interface (extends Bean)
FactoryException
- if the object cannot be createdpublic static Bean create(java.lang.Class intface, java.lang.String name)
intface
- the bean interface (extends Bean)name
- the name of the bean
FactoryException
- if the object cannot be createdpublic static BeanList createList(java.lang.Class intface)
intface
- the bean interface (extends BeanList)
FactoryException
- if the object cannot be createdpublic static JodaFactory getInstance()
public static void setPropertyFactory(JodaFactory factory)
factory
- the PropertyFactory to set as the defaultpublic abstract Bean createBean(java.lang.Class intface, java.lang.String name)
intface
- the bean interface (extends Bean)name
- the name of the bean
public Bean createBean(java.lang.Class intface)
intface
- the bean interface (extends Bean)
public abstract BeanList createBeanList(java.lang.Class intface)
intface
- the bean list interface (extends BeanList)public abstract Property createProperty(Bean bean, java.lang.String name, java.lang.Class intface)
bean
- the bean the property is to be attached toname
- the name of the propertyintface
- the property interface (extends Property)
public abstract Property createProperty(Bean bean, java.lang.String name, java.lang.Class intface, java.lang.Class[] types)
The Property interface is typically XxxProperty. This method gives more control over specifying the type of related object.
The Property type array must match the required interface. For simple interfaces such as StringProperty, the array has one element - String.
For a link interface LinkProperty, the array has one element - the bean type.
For list property interfaces, LinkListProperty and DataListProperty, the array has two elements, List.class and the type of object in the list
For map property interfaces, LinkMapProperty and DataMapProperty, the array has three elements, Map and the type of the key and the type of the value in the map.
bean
- the bean the property is to be attached toname
- the name of the propertyintface
- the property interface (extends Property)types
- the property types (do not extend Property)
public abstract Property createProperty(Bean bean, java.lang.String name, java.lang.Class intface, java.lang.Class[] types, PropertyData data)
The Property interface is typically XxxProperty. This method gives more control over specifying the type of related object.
The Property type array must match the required interface. For simple interfaces such as StringProperty, the array has one element - String.
For a link interface LinkProperty, the array has one element - the bean type.
For list property interfaces, LinkListProperty and DataListProperty, the array has two elements, List.class and the type of object in the list
For map property interfaces, LinkMapProperty and DataMapProperty, the array has three elements, Map and the type of the key and the type of the value in the map.
bean
- the bean the property is to be attached toname
- the name of the propertyintface
- the property interface (extends Property)types
- the property types (do not extend Property)data
- the property data object to use
public static boolean isFireEvents()
public static void setFireEvents(boolean fireEvents)
fireEvents
- whether to fire events
|
Joda System API | ||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |