Top Description Inners Fields Constructors Methods
com.typesafe.config.impl

pack-priv Class SerializedConfigValue

extends AbstractConfigValue
implements Externalizable
Class Inheritance
All Implemented Interfaces
java.io.Externalizable, java.io.Serializable
Imports
java.io.ByteArrayInputStream, .ByteArrayOutputStream, .DataInput, .DataInputStream, .DataOutput, .DataOutputStream, .Externalizable, .IOException, .NotSerializableException, .ObjectInput, .ObjectOutput, .ObjectStreamException, java.util.ArrayList, .Collections, .EnumMap, .HashMap, .List, .Map, com.typesafe.config.Config, .ConfigException, .ConfigList, .ConfigObject, .ConfigOrigin, .ConfigValue, .ConfigValueType

Deliberately shoving all the serialization code into this class instead of doing it OO-style with each subclass. Seems better to have it all in one place. This class implements a lame serialization format that supports skipping unknown fields, so it's moderately more extensible than the default Java serialization format.

Nested and Inner Type Summary

Modifier and TypeClass and Description
private static class
pack-priv static enum
private static enum

Field Summary

Modifier and TypeField and Description
private static final long
private ConfigValue
private boolean

Constructor Summary

AccessConstructor and Description
public
pack-priv
pack-priv

Method Summary

Modifier and TypeMethod and Description
public boolean
equals(Object
the reference object with which to compare.
other
)

Overrides com.typesafe.config.impl.AbstractConfigValue.equals.

Indicates whether some other object is "equal to" this one.

private DataInput
public int
hashCode()

Overrides com.typesafe.config.impl.AbstractConfigValue.hashCode.

Returns a hash code value for this object.

protected SerializedConfigValue
private static SerializedConfigValue.SerializedField
public void
readExternal(ObjectInput
the stream to read data from in order to restore the object
in
)

Implements java.io.Externalizable.readExternal.

The object implements the readExternal method to restore its contents by calling the methods of DataInput for primitive types and readObject for objects, strings and arrays.

pack-priv static SimpleConfigOrigin
private Object
private static AbstractConfigValue
private static AbstractConfigValue
private static ConfigException
private static void
public final String
toString()

Overrides com.typesafe.config.impl.AbstractConfigValue.toString.

Returns a string representation of the object.

public Object
unwrapped()

Implements com.typesafe.config.ConfigValue.unwrapped.

Returns the value as a plain Java boxed value, that is, a String, Number, Boolean, Map<String,Object>, List<Object>, or null, matching the valueType() of this ConfigValue.

public ConfigValueType
valueType()

Implements com.typesafe.config.ConfigValue.valueType.

The ConfigValueType of the value; matches the JSON type schema.

private static void
public void
writeExternal(ObjectOutput
the stream to write the object to
out
)

Implements java.io.Externalizable.writeExternal.

The object implements the writeExternal method to save its contents by calling the methods of DataOutput for its primitive values or calling the writeObject method of ObjectOutput for objects, strings, and arrays.

private static void
pack-priv static void
private static void
private static void
private static void
Inherited from com.typesafe.config.impl.AbstractConfigValue:
appendHiddenEnvVariableValueatKeyatKeyatPathatPathcanEqualconstructDelayedMergehasDescendantInListhideEnvVariableValueignoresFallbacksindentmergedWithNonObjectmergedWithNonObjectmergedWithObjectmergedWithObjectmergedWithTheUnmergeablemergedWithTheUnmergeableoriginrelativizedrenderrenderrenderrenderreplaceChildInListrequireNotIgnoringFallbacksresolveStatusresolveSubstitutionstoFallbackValuetransformToStringwithFallbackwithFallbacksIgnoredwithOrigin

Field Detail

serialVersionUIDback to summary
private static final long serialVersionUID
valueback to summary
private ConfigValue value
wasConfigback to summary
private boolean wasConfig

Constructor Detail

SerializedConfigValueback to summary
public SerializedConfigValue()
SerializedConfigValueback to summary
pack-priv SerializedConfigValue(ConfigValue value)
SerializedConfigValueback to summary
pack-priv SerializedConfigValue(Config conf)

Method Detail

equalsback to summary
public boolean equals(Object other)

Overrides com.typesafe.config.impl.AbstractConfigValue.equals.

