Package org.dlese.dpc.schemedit.input
Class InputField
java.lang.Object
org.dlese.dpc.schemedit.input.InputField
- Direct Known Subclasses:
AnyTypeInputField
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
ConstructorsModifierConstructorDescriptionprotectedInputField(String paramName, String value, SchemaNode schemaNode, String xpath, InputManager inputManager) InputField constructor. -
Method Summary
Modifier and TypeMethodDescriptionreturns a list of entity errors found in the value for this InputFieldGets the leaf of the xpath attribute for the InputField object.Returns an xpath containing no indexing for the element corresponding to this InputField.Returns the request parameter name for this field.Gets the SchemaNode associated with this InputField.getValue()Gets the value entered in the metadata editor for this field.getXPath()Gets the xPath attribute of the InputField object.booleanNOT YET DOCUMENTEDbooleanGets the anyType attribute of the InputField objectbooleanReturns true if this field represents an attribute (as opposed to an element).booleanReturns true if this field represents an element (as opposed to an attribute).booleanGets the nillable attribute of the SchemaNode associated with this InputField.voidsetParamName(String paramName) Sets the paramName attribute of the InputField objectvoidSets the value attribute of the InputField object.voidSets the xPath attribute of the InputField objecttoString()Debugging utility returns a string listing key fields and values.
-
Constructor Details
-
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
- Parameters:
paramName- paramName as received from the requestvalue- the value as received from the requestschemaNode- SchemaNode instance for this fieldxpath- the xpath of this fieldinputManager- the inputManager instance for this field
-
-
Method Details
-
getParamName
Returns the request parameter name for this field.E.g., valueOf(/collectionConfigRecord/tuples/tuple_1_/name)
- Returns:
- The paramName value
-
setParamName
Sets the paramName attribute of the InputField object- Parameters:
paramName- The new paramName value
-
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
Gets the SchemaNode associated with this InputField.- Returns:
- The schemaNode value
-
getXPath
Gets the xPath attribute of the InputField object.- Returns:
- The xPath value
-
setXPath
Sets the xPath attribute of the InputField object- Parameters:
xpath- The new xPath value
-
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
Gets the leaf of the xpath attribute for the InputField object.- Returns:
- The fieldName value
-
getValue
Gets the value entered in the metadata editor for this field.- Returns:
- The value value
-
setValue
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
Debugging utility returns a string listing key fields and values.
-