@JsonModel public class PropertyContainer extends java.lang.Object implements java.lang.Cloneable
| Modifier and Type | Field and Description |
|---|---|
protected static java.lang.String |
NL |
protected java.util.Map<java.lang.String,java.lang.Object> |
properties |
protected static java.util.regex.Pattern |
RESERVED_NAME |
| Constructor and Description |
|---|
PropertyContainer() |
| Modifier and Type | Method and Description |
|---|---|
void |
appendPropertiesTo(JsonObject jsonObject)
Deprecated.
|
void |
appendPropertiesTo(java.lang.StringBuilder builder,
java.lang.String indent,
int depth)
Deprecated.
|
java.util.Date |
asDate(java.lang.String key) |
java.util.Date |
asDate(java.lang.String key,
java.util.Date defaultValue) |
java.lang.Integer |
asInteger(java.lang.String key) |
java.lang.Integer |
asInteger(java.lang.String key,
java.lang.Integer defaultValue) |
java.lang.Long |
asLong(java.lang.String key) |
java.lang.Long |
asLong(java.lang.String key,
java.lang.Long defaultValue) |
java.lang.String |
asString(java.lang.String key) |
java.lang.String |
asString(java.lang.String key,
java.lang.String defaultValue) |
protected java.lang.Object |
clone() |
java.lang.String |
elementName()
Deprecated.
will be remove in future release
|
java.util.Map<java.lang.String,java.lang.Object> |
getProperties()
Gets all of the properties belonging to this container.
|
java.lang.Object |
getProperty(java.lang.String name)
Gets the property with the specified name.
|
java.util.Map<java.lang.String,java.lang.Object> |
getPropertyMap() |
protected boolean |
hasProperties()
Deprecated.
|
boolean |
hasProperty(java.lang.String name)
Returns
true if a property has been set. |
protected boolean |
isVisible(java.lang.String key) |
java.lang.String |
jsonElementName()
Deprecated.
will be remove in future release
|
void |
removeProperty(java.lang.String name)
Removes the property which the specified name.
|
void |
setPropertiesFrom(PropertyContainer src)
A convenience method that populates properties from those in the given container.
|
void |
setProperty(java.lang.String name,
java.lang.Object value)
Sets the property named,
name, to value |
JsonObject |
toJson() |
java.lang.String |
toString() |
protected static final java.util.regex.Pattern RESERVED_NAME
protected static final java.lang.String NL
protected final java.util.Map<java.lang.String,java.lang.Object> properties
public java.lang.Object getProperty(java.lang.String name)
setProperty(String, Object)name - the property name.namepublic java.util.Map<java.lang.String,java.lang.Object> getProperties()
Map of properties.public boolean hasProperty(java.lang.String name)
true if a property has been set. This function can be used to
test if property has been specifically set to null.name - the given property name.true iff the property named name exists.public void removeProperty(java.lang.String name)
name - the given property name.public void setProperty(java.lang.String name,
java.lang.Object value)
name, to valuename - the given property name.value - the given property value.public void setPropertiesFrom(PropertyContainer src)
src - the container from which we will populate ourself.protected java.lang.Object clone()
clone in class java.lang.Object@Deprecated protected boolean hasProperties()
true if this container contains another properties except reversed name.protected boolean isVisible(java.lang.String key)
key - property key@Deprecated
public void appendPropertiesTo(java.lang.StringBuilder builder,
java.lang.String indent,
int depth)
builderbuilder - the given StringBuilder to store value.indent - the given indent.depth - the given depth value.public java.util.Map<java.lang.String,java.lang.Object> getPropertyMap()
@Deprecated public java.lang.String elementName()
@Deprecated public java.lang.String jsonElementName()
@Deprecated public void appendPropertiesTo(JsonObject jsonObject) throws JsonException
jsonObject - the given JsonObject to hold value.JsonException - if an error occurs during building json object.public JsonObject toJson() throws JsonException
JsonObject instance.JsonException - if an error occurs during building json object.public java.lang.String toString()
toString in class java.lang.Objectpublic java.lang.Integer asInteger(java.lang.String key)
key - property namepublic java.lang.Integer asInteger(java.lang.String key,
java.lang.Integer defaultValue)
key - property namedefaultValue - default valuepublic java.lang.Long asLong(java.lang.String key)
key - property namepublic java.lang.Long asLong(java.lang.String key,
java.lang.Long defaultValue)
key - property namedefaultValue - default valuepublic java.lang.String asString(java.lang.String key)
public java.lang.String asString(java.lang.String key,
java.lang.String defaultValue)
key - property namedefaultValue - default valuepublic java.util.Date asDate(java.lang.String key)
key - property namepublic java.util.Date asDate(java.lang.String key,
java.util.Date defaultValue)
key - property namedefaultValue - default value