public enum PropertySetter extends Enum<PropertySetter>
Convenient way of handling the different ways a value (or values) can
be set on a Properties
instance.
onSet="[append|prepend|replace|optional]"
The above is the recommended attribute for consuming classes to use in XML configuration.
Modifier and Type | Method and Description |
---|---|
void |
apply(Properties properties,
String key,
Object value) |
static PropertySetter |
from(String name) |
static PropertySetter |
from(String name,
PropertySetter defaultSetter) |
static PropertySetter |
fromXML(XML xml,
PropertySetter defaultValue) |
static PropertySetter |
orAppend(PropertySetter setter) |
static PropertySetter |
orOptional(PropertySetter setter) |
static PropertySetter |
orPrepend(PropertySetter setter) |
static PropertySetter |
orReplace(PropertySetter setter) |
static void |
toXML(XML xml,
PropertySetter setter) |
static PropertySetter |
valueOf(String name)
Returns the enum constant of this type with the specified name.
|
static PropertySetter[] |
values()
Returns an array containing the constants of this enum type, in
the order they are declared.
|
public static final PropertySetter APPEND
public static final PropertySetter PREPEND
public static final PropertySetter REPLACE
public static final PropertySetter OPTIONAL
public static PropertySetter[] values()
for (PropertySetter c : PropertySetter.values()) System.out.println(c);
public static PropertySetter valueOf(String name)
name
- the name of the enum constant to be returned.IllegalArgumentException
- if this enum type has no constant with the specified nameNullPointerException
- if the argument is nullpublic void apply(Properties properties, String key, Object value)
public static PropertySetter from(String name, PropertySetter defaultSetter)
public static PropertySetter from(String name)
public static PropertySetter orAppend(PropertySetter setter)
public static PropertySetter orOptional(PropertySetter setter)
public static PropertySetter orPrepend(PropertySetter setter)
public static PropertySetter orReplace(PropertySetter setter)
public static PropertySetter fromXML(XML xml, PropertySetter defaultValue)
public static void toXML(XML xml, PropertySetter setter)
Copyright © 2008–2023 Norconex Inc.. All rights reserved.