BeanIO 1.2.3

org.beanio.config
Class PropertyConfig

java.lang.Object
  extended by org.beanio.config.PropertyConfig
Direct Known Subclasses:
BeanConfig, BeanPropertyConfig, FieldConfig

public abstract class PropertyConfig
extends Object

Stores configuration settings for a property of a Java bean.

Since:
1.0
Author:
Kevin Seim

Field Summary
static String LEFT
          Left justification setting
static String RIGHT
          Right justification setting
 
Constructor Summary
PropertyConfig()
           
 
Method Summary
 String getCollection()
          Returns the collection type, or null if this property is not a collection or array.
 String getGetter()
          Returns the name of the getter method to use to retrieve this property's value from its parent bean when writing to an output stream.
 Integer getMaxOccurs()
          Returns the maximum number of times this property may appear (consecutively) in an input stream.
 Integer getMinOccurs()
          Returns the minimum number of times this property must appear in an input stream.
 String getName()
          Returns the name of this property.
 String getSetter()
          Returns the name of the setter method to use when setting this property's value on its parent bean while reading from an input stream.
 String getType()
          Returns the fully qualified class name or type alias of this property's value.
 String getXmlName()
          Returns XML element or attribute name of this property.
 String getXmlNamespace()
          Returns the XML namespace for this property element or attribute.
 String getXmlPrefix()
          Returns the XML prefix for the namespace assigned to this property element or attribute.
 String getXmlType()
          Returns the XML node type of this property.
 String getXmlWrapper()
          Returns the name of a XML wrapper element for this property.
 boolean isBean()
          Returns whether this property defines a bean class with its own list of properties.
 boolean isField()
          Returns whether this property configuration defines a field.
 boolean isIgnored()
          Returns true if this property is not a bean property.
 boolean isNillable()
          Returns whether this property is nillable.
 void setCollection(String collection)
          Sets the collection type.
 void setGetter(String getter)
          Sets the name of the getter method to use to retrieve this property's value from it parent bean when writing to an output stream.
 void setIgnored(boolean ignore)
          Set to true if this property is not a bean property.
 void setMaxOccurs(Integer maxOccurs)
          Sets the maximum number of times this property may appear (consecutively) in an input stream.
 void setMinOccurs(Integer minOccurs)
          Sets the minimum number of times this property must appear consecutively in an input stream.
 void setName(String name)
          Sets the name of this property.
 void setNillable(boolean nillable)
          Sets whether this property is nillable.
 void setSetter(String setter)
          Sets the name of the setter method to use when setting this property's value on its parent bean while reading from an input stream.
 void setType(String type)
          Sets the fully qualified class name or type alias of this property's value.
 void setXmlName(String xmlName)
          Sets the XML element or attribute name of this property.
 void setXmlNamespace(String xmlNamespace)
          Sets the XML namespace for this property element or attribute.
 void setXmlPrefix(String xmlPrefix)
          Sets the XML prefix for the namespace assigned to this property element or attribute.
 void setXmlType(String xmlType)
          Sets the XML node type of this property.
 void setXmlWrapper(String xmlWrapper)
          Sets the name of a XML wrapper element for this property.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

LEFT

public static final String LEFT
Left justification setting

See Also:
Constant Field Values

RIGHT

public static final String RIGHT
Right justification setting

See Also:
Constant Field Values
Constructor Detail

PropertyConfig

public PropertyConfig()
Method Detail

isBean

public boolean isBean()
Returns whether this property defines a bean class with its own list of properties.

Returns:
whether this property defines a Java bean

isField

public boolean isField()
Returns whether this property configuration defines a field.

Returns:
true if this property is a field
Since:
1.2

getName

public String getName()
Returns the name of this property. The name of the property is used to get and set the property value from its enclosing bean when a getter and setter are not set.

Returns:
the property name

setName

public void setName(String name)
Sets the name of this property. The name of the property is used to get and set the property value from its enclosing bean when a getter and setter are not set.

Parameters:
name - the field name

isIgnored

public boolean isIgnored()
Returns true if this property is not a bean property.

Returns:
true if this property is not a bean property.

setIgnored

public void setIgnored(boolean ignore)
Set to true if this property is not a bean property.

Parameters:
ignore - true if this property is not a bean property.

getGetter

public String getGetter()
Returns the name of the getter method to use to retrieve this property's value from its parent bean when writing to an output stream.

Returns:
the getter method for this property

setGetter

public void setGetter(String getter)
Sets the name of the getter method to use to retrieve this property's value from it parent bean when writing to an output stream.

Parameters:
getter - the getter method for this property

getSetter

