org.webmacro.engine
Class PropertyOperatorCache
java.lang.Object
|
+--org.webmacro.engine.PropertyOperatorCache
- public final class PropertyOperatorCache
- extends java.lang.Object
Method Summary |
java.util.Iterator |
getIterator(java.lang.Object instance)
Evaluate the supplied object and work out a way to return it
as an iterator. |
org.webmacro.engine.PropertyOperator |
getOperator(java.lang.Class type)
|
org.webmacro.engine.PropertyOperator |
getOperator(java.lang.Object obj)
|
java.lang.Object |
getProperty(Context context,
java.lang.Object instance,
java.lang.Object[] names)
Calls getProperty(context, instance, names, 0) |
java.lang.Object |
getProperty(Context context,
java.lang.Object instance,
java.lang.Object[] names,
int start)
Attempt to retrieve a property using the rules of property
introspection described above. |
void |
init(Broker b,
Settings config)
|
boolean |
setProperty(Context context,
java.lang.Object instance,
java.lang.Object[] names,
int start,
java.lang.Object value)
Given a property description name, attempt to set the property
value to the supplied object. |
boolean |
setProperty(Context context,
java.lang.Object instance,
java.lang.Object[] names,
java.lang.Object value)
Calls setProperty(context, names, 0, value) |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
PropertyOperatorCache
public PropertyOperatorCache()
init
public final void init(Broker b,
Settings config)
throws InitException
getOperator
public final org.webmacro.engine.PropertyOperator getOperator(java.lang.Class type)
throws PropertyException
getOperator
public final org.webmacro.engine.PropertyOperator getOperator(java.lang.Object obj)
throws PropertyException
getProperty
public final java.lang.Object getProperty(Context context,
java.lang.Object instance,
java.lang.Object[] names,
int start)
throws PropertyException,
java.lang.SecurityException
- Attempt to retrieve a property using the rules of property
introspection described above. Begin reading names at position
start in the array of names.
- Parameters:
context
- is used to resolve sub-properties in argumentsinstance
- is the root of introspectionnames
- property names, one per array entry- Returns:
- the property described by the names, inside the instance
- Throws:
PropertyException
- the property we'd like to look atSecurityExeption
- you are not permitted to try
getProperty
public final java.lang.Object getProperty(Context context,
java.lang.Object instance,
java.lang.Object[] names)
throws PropertyException,
java.lang.SecurityException
- Calls getProperty(context, instance, names, 0)
setProperty
public final boolean setProperty(Context context,
java.lang.Object instance,
java.lang.Object[] names,
int start,
java.lang.Object value)
throws PropertyException,
java.lang.SecurityException
- Given a property description name, attempt to set the property
value to the supplied object.
- Parameters:
context
- An object containing a propertynames
- The string names of that propertyvalue
- the new value the property is to be set to- Throws:
PropertyException
- not possible to set the propertyjava.lang.SecurityException
- you are not permitted to try
setProperty
public final boolean setProperty(Context context,
java.lang.Object instance,
java.lang.Object[] names,
java.lang.Object value)
throws PropertyException,
java.lang.SecurityException
- Calls setProperty(context, names, 0, value)
getIterator
public final java.util.Iterator getIterator(java.lang.Object instance)
throws PropertyException
- Evaluate the supplied object and work out a way to return it
as an iterator.
- Parameters:
context
- an object believed to represent a list- Returns:
- an Iterator that iterates through that list
- Throws:
PropertyException
- could not extract iterator from instance