Doc from java.lang.Object.equals.

Indicates whether some other object is "equal to" this one.

The equals method implements an equivalence relation on non-null object references:

  • It is reflexive: for any non-null reference value x, x.equals(x) should return true.
  • It is symmetric: for any non-null reference values x and y, x.equals(y) should return true if and only if y.equals(x) returns true.
  • It is transitive: for any non-null reference values x, y, and z, if x.equals(y) returns true and y.equals(z) returns true, then x.equals(z) should return true.
  • It is consistent: for any non-null reference values x and y, multiple invocations of x.equals(y) consistently return true or consistently return false, provided no information used in equals comparisons on the objects is modified.
  • For any non-null reference value x, x.equals(null) should return false.

An equivalence relation partitions the elements it operates on into equivalence classes; all the members of an equivalence class are equal to each other. Members of an equivalence class are substitutable for each other, at least for some purposes.

Parameters
other:Object

the reference object with which to compare.

Returns:boolean

true if this object is the same as the obj argument; false otherwise.

Annotations
@Override
fieldInback to summary
private DataInput fieldIn(ObjectInput in) throws IOException
hashCodeback to summary
public int hashCode()

Overrides com.typesafe.config.impl.AbstractConfigValue.hashCode.

Doc from java.lang.Object.hashCode.

Returns a hash code value for this object. This method is supported for the benefit of hash tables such as those provided by java.util.HashMap.

The general contract of hashCode is:

  • Whenever it is invoked on the same object more than once during an execution of a Java application, the hashCode method must consistently return the same integer, provided no information used in equals comparisons on the object is modified. This integer need not remain consistent from one execution of an application to another execution of the same application.
  • If two objects are equal according to the equals method, then calling the hashCode method on each of the two objects must produce the same integer result.
  • It is not required that if two objects are unequal according to the equals method, then calling the hashCode method on each of the two objects must produce distinct integer results. However, the programmer should be aware that producing distinct integer results for unequal objects may improve the performance of hash tables.
Returns:int

a hash code value for this object

Annotations
@Override
newCopyback to summary
protected SerializedConfigValue newCopy(ConfigOrigin origin)

Implements abstract com.typesafe.config.impl.AbstractConfigValue.newCopy.

Annotations
@Override
readCodeback to summary
private static SerializedConfigValue.SerializedField readCode(DataInput in) throws IOException
readExternalback to summary
public void readExternal(ObjectInput in) throws IOException, ClassNotFoundException

Implements java.io.Externalizable.readExternal.

Doc from java.io.Externalizable.readExternal.

The object implements the readExternal method to restore its contents by calling the methods of DataInput for primitive types and readObject for objects, strings and arrays. The readExternal method must read the values in the same sequence and with the same types as were written by writeExternal.

Parameters
in:ObjectInput

the stream to read data from in order to restore the object

Annotations
@Override
Exceptions
IOException:
if I/O errors occur
ClassNotFoundException:
If the class for an object being restored cannot be found.
readOriginback to summary
pack-priv static SimpleConfigOrigin readOrigin(DataInput in, SimpleConfigOrigin baseOrigin) throws IOException
readResolveback to summary
private Object readResolve() throws ObjectStreamException
readValueback to summary
private static AbstractConfigValue readValue(DataInput in, SimpleConfigOrigin baseOrigin) throws IOException
readValueDataback to summary
private static AbstractConfigValue readValueData(DataInput in, SimpleConfigOrigin origin) throws IOException
shouldNotBeUsedback to summary
private static ConfigException shouldNotBeUsed()
skipFieldback to summary
private static void skipField(DataInput in) throws IOException
toStringback to summary
public final String toString()

Overrides com.typesafe.config.impl.AbstractConfigValue.toString.

Doc from java.lang.Object.toString.

Returns a string representation of the object. Satisfying this method's contract implies a non-null result must be returned.

Returns:String

a string representation of the object

Annotations
@Override
unwrappedback to summary
public Object unwrapped()

Implements com.typesafe.config.ConfigValue.unwrapped.

Doc from com.typesafe.config.ConfigValue.unwrapped.

Returns the value as a plain Java boxed value, that is, a String, Number, Boolean, Map<String,Object>, List<Object>, or null, matching the valueType() of this ConfigValue. If the value is a ConfigObject or ConfigList, it is recursively unwrapped.

