abstract class ModelValue
extends java.lang.Object
implements java.lang.Cloneable
| Modifier and Type | Field and Description |
|---|---|
private ModelType |
type |
(package private) static ModelValue |
UNDEFINED |
| Modifier | Constructor and Description |
|---|---|
protected |
ModelValue(ModelType type) |
| Modifier and Type | Method and Description |
|---|---|
(package private) ModelNode |
addChild() |
(package private) java.math.BigDecimal |
asBigDecimal() |
(package private) java.math.BigInteger |
asBigInteger() |
(package private) boolean |
asBoolean() |
(package private) boolean |
asBoolean(boolean defVal) |
(package private) byte[] |
asBytes() |
(package private) double |
asDouble() |
(package private) double |
asDouble(double defVal) |
(package private) ValueExpression |
asExpression() |
(package private) int |
asInt() |
(package private) int |
asInt(int defVal) |
(package private) java.util.List<ModelNode> |
asList() |
(package private) long |
asLong() |
(package private) long |
asLong(long defVal) |
(package private) ModelNode |
asObject() |
(package private) Property |
asProperty() |
(package private) java.util.List<Property> |
asPropertyList() |
(package private) abstract java.lang.String |
asString() |
(package private) ModelType |
asType() |
protected ModelValue |
clone() |
(package private) ModelValue |
copy() |
abstract boolean |
equals(java.lang.Object other) |
(package private) void |
format(java.io.PrintWriter writer,
int indent,
boolean multiLine)
Formats the current value object as part of a DMR string.
|
(package private) void |
formatAsJSON(java.io.PrintWriter writer,
int indent,
boolean multiLine)
Formats the current value object as part of a JSON string.
|
(package private) ModelNode |
getChild(int index) |
(package private) ModelNode |
getChild(java.lang.String name) |
(package private) java.util.Set<java.lang.String> |
getKeys() |
(package private) ModelType |
getType() |
(package private) boolean |
has(int index) |
(package private) boolean |
has(java.lang.String key) |
abstract int |
hashCode() |
protected static void |
indent(java.io.PrintWriter writer,
int count)
Adds the number of indentations (4 spaces each) specified to the writer's output.
|
(package private) ModelNode |
insertChild(int index) |
protected static java.lang.String |
jsonEscape(java.lang.String orig)
Escapes the original string for inclusion in a JSON string.
|
(package private) ModelValue |
protect() |
protected static java.lang.String |
quote(java.lang.String orig) |
(package private) ModelNode |
removeChild(int index) |
(package private) ModelNode |
removeChild(java.lang.String name) |
(package private) ModelNode |
requireChild(int index) |
(package private) ModelNode |
requireChild(java.lang.String name) |
(package private) ModelValue |
resolve() |
java.lang.String |
toJSONString(boolean compact)
Converts this value to a JSON string representation.
|
java.lang.String |
toString() |
(package private) abstract void |
writeExternal(java.io.DataOutput out) |
void |
writeJSONString(java.io.PrintWriter writer,
boolean compact)
Outputs this value as a JSON string representation to the supplied PrintWriter instance.
|
void |
writeString(java.io.PrintWriter writer,
boolean compact)
Outputs the DMR representation of this value to the supplied PrintWriter instance.
|
private final ModelType type
static final ModelValue UNDEFINED
protected ModelValue(ModelType type)
ModelType getType()
long asLong()
long asLong(long defVal)
int asInt()
int asInt(int defVal)
boolean asBoolean()
boolean asBoolean(boolean defVal)
double asDouble()
double asDouble(double defVal)
byte[] asBytes()
java.math.BigDecimal asBigDecimal()
java.math.BigInteger asBigInteger()
abstract java.lang.String asString()
Property asProperty()
java.util.List<Property> asPropertyList()
ValueExpression asExpression()
ModelNode asObject()
ModelNode getChild(java.lang.String name)
ModelNode removeChild(java.lang.String name)
ModelNode removeChild(int index)
ModelNode getChild(int index)
ModelNode addChild()
ModelNode insertChild(int index)
java.util.Set<java.lang.String> getKeys()
java.util.List<ModelNode> asList()
ModelType asType()
ModelValue protect()
protected final ModelValue clone()
clone in class java.lang.Objectprotected static java.lang.String quote(java.lang.String orig)
protected static java.lang.String jsonEscape(java.lang.String orig)
orig - A string to be included in a JSON string.ModelValue copy()
public abstract boolean equals(java.lang.Object other)
equals in class java.lang.Objectpublic abstract int hashCode()
hashCode in class java.lang.Objectprotected static void indent(java.io.PrintWriter writer,
int count)
writer - The PrintWriter instance containing the current output.count - The number of indentations to be written.void format(java.io.PrintWriter writer,
int indent,
boolean multiLine)
writer - A PrintWriter instance containing the generated DMR string representation.indent - The number of tabs to indent the current generated string.multiLine - Flag indicating whether or not the string should begin on a new line.void formatAsJSON(java.io.PrintWriter writer,
int indent,
boolean multiLine)
writer - A PrintWriter instance containing the JSON string.indent - The number of tabs to indent the current generated string.multiLine - Flag that indicates whether or not the string should
begin on a new line.public java.lang.String toString()
toString in class java.lang.Objectpublic void writeString(java.io.PrintWriter writer,
boolean compact)
writer - A PrintWriter instance use to output the DMR string.compact - Flag indicating whether or not to include new lines in the generated string representation.public java.lang.String toJSONString(boolean compact)
compact - Flag indicating whether or not to include new lines in the generated string representation.public void writeJSONString(java.io.PrintWriter writer,
boolean compact)
writer - A PrintWriter instance use to output the JSON string.compact - Flag indicating whether or not to include new lines in the generated string representation.ModelValue resolve()
abstract void writeExternal(java.io.DataOutput out)
throws java.io.IOException
java.io.IOExceptionboolean has(int index)
boolean has(java.lang.String key)
ModelNode requireChild(java.lang.String name) throws java.util.NoSuchElementException
java.util.NoSuchElementExceptionModelNode requireChild(int index) throws java.util.NoSuchElementException
java.util.NoSuchElementException