oracle.cabo.share.xml.beans
Class PropertyDef
java.lang.Object
|
+--oracle.cabo.share.xml.beans.PropertyDef
- Direct Known Subclasses:
- BasePropertyDef
- public abstract class PropertyDef
- extends java.lang.Object
Class for defining a bean property to the parser engine.
=-=AEW Should more of these take a ParseContext? Is there a way we can get around needing the ParseContext at all?
Constructor Summary |
PropertyDef()
Creates a PropertyDef. |
Method Summary |
abstract java.lang.String |
getName()
|
abstract java.lang.Class |
getPropertyType()
Returns the property type to which all non-null values of this property must be assignable. |
abstract java.lang.Object |
getValue(ParseContext context, java.lang.Object bean)
Retrieves the value of this property from the bean. |
abstract java.lang.Object |
parseText(ParseContext context, java.lang.String text)
Parses a string into the correct Java type for this class. |
java.lang.Object |
parseText(ParseContext context, java.lang.String attrURI, java.lang.String attrText)
Parses a string into the correct Java type for this class. |
abstract void |
setValue(ParseContext context, java.lang.Object bean, java.lang.Object value)
Stores a value of this property on the bean. |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
PropertyDef
public PropertyDef()
- Creates a PropertyDef.
getName
public abstract java.lang.String getName()
getValue
public abstract java.lang.Object getValue(ParseContext context,
java.lang.Object bean)
- Retrieves the value of this property from the bean.
-
- Returns:
- the value. Will return null if this property can only be set.
setValue
public abstract void setValue(ParseContext context,
java.lang.Object bean,
java.lang.Object value)
- Stores a value of this property on the bean.
getPropertyType
public abstract java.lang.Class getPropertyType()
- Returns the property type to which all non-null values of this property must be assignable.
-
- Returns:
- the property type
parseText
public abstract java.lang.Object parseText(ParseContext context,
java.lang.String text)
throws java.lang.IllegalArgumentException
- Parses a string into the correct Java type for this class. The returned object must be an instance of the class returned by getPropertyType().
-
- Parameters:
context
- the current parsing context
text
- the text of the property
- Throws:
java.lang.IllegalArgumentException
- if the text cannot be parsed.
parseText
public java.lang.Object parseText(ParseContext context,
java.lang.String attrURI,
java.lang.String attrText)
throws java.lang.IllegalArgumentException
- Parses a string into the correct Java type for this class. The returned object must be an instance of the class returned by getPropertyType().
-
- Parameters:
context
- the current parsing context
attrURI
- the namespace of the attribute
attrText
- the text of the attribute
- Throws:
java.lang.IllegalArgumentException
- if the text cannot be parsed.