|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--org.apache.xerces.impl.validation.datatypes.eTypes.Models.AbstractProperty
This class models a property which consists of a set of sub-properties, each of
which can be constrained. Each of these sub-properties corresponds to a column in the
subProp
array and requires two static methods. One method (eval)
expects the argument to validate and the sub-property constraint as parameters. It
returns null if and only if the object fails to satisfy the constraint. The second
(merge) expects the result of eval and a 'running total' as arguments and returns a
new running total. Note the (1) twin (used by factory methods) assumes that the
objects used as constraints are not modified and (2) accumulation assumes that a
newly constructed object has null
in the third row of
subProp[3][#sub-properties].
Inner Class Summary | |
class |
AbstractProperty.AbstractSummary
|
Inner classes inherited from class org.apache.xerces.impl.validation.datatypes.eTypes.Interfaces.Property |
Property.ValidationSummary |
Field Summary | |
static int |
classNumberSubProperties
subProperties are the things that can be accumulated. |
static java.util.Hashtable |
ht
Table use to keep track of classNumberSubProperties for different classes |
protected java.lang.Boolean |
required
|
Fields inherited from interface org.apache.xerces.impl.validation.datatypes.eTypes.Interfaces.Property |
accumulate,
classNumberSubProperties,
constraint,
eval,
instance,
merge |
Constructor Summary | |
|
AbstractProperty()
|
protected |
AbstractProperty(java.lang.Class cl)
sets underlying type of property |
protected |
AbstractProperty(java.lang.Class cl,
java.lang.String str)
Sets underlying type and name of property |
Method Summary | |
boolean |
accumulate(java.lang.Object dt)
|
void |
add2Report(java.lang.String msg)
|
java.lang.Object |
clone()
|
protected abstract void |
enableSubProp(java.lang.String name)
The next method is included to remind developer's that they are responsible for setting the eval and merge functions for subProp's for classes which they define. |
java.lang.Class |
getJClass()
The property uses a particular class for its internal representation. |
java.lang.String |
getName()
Name of property |
boolean |
getPossible(int i)
|
Property.ValidationSummary |
getReport()
|
java.lang.Object |
getSubProp(int i,
java.lang.Integer type)
|
protected java.lang.reflect.Method |
getSubPropEval(int i)
|
protected java.lang.reflect.Method |
getSubPropMerge(int i)
|
java.lang.String |
getSubPropName(int i)
|
int |
getSubPropNameIndex(java.lang.String s)
|
void |
merge()
For each subProp. |
void |
msg(java.lang.String m)
|
void |
resetAccumulator()
|
void |
resetConstraint()
|
void |
resetInstance()
|
void |
setJClass(java.lang.Class newJClass)
|
void |
setName(java.lang.String newName)
|
void |
setPossible(boolean newPossible,
int i)
|
void |
setRequired(java.lang.Boolean newRequired)
|
void |
setSubProp(java.lang.Object o,
int i,
java.lang.Integer type)
|
void |
setSubProp(java.lang.Object o,
int i,
java.lang.String name,
java.lang.Integer type)
|
void |
setSubPropEval(int i,
java.lang.reflect.Method m)
Sets the method that will be used to determine whether an object satisfies a constraint. |
void |
setSubPropMerge(int i,
java.lang.reflect.Method mergeMethod)
Sets the method that will be used to accumulate an object representing subProp-i on a sequence of objects validated by this property. |
protected void |
setSubPropName(int i,
java.lang.String s)
|
java.lang.String |
toString()
|
Property |
twin()
Returns 'virgin' Property which has same constraint as this, and methods as this but no experience, i.e. |
boolean |
validate(java.lang.Object obj)
validate returns false if (a) for some non-null subProp[ Property.constraint ], the result of subPropEval is null, or the validate method of the derived class sets possible[ instance ] = false. |
Methods inherited from class java.lang.Object |
equals,
finalize,
getClass,
hashCode,
notify,
notifyAll,
wait,
wait,
wait |
Field Detail |
protected java.lang.Boolean required
public static final int classNumberSubProperties
public static java.util.Hashtable ht
Constructor Detail |
public AbstractProperty()
protected AbstractProperty(java.lang.Class cl)
protected AbstractProperty(java.lang.Class cl, java.lang.String str)
Method Detail |
public boolean accumulate(java.lang.Object dt)
public void add2Report(java.lang.String msg)
public java.lang.Object clone()
protected abstract void enableSubProp(java.lang.String name)
public java.lang.Class getJClass()
public java.lang.String getName()
public boolean getPossible(int i)
i
- intpublic Property.ValidationSummary getReport()
public final java.lang.Object getSubProp(int i, java.lang.Integer type)
protected java.lang.reflect.Method getSubPropEval(int i)
protected java.lang.reflect.Method getSubPropMerge(int i)
public java.lang.String getSubPropName(int i)
public int getSubPropNameIndex(java.lang.String s)
public void merge()
public final void msg(java.lang.String m)
public final void resetAccumulator()
public final void resetConstraint()
public final void resetInstance()
public void setJClass(java.lang.Class newJClass)
public void setName(java.lang.String newName)
public void setPossible(boolean newPossible, int i)
newPossible
- booleanpublic void setRequired(java.lang.Boolean newRequired)
public final void setSubProp(java.lang.Object o, int i, java.lang.Integer type)
public final void setSubProp(java.lang.Object o, int i, java.lang.String name, java.lang.Integer type)
public void setSubPropEval(int i, java.lang.reflect.Method m)
Object mergeMethod(Object currentEval, Object runningAccumulation)
. public void setSubPropMerge(int i, java.lang.reflect.Method mergeMethod)
Object mergeMethod(Object currentEval, Object runningAccumulation)
. protected void setSubPropName(int i, java.lang.String s)
public final java.lang.String toString()
public Property twin()
non-mutable: name, jClass, required, sValue, method
mutable: possible, subProp, subPropName, subPropMethod, re, enumValues, report
public boolean validate(java.lang.Object obj)
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |