com.wles.util
Interface AttributeElement
- All Superinterfaces:
- java.lang.Cloneable, ConstAttributeElement
- public interface AttributeElement
- extends ConstAttributeElement, java.lang.Cloneable
AttributeElement represents an attribute name value pair.
This interface provides the "setter" methods, and inherits the "getter" methods from the ConstAttributeElement interface.
You may use any Java type as the value of an attribute. The Java type will be mapped into the appropriate ALES
type. Collections and arrays will automatically be converted into ALES lists. The following Java to ALES type mappings are used:
java.lang.String=ALES string, java.lang.Integer=ALES integer, java.lang.Boolean=ALES boolean, java.util.Date=ALES date,
java.net.InetAddress=ALES ip, com.wles.util.Time=ALES time, com.wles.util.CustomEnumerationValue=ALES enum
. Any other Java type will be converted to an ALES string, using the Object's toString() method. To create an instance of an AttributeElement
use the AttributeElementFactory
- See Also:
AttributeElementFactory
,
ConstAttributeElement
,
Time
,
CustomEnumerationValue
Method Summary |
void |
setList(boolean isList)
Set the list parameter of the attribute explicitily |
void |
setName(java.lang.String name)
Set the attribute name. |
void |
setType(java.lang.String type)
Set the attribute type. |
void |
setValue(java.lang.Object value)
Set the attribute value.
|
setList
public void setList(boolean isList)
- Set the list parameter of the attribute explicitily
- Parameters:
isList
- true if the value is a list, false if it is not
setName
public void setName(java.lang.String name)
throws BadParameterException
- Set the attribute name.
- Throws:
BadParameterException
setType
public void setType(java.lang.String type)
throws BadParameterException,
UnsupportedTypeException,
TypeConversionException
- Set the attribute type.
- Throws:
BadParameterException
UnsupportedTypeException
TypeConversionException
setValue
public void setValue(java.lang.Object value)
throws BadParameterException,
UnsupportedTypeException,
TypeConversionException
- Set the attribute value.
Multi-valued attributes may be stored using either arrays of Java objects, or using a java.util.Collection. All
elements in a multi-value attribute must be of the same Java type.
- Parameters:
value
- value of the attribute. The Java type will be used to determine the proper ALES type.
- Throws:
UnsupportedTypeException
- Indicates that there is not TypeConverter registered for the given type.
TypeConversionException
- Indicataes that the registered type converter was unable to perform the conversion.
BadParameterException
- See Also:
TypeConverterRegistry
,
TypeConverter
Copyright © 2004-2008, Oracle and/or its affiliates. All rights reserved.