org.apache.commons.betwixt
Class Descriptor

java.lang.Object
  extended by org.apache.commons.betwixt.Descriptor
Direct Known Subclasses:
NodeDescriptor, TextDescriptor

public abstract class Descriptor
extends java.lang.Object

Describes a content node mapping.

Common superclass for types of Descriptor

Since:
0.5
Author:
Robert Burrell Donkin

Constructor Summary
Descriptor()
          Base constructor
 
Method Summary
 Options getOptions()
          Gets the options for this descriptor.
 java.lang.String getPropertyName()
          Gets the name of the bean property to which this node refers
 java.lang.Class getPropertyType()
          Gets the type of the bean property associated with this node, if any
 java.lang.Class getSingularPropertyType()
          Gets the underlying type ignoring any wrapping a Collection or Array.
 Expression getTextExpression()
          Gets the expression used to evaluate the text value of this node for a particular Context.
 Updater getUpdater()
          Gets the Updater used to update a Context from the text value corresponding to this node in an xml document
 void setOptions(Options options)
          Sets the options for this descriptor.
 void setPropertyName(java.lang.String propertyName)
          Sets the name of the bean property to which this node refers
 void setPropertyType(java.lang.Class propertyType)
          Sets the type of the bean property associated with this node, if any
 void setSingularPropertyType(java.lang.Class singularPropertyType)
          Sets the underlying type ignoring any wrapping Collection or Array.
 void setTextExpression(Expression textExpression)
          Sets the expression used to evaluate the text value of this node for a particular Context
 void setUpdater(Updater updater)
          Sets the Updater used to update a Context from the text value corresponding to this node in an xml document
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

Descriptor

public Descriptor()
Base constructor

Method Detail

getTextExpression

public Expression getTextExpression()
Gets the expression used to evaluate the text value of this node for a particular Context.

Returns:
the expression used to evaluate the text value of this node

setTextExpression

public void setTextExpression(Expression textExpression)
Sets the expression used to evaluate the text value of this node for a particular Context

Parameters:
textExpression - the Expression to be used to evaluate the value of this node

getUpdater

public Updater getUpdater()
Gets the Updater used to update a Context from the text value corresponding to this node in an xml document

Returns:
the Update that should be used to update the value of this node

setUpdater

public void setUpdater(Updater updater)
Sets the Updater used to update a Context from the text value corresponding to this node in an xml document

Parameters:
updater - the Updater to be used to update the values of this node

getPropertyType

public java.lang.Class getPropertyType()
Gets the type of the bean property associated with this node, if any

Returns:
the property type associated with this node, if any

setPropertyType

public void setPropertyType(java.lang.Class propertyType)
Sets the type of the bean property associated with this node, if any

Parameters:
propertyType - the Class of the bean property

getPropertyName

public java.lang.String getPropertyName()
Gets the name of the bean property to which this node refers

Returns:
the name of the bean property to which this node refers to, or null if it is just a constant

setPropertyName

public void setPropertyName(java.lang.String propertyName)
Sets the name of the bean property to which this node refers

Parameters:
propertyName - the name of the bean property. Or null, if this node is not mapped to to a bean property

getSingularPropertyType

public java.lang.Class getSingularPropertyType()
Gets the underlying type ignoring any wrapping a Collection or Array.

Returns:
if this property is a 1-N relationship then this returns the type of a single property value.

setSingularPropertyType

public void setSingularPropertyType(java.lang.Class singularPropertyType)
Sets the underlying type ignoring any wrapping Collection or Array.

Parameters:
singularPropertyType - the Class of the items in the Collection or Array. If node is associated with a collective bean property, then this should not be null.

getOptions

public Options getOptions()
Gets the options for this descriptor. Options are used to communicate non-declarative (optinal) behaviour hints.

Returns:
Options, not null

setOptions

public void setOptions(Options options)
Sets the options for this descriptor. Options are used to communicate non-declarative (optinal) behaviour hints.

Parameters:
options -


Copyright 2002-2008 The Apache Software Foundation. All Rights Reserved.