public String getSetter()
Returns the name of the setter method to use when setting this property's value on its parent bean while reading from an input stream.

Returns:
the setter method for this property

setSetter

public void setSetter(String setter)
Sets the name of the setter method to use when setting this property's value on its parent bean while reading from an input stream.

Parameters:
setter - the setter method for this property

getType

public String getType()
Returns the fully qualified class name or type alias of this property's value. By default, null is returned and the property value type is detected through bean introspection.

Returns:
the class name of this property value

setType

public void setType(String type)
Sets the fully qualified class name or type alias of this property's value. If set to null, the property value type is detected through bean introspection.

Parameters:
type - the class name of this property value

getCollection

public String getCollection()
Returns the collection type, or null if this property is not a collection or array.

Returns:
the property collection type

setCollection

public void setCollection(String collection)
Sets the collection type. Set to null (default) to indicate the property is not a collection or array. The value may be set to the fully qualified class name of a java.util.Collection subclass or a collection type alias, or the value "array" to indicate a Java array.

Parameters:
collection - the collection type

getMinOccurs

public Integer getMinOccurs()
Returns the minimum number of times this property must appear in an input stream. If null, one occurrence is assumed.

Returns:
the minimum required occurrences of this property

setMinOccurs

public void setMinOccurs(Integer minOccurs)
Sets the minimum number of times this property must appear consecutively in an input stream. If set to null, one occurrence is assumed. If set to anything other than one, a collection type is expected. Must be 0 or greater.

Parameters:
minOccurs - the minimum required occurrences of this property

getMaxOccurs

public Integer getMaxOccurs()
Returns the maximum number of times this property may appear (consecutively) in an input stream. If null, one occurrence is assumed.

Returns:
the maximum allowed occurrences of this property, or -1 if there is no limit

setMaxOccurs

public void setMaxOccurs(Integer maxOccurs)
Sets the maximum number of times this property may appear (consecutively) in an input stream. If set to null, one occurrence is assumed. If set to anything other than one, a collection type is expected. Must be greater than the minimum occurrences, or set to -1 to indicate the limit is unbounded.

Parameters:
maxOccurs - the maximum allowed occurrences of this property, or -1 if there is no limit

getXmlType

public String getXmlType()
Returns the XML node type of this property.

Returns:
the XML node type
Since:
1.1
See Also:
XmlTypeConstants

setXmlType

public void setXmlType(String xmlType)
Sets the XML node type of this property.

Parameters:
xmlType - the XML node type
Since:
1.1
See Also:
XmlTypeConstants

getXmlName

public String getXmlName()
Returns XML element or attribute name of this property.

Returns:
the XML element or attribute name
Since:
1.1

setXmlName

public void setXmlName(String xmlName)
Sets the XML element or attribute name of this property. If set to null (default), the XML name defaults to the property name.

Parameters:
xmlName - the XML element or attribute name
Since:
1.1

getXmlNamespace

public String getXmlNamespace()
Returns the XML namespace for this property element or attribute.

Returns:
the XML namespace
Since:
1.1

setXmlNamespace

public void setXmlNamespace(String xmlNamespace)
Sets the XML namespace for this property element or attribute. If set to null (default), the namespace is inherited from its parent.

Parameters:
xmlNamespace - the XML namespace
Since:
1.1

getXmlPrefix

public String getXmlPrefix()
Returns the XML prefix for the namespace assigned to this property element or attribute.

Returns:
the XML namespace prefix
Since:
1.1

setXmlPrefix

public void setXmlPrefix(String xmlPrefix)
Sets the XML prefix for the namespace assigned to this property element or attribute. If set to null and a namespace is set, the namespace will replace the default namespace when marshaling the property. If a namespace is not set, the prefix is ignored.

Parameters:
xmlPrefix - the XML namespace prefix
Since:
1.1

isNillable

public boolean isNillable()
Returns whether this property is nillable.

Returns:
true if this property is nillable
Since:
1.1

setNillable

public void setNillable(boolean nillable)
Sets whether this property is nillable.

Parameters:
nillable - true if this property is nillable
Since:
1.1

getXmlWrapper

public String getXmlWrapper()
Returns the name of a XML wrapper element for this property.

Returns:
the XML wrapper element name or null if this property is not wrapped by another element
Since:
1.1

setXmlWrapper

public void setXmlWrapper(String xmlWrapper)
Sets the name of a XML wrapper element for this property.

Parameters:
xmlWrapper - the XML wrapper element name or null if this property is not wrapped by another element
Since:
1.1

BeanIO 1.2.3

Copyright © 2010-2012 Kevin Seim