Returns:Object

a plain Java value corresponding to this ConfigValue

Annotations
@Override
valueTypeback to summary
public ConfigValueType valueType()

Implements com.typesafe.config.ConfigValue.valueType.

Doc from com.typesafe.config.ConfigValue.valueType.

The ConfigValueType of the value; matches the JSON type schema.

Returns:ConfigValueType

value's type

Annotations
@Override
writeEndMarkerback to summary
private static void writeEndMarker(DataOutput out) throws IOException
writeExternalback to summary
public void writeExternal(ObjectOutput out) throws IOException

Implements java.io.Externalizable.writeExternal.

Doc from java.io.Externalizable.writeExternal.

The object implements the writeExternal method to save its contents by calling the methods of DataOutput for its primitive values or calling the writeObject method of ObjectOutput for objects, strings, and arrays.

Parameters
out:ObjectOutput

the stream to write the object to

Annotations
@Override
Exceptions
IOException:
Includes any I/O exceptions that may occur
writeFieldback to summary
private static void writeField(DataOutput out, SerializedConfigValue.FieldOut field) throws IOException
writeOriginback to summary
pack-priv static void writeOrigin(DataOutput out, SimpleConfigOrigin origin, SimpleConfigOrigin baseOrigin) throws IOException
writeOriginFieldback to summary
private static void writeOriginField(DataOutput out, SerializedConfigValue.SerializedField code, Object v) throws IOException
writeValueback to summary
private static void writeValue(DataOutput out, ConfigValue value, SimpleConfigOrigin baseOrigin) throws IOException
writeValueDataback to summary
private static void writeValueData(DataOutput out, ConfigValue value) throws IOException
com.typesafe.config.impl back to summary

private Class SerializedConfigValue.FieldOut

extends Object
Class Inheritance

Field Summary

Modifier and TypeField and Description
pack-priv final ByteArrayOutputStream
pack-priv final SerializedConfigValue.SerializedField
pack-priv final DataOutput

Constructor Summary

AccessConstructor and Description
pack-priv

Method Summary

Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Field Detail

bytesback to summary
pack-priv final ByteArrayOutputStream bytes
codeback to summary
pack-priv final SerializedConfigValue.SerializedField code
databack to summary
pack-priv final DataOutput data

Constructor Detail

FieldOutback to summary
pack-priv FieldOut(SerializedConfigValue.SerializedField code)
com.typesafe.config.impl back to summary

pack-priv final Enum SerializedConfigValue.SerializedField

extends Enum<SerializedConfigValue.SerializedField>
Class Inheritance

Field Summary

Modifier and TypeField and Description
public static final SerializedConfigValue.SerializedField
public static final SerializedConfigValue.SerializedField
public static final SerializedConfigValue.SerializedField
public static final SerializedConfigValue.SerializedField
public static final SerializedConfigValue.SerializedField
public static final SerializedConfigValue.SerializedField
public static final SerializedConfigValue.SerializedField
public static final SerializedConfigValue.SerializedField
public static final SerializedConfigValue.SerializedField
public static final SerializedConfigValue.SerializedField
public static final SerializedConfigValue.SerializedField
public static final SerializedConfigValue.SerializedField
public static final SerializedConfigValue.SerializedField
public static final SerializedConfigValue.SerializedField
public static final SerializedConfigValue.SerializedField
public static final SerializedConfigValue.SerializedField

Constructor Summary

AccessConstructor and Description
private

Method Summary

Modifier and TypeMethod and Description
pack-priv static SerializedConfigValue.SerializedField
forInt(int b)

public static SerializedConfigValue.SerializedField
public static SerializedConfigValue.SerializedField[]
Inherited from java.lang.Enum:
clonecompareTodescribeConstableequalsfinalizegetDeclaringClasshashCodenameordinaltoStringvalueOf

Field Detail

