com.google.gdata.data
Class EnumConstruct
java.lang.Object
com.google.gdata.data.AbstractExtension
com.google.gdata.data.ValueConstruct
com.google.gdata.data.EnumConstruct
- All Implemented Interfaces:
- Extension
- Direct Known Subclasses:
- CrawlRateConstruct, DomainPreferenceConstruct
public abstract class EnumConstruct
- extends ValueConstruct
The EnumConstruct class defines a special type of ValueConstruct
where the attribute values are constrained to a discrete set of valid
values.
Field Summary |
protected java.util.Set<java.lang.String> |
values
The set of valid values for the enum construct. |
Constructor Summary |
protected |
EnumConstruct(XmlNamespace namespace,
java.lang.String tagName,
java.lang.String attrName,
java.util.Set<java.lang.String> values)
Constructs a new EnumConstruct instance associated with a particular
XML representation and set of expected values. |
protected |
EnumConstruct(XmlNamespace namespace,
java.lang.String tagName,
java.lang.String attrName,
java.util.Set<java.lang.String> values,
java.lang.String initialValue)
Constructs a new EnumConstruct instance associated with a particular
XML representation and set of expected values. |
Method Summary |
void |
setValue(java.lang.String v)
Sets the value. |
Methods inherited from class com.google.gdata.data.AbstractExtension |
eq, generate, generateAttributes, getExtensionLocalName, getExtensionNamespace, isImmutable, sameClassAs, setImmutable, throwExceptionForMissingAttribute, throwExceptionIfImmutable, validate |
Methods inherited from class java.lang.Object |
clone, finalize, getClass, notify, notifyAll, toString, wait, wait, wait |
values
protected java.util.Set<java.lang.String> values
- The set of valid values for the enum construct.
EnumConstruct
protected EnumConstruct(XmlNamespace namespace,
java.lang.String tagName,
java.lang.String attrName,
java.util.Set<java.lang.String> values)
- Constructs a new EnumConstruct instance associated with a particular
XML representation and set of expected values.
EnumConstruct
protected EnumConstruct(XmlNamespace namespace,
java.lang.String tagName,
java.lang.String attrName,
java.util.Set<java.lang.String> values,
java.lang.String initialValue)
- Constructs a new EnumConstruct instance associated with a particular
XML representation and set of expected values. An an initial value
is provided and it is not
null
, the constructed instance will
be initialized to the value and will be immutable.
setValue
public void setValue(java.lang.String v)
throws java.lang.IllegalArgumentException
- Description copied from class:
ValueConstruct
- Sets the value. Subclasses can override this method to do
additional validation of the value.
- Overrides:
setValue
in class ValueConstruct
- Parameters:
v
- new value for the value construct or null
to reset.
- Throws:
java.lang.IllegalArgumentException
- if the value is invalid for the construct.