DLESE Tools
v1.6.0

org.dlese.dpc.schemedit.input
Class InputField

java.lang.Object
  extended by org.dlese.dpc.schemedit.input.InputField
Direct Known Subclasses:
AnyTypeInputField

public class InputField
extends Object

Helper for translating between http request parameters and metadata elements.

The metadata editor creates request parameters named for the accessor each field uses to obtain its value (e.g., valueOf(/itemRecord/lifecycle/contributors/contributor_2_/person/nameLast)). This class stores information derived from the parameterName, such as the SchemaNode for this field, and provides information about this node that aids in the processing of its value.

Author:
ostwald

Constructor Summary
protected InputField(String paramName, String value, SchemaNode schemaNode, String xpath, InputManager inputManager)
          InputField constructor.
 
Method Summary
 List getEntityErrors()
          returns a list of entity errors found in the value for this InputField
 String getFieldName()
          Gets the leaf of the xpath attribute for the InputField object.
 String getNormalizedXPath()
          Returns an xpath containing no indexing for the element corresponding to this InputField.
 String getParamName()
          Returns the request parameter name for this field.
 SchemaNode getSchemaNode()
          Gets the SchemaNode associated with this InputField.
 String getValue()
          Gets the value entered in the metadata editor for this field.
 String getXPath()
          Gets the xPath attribute of the InputField object.
 boolean hasEntityErrors()
          NOT YET DOCUMENTED
 boolean isAnyType()
          Gets the anyType attribute of the InputField object
 boolean isAttribute()
          Returns true if this field represents an attribute (as opposed to an element).
 boolean isElement()
          Returns true if this field represents an element (as opposed to an attribute).
 boolean isNillable()
          Gets the nillable attribute of the SchemaNode associated with this InputField.
 void setParamName(String paramName)
          Sets the paramName attribute of the InputField object
 void setValue(String str)
          Sets the value attribute of the InputField object.
 void setXPath(String xpath)
          Sets the xPath attribute of the InputField object
 String toString()
          Debugging utility returns a string listing key fields and values.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

InputField

protected InputField(String paramName,
                     String value,
                     SchemaNode schemaNode,
                     String xpath,
                     InputManager inputManager)
InputField constructor. Below are examples of typical parameters:
paramName
valueOf(/itemRecord/lifecycle/contributors/contributor_2_/person/emailAlt)
value
anyone@foo.com
xpath
/itemRecord/lifecycle/contributors/contributor[2]/person/emailAlt
normalizedXPath
/itemRecord/lifecycle/contributors/contributor/person/emailAlt
paramName is used with the error-report mechanism to locate the field element in the UI

Parameters:
paramName - paramName as received from the request
value - the value as received from the request
schemaNode - SchemaNode instance for this field
xpath - the xpath of this field
inputManager - the inputManager instance for this field
Method Detail

getParamName

public String getParamName()
Returns the request parameter name for this field.

E.g., valueOf(/collectionConfigRecord/tuples/tuple_1_/name)

Returns:
The paramName value

setParamName

public void setParamName(String paramName)
Sets the paramName attribute of the InputField object

Parameters:
paramName - The new paramName value

getEntityErrors

public List getEntityErrors()
returns a list of entity errors found in the value for this InputField

Returns:
The entityErrors value

hasEntityErrors

public boolean hasEntityErrors()
NOT YET DOCUMENTED

Returns:
NOT YET DOCUMENTED

getSchemaNode

public SchemaNode getSchemaNode()
Gets the SchemaNode associated with this InputField.

Returns:
The schemaNode value

getXPath

public String getXPath()
Gets the xPath attribute of the InputField object.

Returns:
The xPath value

setXPath

public void setXPath(String xpath)
Sets the xPath attribute of the InputField object

Parameters:
xpath - The new xPath value

getNormalizedXPath

public String getNormalizedXPath()
Returns an xpath containing no indexing for the element corresponding to this InputField.

Note: this is the same path used to key the SchemaNodeMap, so why do we need it as an attribute? Could this accessor just as well return schemaNode.getXPath?

Returns:
The normlizedXPath value

getFieldName

public String getFieldName()
Gets the leaf of the xpath attribute for the InputField object.

Returns:
The fieldName value

getValue

public String getValue()
Gets the value entered in the metadata editor for this field.

Returns:
The value value

setValue

public void setValue(String str)
Sets the value attribute of the InputField object.

Parameters:
str - The new value value

isAnyType

public boolean isAnyType()
Gets the anyType attribute of the InputField object

Returns:
The anyType value

isAttribute

public boolean isAttribute()
Returns true if this field represents an attribute (as opposed to an element).

Returns:
The attribute value

isElement

public boolean isElement()
Returns true if this field represents an element (as opposed to an attribute).

Returns:
The element value

isNillable

public boolean isNillable()
Gets the nillable attribute of the SchemaNode associated with this InputField.

Returns:
The nillable value

toString

public String toString()
Debugging utility returns a string listing key fields and values.

Overrides:
toString in class Object
Returns:
NOT YET DOCUMENTED

DLESE Tools
v1.6.0