public abstract class PropertyDescriptor<T> extends Object
Modifier and Type | Field and Description |
---|---|
static Map<String,PropertyDescriptor<?>> |
ALL
.
|
T |
defaultValue
.
|
String |
description
.
|
private static Map<String,PropertyDescriptor<?>> |
INTERNAL_ALL
.
|
String |
name
.
|
boolean |
secret
.
|
static String |
SECRET_DISPLAY_VALUE
The display value returned when a property is secret.
|
Class<T> |
type
.
|
static PropertyDescriptor<Integer> |
VFS_REFRESH_PERIOD
.
|
static PropertyDescriptor<TimeUnit> |
VFS_REFRESH_UNIT
.
|
Modifier | Constructor and Description |
---|---|
protected |
PropertyDescriptor(Class<T> type,
String name,
T defaultValue,
String description)
Create a new property descriptor.
|
protected |
PropertyDescriptor(Class<T> type,
String name,
T defaultValue,
String description,
boolean secret)
Create a new property descriptor.
|
Modifier and Type | Method and Description |
---|---|
static PropertyDescriptor<Integer> |
create(String name,
Integer defaultValue,
String description) |
static PropertyDescriptor<Integer> |
create(String name,
Integer defaultValue,
String description,
boolean secret) |
static PropertyDescriptor<List> |
create(String name,
List defaultValue,
String description) |
static PropertyDescriptor<List> |
create(String name,
List defaultValue,
String description,
boolean secret) |
static PropertyDescriptor<String> |
create(String name,
String defaultValue,
String description) |
static PropertyDescriptor<String> |
create(String name,
String defaultValue,
String description,
boolean secret) |
protected abstract T |
doParse(String s)
Implements the real parsing, the string argument must nto be null.
|
boolean |
equals(Object obj) |
String |
getDefaultDisplayValue() |
T |
getDefaultValue() |
String |
getDescription() |
String |
getName() |
Class<T> |
getType() |
T |
parse(String s)
Parse a string representation of a value and returns the corresponding typed value.
|
Property<T> |
toProperty(String s)
Parse a string representation of a value and returns the correspondig property value.
|
String |
toString() |
public static final String SECRET_DISPLAY_VALUE
private static final Map<String,PropertyDescriptor<?>> INTERNAL_ALL
public static final Map<String,PropertyDescriptor<?>> ALL
public static final PropertyDescriptor<TimeUnit> VFS_REFRESH_UNIT
public static final PropertyDescriptor<Integer> VFS_REFRESH_PERIOD
public final T defaultValue
public final String description
public final boolean secret
protected PropertyDescriptor(Class<T> type, String name, T defaultValue, String description) throws NullPointerException
type
- the property typename
- the property namedefaultValue
- the default valuedescription
- the descriptionNullPointerException
- if the type, name or description is nullprotected PropertyDescriptor(Class<T> type, String name, T defaultValue, String description, boolean secret) throws NullPointerException
type
- the property typename
- the property namedefaultValue
- the default valuedescription
- the descriptionsecret
- the value is secret (like a password)NullPointerException
- if the type, name or description is nullpublic static PropertyDescriptor<String> create(String name, String defaultValue, String description, boolean secret)
public static PropertyDescriptor<String> create(String name, String defaultValue, String description)
public static PropertyDescriptor<Integer> create(String name, Integer defaultValue, String description, boolean secret)
public static PropertyDescriptor<Integer> create(String name, Integer defaultValue, String description)
public static PropertyDescriptor<List> create(String name, List defaultValue, String description, boolean secret)
public static PropertyDescriptor<List> create(String name, List defaultValue, String description)
public final String getDescription()
public final T getDefaultValue()
public final String getDefaultDisplayValue()
public final T parse(String s) throws NullPointerException, IllegalArgumentException
s
- the string to parseNullPointerException
- if the argument is nullIllegalArgumentException
- if the string value cannot be parsed for some reasonpublic final Property<T> toProperty(String s) throws NullPointerException, IllegalArgumentException
s
- the string to parseNullPointerException
- if the argument is nullIllegalArgumentException
- if the string value cannot be parsed for some reasonprotected abstract T doParse(String s) throws Exception
s
- the string to parseException
- any exception that would prevent parsing to hapenCopyright © 2015 eXo Platform SAS. All Rights Reserved.