END_MARKERback to summary
public static final SerializedConfigValue.SerializedField END_MARKER
ORIGIN_COMMENTSback to summary
public static final SerializedConfigValue.SerializedField ORIGIN_COMMENTS
ORIGIN_DESCRIPTIONback to summary
public static final SerializedConfigValue.SerializedField ORIGIN_DESCRIPTION
ORIGIN_END_LINE_NUMBERback to summary
public static final SerializedConfigValue.SerializedField ORIGIN_END_LINE_NUMBER
ORIGIN_LINE_NUMBERback to summary
public static final SerializedConfigValue.SerializedField ORIGIN_LINE_NUMBER
ORIGIN_NULL_COMMENTSback to summary
public static final SerializedConfigValue.SerializedField ORIGIN_NULL_COMMENTS
ORIGIN_NULL_RESOURCEback to summary
public static final SerializedConfigValue.SerializedField ORIGIN_NULL_RESOURCE
ORIGIN_NULL_URLback to summary
public static final SerializedConfigValue.SerializedField ORIGIN_NULL_URL
ORIGIN_RESOURCEback to summary
public static final SerializedConfigValue.SerializedField ORIGIN_RESOURCE
ORIGIN_TYPEback to summary
public static final SerializedConfigValue.SerializedField ORIGIN_TYPE
ORIGIN_URLback to summary
public static final SerializedConfigValue.SerializedField ORIGIN_URL
ROOT_VALUEback to summary
public static final SerializedConfigValue.SerializedField ROOT_VALUE
ROOT_WAS_CONFIGback to summary
public static final SerializedConfigValue.SerializedField ROOT_WAS_CONFIG
UNKNOWNback to summary
public static final SerializedConfigValue.SerializedField UNKNOWN
VALUE_DATAback to summary
public static final SerializedConfigValue.SerializedField VALUE_DATA
VALUE_ORIGINback to summary
public static final SerializedConfigValue.SerializedField VALUE_ORIGIN

Constructor Detail

SerializedFieldback to summary
private SerializedField()

Method Detail

forIntback to summary
pack-priv static SerializedConfigValue.SerializedField forInt(int b)
valueOfback to summary
public static SerializedConfigValue.SerializedField valueOf(String name)
valuesback to summary
public static SerializedConfigValue.SerializedField[] values()
com.typesafe.config.impl back to summary

private final Enum SerializedConfigValue.SerializedValueType

extends Enum<SerializedConfigValue.SerializedValueType>
Class Inheritance

Field Summary

Modifier and TypeField and Description
public static final SerializedConfigValue.SerializedValueType
pack-priv ConfigValueType
public static final SerializedConfigValue.SerializedValueType
public static final SerializedConfigValue.SerializedValueType
public static final SerializedConfigValue.SerializedValueType
public static final SerializedConfigValue.SerializedValueType
public static final SerializedConfigValue.SerializedValueType
public static final SerializedConfigValue.SerializedValueType
public static final SerializedConfigValue.SerializedValueType

Constructor Summary

AccessConstructor and Description
private

Method Summary

Modifier and TypeMethod and Description
pack-priv static SerializedConfigValue.SerializedValueType
forInt(int b)

pack-priv static SerializedConfigValue.SerializedValueType
public static SerializedConfigValue.SerializedValueType
public static SerializedConfigValue.SerializedValueType[]
Inherited from java.lang.Enum:
clonecompareTodescribeConstableequalsfinalizegetDeclaringClasshashCodenameordinaltoStringvalueOf

Field Detail

BOOLEANback to summary
public static final SerializedConfigValue.SerializedValueType BOOLEAN
configTypeback to summary
pack-priv ConfigValueType configType
DOUBLEback to summary
public static final SerializedConfigValue.SerializedValueType DOUBLE
INTback to summary
public static final SerializedConfigValue.SerializedValueType INT
LISTback to summary
public static final SerializedConfigValue.SerializedValueType LIST
LONGback to summary
public static final SerializedConfigValue.SerializedValueType LONG
NULLback to summary
public static final SerializedConfigValue.SerializedValueType NULL
OBJECTback to summary
public static final SerializedConfigValue.SerializedValueType OBJECT
STRINGback to summary
public static final SerializedConfigValue.SerializedValueType STRING

Constructor Detail

SerializedValueTypeback to summary
private SerializedValueType(ConfigValueType configType)

Method Detail

forIntback to summary
pack-priv static SerializedConfigValue.SerializedValueType forInt(int b)
forValueback to summary
pack-priv static SerializedConfigValue.SerializedValueType forValue(ConfigValue value)
valueOfback to summary
public static SerializedConfigValue.SerializedValueType valueOf(String name)
valuesback to summary
public static SerializedConfigValue.SerializedValueType[] values()