public static class Reflection.Property extends Object implements Comparable<Reflection.Property>, Serializable
Constructor and Description |
---|
Property()
Create a new object property that has no fields initialized.
|
Property(String name,
String label,
String description,
boolean readOnly)
Create a new object property with the supplied parameters set.
|
Property(String name,
String label,
String description,
String category,
boolean readOnly,
Class<?> type,
Object... allowedValues)
Create a new object property with the supplied parameters set.
|
Modifier and Type | Method and Description |
---|---|
int |
compareTo(Reflection.Property that) |
boolean |
equals(Object obj) |
Collection<?> |
getAllowedValues()
Get the allowed values for this property.
|
String |
getCategory()
Get the name of the category in which this property belongs.
|
String |
getDescription()
Get the description for this property.
|
String |
getLabel()
Get the human-readable label for the property.
|
String |
getName()
Get the property name in camel case.
|
Class<?> |
getType()
Get the class to which the value must belong (excluding null values).
|
int |
hashCode() |
boolean |
isArrayType()
Determine if this is property's (the
type is an array. |
boolean |
isBooleanType()
|
boolean |
isInferred()
Return whether this property was inferred purely by reflection, or whether annotations were used for its definition.
|
boolean |
isPrimitive()
Determine if this is property's (the
type is a primitive. |
boolean |
isReadOnly()
Return whether this property is read-only.
|
void |
setAllowedValues(Collection<?> allowedValues)
Set the allowed values for this property.
|
void |
setAllowedValues(Object... allowedValues)
Set the allowed values for this property.
|
void |
setCategory(String category)
Set the name of the category in which this property belongs.
|
void |
setDescription(String description)
Set the description for this property.
|
void |
setInferred(boolean inferred)
Set whether this property was inferred purely by reflection.
|
void |
setLabel(String label)
Set the human-readable label for the property.
|
void |
setName(String name)
Set the property name in camel case.
|
void |
setReadOnly(boolean readOnly)
Set whether this property is read-only.
|
void |
setType(Class<?> type)
Set the class to which the value must belong (excluding null values).
|
String |
toString() |
public Property()
public Property(String name, String label, String description, boolean readOnly)
name
- the property name; may be nulllabel
- the human-readable property label; may be nulldescription
- the description for this property; may be nullreadOnly
- true if the property is read-only, or false otherwisepublic Property(String name, String label, String description, String category, boolean readOnly, Class<?> type, Object... allowedValues)
name
- the property name; may be nulllabel
- the human-readable property label; may be nulldescription
- the description for this property; may be nullcategory
- the category for this property; may be nullreadOnly
- true if the property is read-only, or false otherwisetype
- the value class; may be nullallowedValues
- the array of allowed values, or null or empty if the values are not constrainedpublic String getName()
public void setName(String name)
name
- the nwe property name; may be nullpublic String getLabel()
humanized
form of the property name
.public void setLabel(String label)
humanized
form of the property name
.label
- the new label for the property; may be nullpublic String getDescription()
public void setDescription(String description)
description
- the new description for this property; may be nullpublic boolean isReadOnly()
public void setReadOnly(boolean readOnly)
readOnly
- true if the property is read-only, or false otherwisepublic String getCategory()
public void setCategory(String category)
category
- the category name; may be nullpublic Class<?> getType()
Object.class
public void setType(Class<?> type)
type
- the value class; may be nullpublic boolean isBooleanType()
public boolean isPrimitive()
type
is a primitive.public boolean isArrayType()
type
is an array.public Collection<?> getAllowedValues()
public void setAllowedValues(Collection<?> allowedValues)
allowedValues
- the collection of allowed values, or null or empty if the values are not constrainedpublic void setAllowedValues(Object... allowedValues)
allowedValues
- the array of allowed values, or null or empty if the values are not constrainedpublic boolean isInferred()
public void setInferred(boolean inferred)
inferred
- true if it was inferred only by reflection, or false if at least one annotation was found and usedpublic int compareTo(Reflection.Property that)
compareTo
in interface Comparable<Reflection.Property>
Comparable.compareTo(java.lang.Object)
public int hashCode()
hashCode
in class Object
Object.hashCode()
public boolean equals(Object obj)
equals
in class Object
Object.equals(java.lang.Object)
public String toString()
toString
in class Object
Object.toString()
Copyright © 2008–2016 JBoss, a division of Red Hat. All rights reserved.