|
Carrot2 v3.5.2
API Documentation |
||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectorg.carrot2.util.attribute.AttributeDescriptor
public class AttributeDescriptor
Provides a full description of an individual attribute, including its key,
type, defaultValue and constraints. Also contains
human-readable metadata about the attribute such as title, label or
description.
AttributeDescriptors can be obtained from BindableDescriptors, which in
turn are built by BindableDescriptorBuilder.buildDescriptor(Object);
| Nested Class Summary | |
|---|---|
static class |
AttributeDescriptor.AttributeDescriptorToKey
Transforms AttributeDescriptors into their keys. |
| Field Summary | |
|---|---|
List<Annotation> |
constraints
Constraints defined for the attribute. |
Object |
defaultValue
Default value of the attribute. |
boolean |
inputAttribute
True if the attribute is an Input attribute. |
String |
key
Type of the attribute as defined by Attribute.key(). |
AttributeMetadata |
metadata
Human-readable metadata describing the attribute. |
boolean |
outputAttribute
True if the attribute is an Output attribute. |
boolean |
requiredAttribute
True if the attribute is a Required attribute. |
Class<?> |
type
Type of the attribute. |
| Method Summary | ||
|---|---|---|
|
getAnnotation(Class<T> annotationClass)
Returns an annotation specified for the attribute. |
|
boolean |
isValid(Object value)
Returns true if the given value is valid for the attribute described
by this descriptor (non-null for Required attributes and
fulfilling all other constraints). |
|
String |
toString()
|
|
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Field Detail |
|---|
public final AttributeMetadata metadata
public final String key
Attribute.key().
public final Class<?> type
public final Object defaultValue
public final List<Annotation> constraints
public final boolean inputAttribute
True if the attribute is an Input attribute.
public final boolean outputAttribute
True if the attribute is an Output attribute.
public final boolean requiredAttribute
True if the attribute is a Required attribute.
| Method Detail |
|---|
public <T extends Annotation> T getAnnotation(Class<T> annotationClass)
annotationClass - type of annotation to be returned
null is annotation of the
provided type is not defined for the attributepublic final boolean isValid(Object value)
true if the given value is valid for the attribute described
by this descriptor (non-null for Required attributes and
fulfilling all other constraints).
public String toString()
toString in class Object
|
Please refer to project documentation at
http://project.carrot2.org |
||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||