Class ObjectUtility
java.lang.Object
org.glassfish.pfl.basic.algorithm.ObjectUtility
General object related utilities.
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionprivate static class
(package private) static interface
-
Field Summary
FieldsModifier and TypeFieldDescriptionprivate ObjectUtility.ObjectPrinter
private final Object[][]
private ObjectUtility.ClassMap
private ObjectUtility.ObjectPrinter
private static ObjectUtility
private ObjectUtility.ObjectPrinter
private int
private int
private boolean
private ObjectUtility.ObjectPrinter
private static ObjectUtility.ObjectPrinter
private static ObjectUtility
private static ObjectUtility.ObjectPrinter
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprivate void
checkPackageAccess
(Class cls) (package private) ObjectUtility.ObjectPrinter
static String
compactObjectToString
(Object object) A convenience method that gives the default behavior: do not use indenting to display the object's structure.static String
defaultObjectToString
(Object object) A convenience method that gives the default behavior: use indenting to display the object's structure and do not use built-in toString methods.private Field[]
getDeclaredFields
(Class cls) private void
handleArray
(IdentityHashMap printed, ObjectWriter result, Object obj) private void
handleObject
(IdentityHashMap printed, ObjectWriter result, Object obj) objectToString
(Object obj) objectToString handles display of arbitrary objects.private void
objectToStringHelper
(IdentityHashMap printed, ObjectWriter result, Object obj) useToString
(Class cls)
-
Field Details
-
generalObjectPrinter
-
arrayPrinter
-
propertiesPrinter
-
collectionPrinter
-
mapPrinter
-
toStringPrinter
-
CLASS_MAP_DATA
-
classMap
-
isIndenting
private boolean isIndenting -
initialLevel
private int initialLevel -
increment
private int increment -
standard
-
compact
-
-
Constructor Details
-
ObjectUtility
public ObjectUtility(boolean isIndenting, int initialLevel, int increment)
-
-
Method Details
-
useToString
-
defaultObjectToString
A convenience method that gives the default behavior: use indenting to display the object's structure and do not use built-in toString methods.- Parameters:
object
- Object to print.- Returns:
- the String representation of obj.
-
compactObjectToString
A convenience method that gives the default behavior: do not use indenting to display the object's structure.- Parameters:
object
- Object to print.- Returns:
- the String representation of obj.
-
objectToString
objectToString handles display of arbitrary objects. It correctly handles objects whose elements form an arbitrary graph. It uses reflection to display the contents of any kind of object. An object's toString() method may optionally be used, but the default is to ignore all toString() methods except for those defined for primitive types, primitive type wrappers, and strings. -
classify
-
objectToStringHelper
-
checkPackageAccess
-
getDeclaredFields
-
handleObject
-
handleArray
-