|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
ObjectTypes
public class Types
This is a set of utility methods used when implementing types.
This set of classes captures the all important how does it work questions, particularly with respect to super types.
FIXME: These methods need a Q&A check to confirm correct use of Super TODO: Cannot tell the difference in intent from FeatureTypes
Constructor Summary | |
---|---|
Types()
|
Method Summary | |
---|---|
static boolean |
isValid(Attribute attribute)
|
static Object |
parse(AttributeDescriptor descriptor,
Object value)
Do our best to make the provided value line up with the needs of descriptor. |
static void |
validate(AttributeDescriptor descriptor,
Object value)
Ensure that attributeContent is a good value for descriptor. |
static void |
validate(Attribute attribute,
Object attributeContent)
Validates content against an attribute. |
static void |
validate(AttributeType type,
Attribute attribute,
Object attributeContent)
|
protected static void |
validate(AttributeType type,
Attribute attribute,
Object attributeContent,
boolean isSuper)
|
protected static void |
validate(AttributeType type,
Object value,
boolean isSuper)
|
Methods inherited from class Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public Types()
Method Detail |
---|
public static boolean isValid(Attribute attribute)
public static void validate(Attribute attribute, Object attributeContent) throws IllegalAttributeException
attribute
- The attribute.attributeContent
- Content of attribute.
IllegalAttributeException
- In the event that content violates any restrictions specified
by the attribute.public static void validate(AttributeType type, Attribute attribute, Object attributeContent) throws IllegalAttributeException
IllegalAttributeException
protected static void validate(AttributeType type, Attribute attribute, Object attributeContent, boolean isSuper) throws IllegalAttributeException
IllegalAttributeException
public static void validate(AttributeDescriptor descriptor, Object value) throws IllegalAttributeException
IllegalAttributeException
public static Object parse(AttributeDescriptor descriptor, Object value) throws IllegalArgumentException
This helper method uses the Coverters api to convert the provided value into the required class. If the value is null (and the attribute is not nillable) a default value will be returned.
descriptor
- Attribute descriptor we need to supply a value for.value
- The provided value
IllegalArgumentException
- if we really could not do it.protected static void validate(AttributeType type, Object value, boolean isSuper) throws IllegalAttributeException
IllegalAttributeException
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |