org.apache.turbine.services.intake.xmlmodel
Class XmlField

java.lang.Object
  |
  +--org.apache.turbine.services.intake.xmlmodel.XmlField
All Implemented Interfaces:
java.io.Serializable

public class XmlField
extends java.lang.Object
implements java.io.Serializable

A Class for holding data about a property used in an Application.

Version:
$Id$
Author:
Serialized Form

Field Summary
private  java.lang.String baseClass
           
private static java.util.HashMap convertArrayHash
           
private static java.util.HashMap convertHash
           
private static java.lang.String DEFAULT_VALIDATOR
           
private static java.util.HashMap defaultOnErrors
           
private  java.lang.String ifRequiredMessage
           
private  java.lang.String key
           
private  java.lang.String mapToObject
           
private  java.lang.String mapToProperty
           
private  java.lang.String multiValued
           
private  java.lang.String name
           
private  java.lang.String onError
           
private  XmlGroup parent
           
private  java.util.Map ruleMap
           
private  java.util.List rules
           
private  java.lang.String type
           
private  java.lang.String validator
           
 
Constructor Summary
XmlField()
          Default Constructor
XmlField(java.lang.String name)
          Creates a new column and set the name
 
Method Summary
(package private)  void ()
           
 Rule addRule(org.xml.sax.Attributes attrib)
          A utility function to create a new input parameter from attrib and add it to this property.
 void addRule(Rule rule)
          Adds a new rule to the parameter Map and set the parent property of the Rule to this property
 java.lang.String getArrayConvert()
           
 java.lang.String getBaseClass()
          Get the base class of the field
 XmlGroup getGroup()
          Get the parent XmlGroup of the property
 java.lang.String getIfRequiredMessage()
          Get the value of ifRequiredMessage.
 java.lang.String getKey()
          Get the parameter key of the property
 java.lang.String getMapToObject()
          Get the name of the object that takes this input
 java.lang.String getMapToProperty()
          Get the property method that takes this input
 java.lang.String getName()
          Get the name of the property
 java.lang.String getPPMethod()
           
 java.lang.String getRawName()
          Get the name of the property
 java.util.Map getRuleMap()
          The collection of rules for this field keyed by parameter name.
 java.util.List getRules()
          The collection of rules for this field.
 java.lang.String getType()
          Get the type of the property
 java.lang.String getValidator()
          Get the className of the validator
 java.lang.String getVariable()
          The name of the field making sure the first letter is lowercase.
 boolean isMultiValued()
          can this field have several values?
 void loadFromXML(org.xml.sax.Attributes attrib)
          Imports a column from an XML specification
private static void populateDefaults()
           
private  void readObject(java.io.ObjectInputStream stream)
           
 void setBaseClass(java.lang.String newBaseClass)
          Set the base class of the field
 void setGroup(XmlGroup parent)
          Set the parent XmlGroup of the property
 void setIfRequiredMessage(java.lang.String v)
          Set the value of ifRequiredMessage.
 void setKey(java.lang.String newKey)
          Set the parameter key of the property
 void setMapToObject(java.lang.String obj)
          Set the name of the object that takes this input
 void setMapToProperty(java.lang.String prop)
          Set the property method that takes this input
 void setMultiValued(java.lang.String newMultiValued)
          Set whether this class can have multiple values
 void setName(java.lang.String newName)
          Set the name of the property
 void setType(java.lang.String newType)
          Set the type of the property
 void setValidator(java.lang.String prop)
          Set the class name of the validator
 java.lang.String toString()
          String representation of the column.
private  void writeObject(java.io.ObjectOutputStream stream)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, registerNatives, wait, wait, wait
 

Field Detail

DEFAULT_VALIDATOR

private static final java.lang.String DEFAULT_VALIDATOR

baseClass

private java.lang.String baseClass

name

private java.lang.String name

key

private java.lang.String key

type

private java.lang.String type

onError

private java.lang.String onError

