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.ObjectPrinterprivate final Object[][]private ObjectUtility.ClassMapprivate ObjectUtility.ObjectPrinterprivate static ObjectUtilityprivate ObjectUtility.ObjectPrinterprivate intprivate intprivate booleanprivate ObjectUtility.ObjectPrinterprivate static ObjectUtility.ObjectPrinterprivate static ObjectUtilityprivate static ObjectUtility.ObjectPrinter -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprivate voidcheckPackageAccess(Class cls) (package private) ObjectUtility.ObjectPrinterstatic StringcompactObjectToString(Object object) A convenience method that gives the default behavior: do not use indenting to display the object's structure.static StringdefaultObjectToString(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 voidhandleArray(IdentityHashMap printed, ObjectWriter result, Object obj) private voidhandleObject(IdentityHashMap printed, ObjectWriter result, Object obj) objectToString(Object obj) objectToString handles display of arbitrary objects.private voidobjectToStringHelper(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
-
compactObjectToString
-
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
-