Class SerializeOptions
java.lang.Object
org.jolokia.server.core.service.serializer.SerializeOptions
Options object influencing the serializing of JSON objects.
E.g. the max serialization depth when serializing a complex object.
JsonConvertOptions are create via a Builder. This Builder can get hard limits during construction time and can be reused. After each "build()" the Builder is reset (except for the hard limits). Hard limits can be exceeded when setting the actual values and can be used to ensure, that serialization does not goe crazy.
A limit of 0 means, that there is no limit set at all for this value.
- Since:
- 15.01.13
- Author:
- roland
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic classBuilder for constructing a convert options objects -
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final SerializeOptionsDefault JsonConvertOptions filled with the default values as defined in ConfigKey -
Method Summary
Modifier and TypeMethodDescriptionintgetCollectionSizeTruncated(int pCollectionSize) Get the size of the collection taking into account the maximum size of a collection allowed.Get the option for serializing long values.Get the configure fault handler which determines, how extractions fault are dealt withbooleanmaxDepthReached(int pDepth) Check whether the maximum depth has been reachedbooleanmaxObjectExceeded(int pObjectCount) Check whether the maximum number of objects has been exceeded
-
Field Details
-
DEFAULT
Default JsonConvertOptions filled with the default values as defined in ConfigKey
-
-
Method Details
-
maxDepthReached
public boolean maxDepthReached(int pDepth) Check whether the maximum depth has been reached- Parameters:
pDepth- current depth to check- Returns:
- true if the maximum depth has been exceeded, false otherwise
-
maxObjectExceeded
public boolean maxObjectExceeded(int pObjectCount) Check whether the maximum number of objects has been exceeded- Parameters:
pObjectCount- count to check- Returns:
- true if the maximum number of objects has been exceeded, false otherwise
-
getCollectionSizeTruncated
public int getCollectionSizeTruncated(int pCollectionSize) Get the size of the collection taking into account the maximum size of a collection allowed.- Parameters:
pCollectionSize- collection size to check- Returns:
- the original collection size if is smalled than the maximum collections, the maximum itself otherwise.
-
getSerializeLong
Get the option for serializing long values.- Returns:
- the option for serializing long values
-
getValueFaultHandler
Get the configure fault handler which determines, how extractions fault are dealt with- Returns:
- the configured fault handler
-