multiValued

private java.lang.String multiValued

parent

private XmlGroup parent

rules

private java.util.List rules

ruleMap

private java.util.Map ruleMap

ifRequiredMessage

private java.lang.String ifRequiredMessage

mapToObject

private java.lang.String mapToObject

mapToProperty

private java.lang.String mapToProperty

validator

private java.lang.String validator

defaultOnErrors

private static java.util.HashMap defaultOnErrors

convertHash

private static java.util.HashMap convertHash

convertArrayHash

private static java.util.HashMap convertArrayHash
Constructor Detail

XmlField

public XmlField()
Default Constructor

XmlField

public XmlField(java.lang.String name)
Creates a new column and set the name
Method Detail

void ()
Overrides:
in class java.lang.Object

populateDefaults

private static void populateDefaults()

loadFromXML

public void loadFromXML(org.xml.sax.Attributes attrib)
Imports a column from an XML specification

getRawName

public java.lang.String getRawName()
Get the name of the property

getName

public java.lang.String getName()
Get the name of the property

setName

public void setName(java.lang.String newName)
Set the name of the property

setKey

public void setKey(java.lang.String newKey)
Set the parameter key of the property

getKey

public java.lang.String getKey()
Get the parameter key of the property

setType

public void setType(java.lang.String newType)
Set the type of the property

getType

public java.lang.String getType()
Get the type of the property

setBaseClass

public void setBaseClass(java.lang.String newBaseClass)
Set the base class of the field

getBaseClass

public java.lang.String getBaseClass()
Get the base class of the field

setMultiValued

public void setMultiValued(java.lang.String newMultiValued)
Set whether this class can have multiple values

isMultiValued

public boolean isMultiValued()
can this field have several values?

setMapToObject

public void setMapToObject(java.lang.String obj)
Set the name of the object that takes this input

getMapToObject

public java.lang.String getMapToObject()
Get the name of the object that takes this input

setMapToProperty

public void setMapToProperty(java.lang.String prop)
Set the property method that takes this input

getMapToProperty

public java.lang.String getMapToProperty()
Get the property method that takes this input

setValidator

public void setValidator(java.lang.String prop)
Set the class name of the validator

getValidator

public java.lang.String getValidator()
Get the className of the validator

getVariable

public java.lang.String getVariable()
The name of the field making sure the first letter is lowercase.
Returns:
a String value

getPPMethod

public java.lang.String getPPMethod()

getArrayConvert

public java.lang.String getArrayConvert()

setGroup

public void setGroup(XmlGroup parent)
Set the parent XmlGroup of the property

getGroup

public XmlGroup getGroup()
Get the parent XmlGroup of the property

getIfRequiredMessage

public java.lang.String getIfRequiredMessage()
Get the value of ifRequiredMessage.
Returns:
value of ifRequiredMessage.

setIfRequiredMessage

public void setIfRequiredMessage(java.lang.String v)
Set the value of ifRequiredMessage.
Parameters:
v - Value to assign to ifRequiredMessage.

addRule

public Rule addRule(org.xml.sax.Attributes attrib)
A utility function to create a new input parameter from attrib and add it to this property.

addRule

public void addRule(Rule rule)
Adds a new rule to the parameter Map and set the parent property of the Rule to this property

getRules

public java.util.List getRules()
The collection of rules for this field.
Returns:
a List value

getRuleMap

public java.util.Map getRuleMap()
The collection of rules for this field keyed by parameter name.
Returns:
a Map value

toString

public java.lang.String toString()
String representation of the column. This is an xml representation.
Overrides:
toString in class java.lang.Object

writeObject

private void writeObject(java.io.ObjectOutputStream stream)
                  throws java.io.IOException

readObject

private void readObject(java.io.ObjectInputStream stream)
                 throws java.io.IOException,
                        java.lang.ClassNotFoundException


Copyright © 1999-2001 Apache Software Foundation. All Rights Reserved.