public class PropertyDescription extends DescribableEntity
Constructor and Description |
---|
PropertyDescription()
Create a new description
|
Modifier and Type | Method and Description |
---|---|
void |
clear()
Clear the object and reset to defaults
|
protected javax.json.JsonObjectBuilder |
createJson()
Convert this object into JSON
|
void |
fromJSONObject(javax.json.JsonObject jsonObj)
Extract the metadata from the JSON object.
|
int |
getCardinality()
Get the cardinality
|
Object |
getDefaultValue()
Get the optional default value.
|
String[] |
getExcludes()
Get the excludes
|
String[] |
getIncludes()
Get the includes
|
Mode |
getMode()
Get the validation mode.
|
List<Option> |
getOptions()
Get the list of options
|
PlaceholderPolicy |
getPlaceholderPolicy()
Get the placeholder policy.
|
String |
getPlaceholderRegex()
Get the placeholder regex
|
Pattern |
getPlaceholderRegexPattern()
Get the placeholder regex pattern
|
Range |
getRange()
Get the range
|
String |
getRegex()
Get the regex
|
Pattern |
getRegexPattern()
Get the regex pattern
|
PropertyType |
getType()
Get the property type
|
String |
getVariable()
Get the variable
|
boolean |
isRequired()
Is this property required?
|
void |
setCardinality(int value)
Set the cardinality
The default cardinality is
1 . |
protected void |
setDefaults()
Apply the non-null default values.
|
void |
setDefaultValue(Object val)
Set the optional default value.
|
void |
setExcludes(String[] excludes)
Set the excludes
|
void |
setIncludes(String[] includes)
Set the includes
|
void |
setMode(Mode value)
Set the validation mode
|
void |
setOptions(List<Option> options)
Set the list of options
|
void |
setPlaceholderPolicy(PlaceholderPolicy policy)
Set the placeholder policy
|
void |
setPlaceholderRegex(String regex)
Set the placeholder regex
|
void |
setRange(Range range)
Set the range
|
void |
setRegex(String regex)
Set the regex
|
void |
setRequired(boolean flag)
Set whether this property is required
|
void |
setType(PropertyType type)
Set the property type
|
void |
setVariable(String variable)
Set the variable
|
getDeprecated, getDescription, getEnforceOn, getSince, getTitle, setDeprecated, setDescription, setEnforceOn, setSince, setTitle
getAttributes, getBoolean, getInteger, getNumber, getString, getString, getStringArray, setString, setStringArray, toJSONObject
protected void setDefaults()
AttributeableEntity
setDefaults
in class AttributeableEntity
public void clear()
clear
in class DescribableEntity
public void fromJSONObject(javax.json.JsonObject jsonObj) throws IOException
clear()
fromJSONObject
in class DescribableEntity
jsonObj
- The JSON ObjectIOException
- If JSON parsing failsprotected javax.json.JsonObjectBuilder createJson() throws IOException
createJson
in class DescribableEntity
IOException
- If generating the JSON failspublic PropertyType getType()
public void setType(PropertyType type)
type
- the type to setpublic int getCardinality()
public void setCardinality(int value)
1
. If the value is greater than zero
the property can contain up to that number of values.
If the cardinality is -1
the property can hold an unlimited number
of values.value
- the cardinality to setIllegalArgumentException
- If the value is 0
or below -1
.public String getVariable()
null
public void setVariable(String variable)
variable
- the variable to setpublic Range getRange()
null
public void setRange(Range range)
range
- the range to setpublic String[] getIncludes()
null
public void setIncludes(String[] includes)
includes
- the includes to setpublic String[] getExcludes()
null
public void setExcludes(String[] excludes)
excludes
- the excludes to setpublic void setOptions(List<Option> options)
options
- the options to setpublic String getRegex()
null
public void setRegex(String regex)
regex
- the regex to setIllegalArgumentException
- If the pattern is not validpublic Pattern getRegexPattern()
null
public boolean isRequired()
true
if it is requiredpublic void setRequired(boolean flag)
flag
- The new valuepublic Object getDefaultValue()
null
public void setDefaultValue(Object val)
val
- The default valuepublic Mode getMode()
null
public void setMode(Mode value)
value
- The validation modepublic PlaceholderPolicy getPlaceholderPolicy()
public void setPlaceholderPolicy(PlaceholderPolicy policy)
policy
- The new policypublic String getPlaceholderRegex()
null
public void setPlaceholderRegex(String regex)
regex
- the placeholder regex to setIllegalArgumentException
- If the pattern is not validpublic Pattern getPlaceholderRegexPattern()
null
Copyright © 2007–2021 The Apache Software Foundation. All rights reserved.