Class AemObjectReflectionToStringBuilder

java.lang.Object
org.apache.commons.lang3.builder.ToStringBuilder
org.apache.commons.lang3.builder.ReflectionToStringBuilder
io.wcm.wcm.commons.util.AemObjectReflectionToStringBuilder
All Implemented Interfaces:
org.apache.commons.lang3.builder.Builder<String>

public class AemObjectReflectionToStringBuilder extends org.apache.commons.lang3.builder.ReflectionToStringBuilder
Extends ReflectionToStringBuilder to provide custom handling for AEM-related objects (Resource, Page, Asset, ValueMap) for a more compact log output.
  • Field Summary

    Fields inherited from class org.apache.commons.lang3.builder.ReflectionToStringBuilder

    excludeFieldNames
  • Constructor Summary

    Constructors
    Constructor
    Description
     
    AemObjectReflectionToStringBuilder(Object object, org.apache.commons.lang3.builder.ToStringStyle style)
     
  • Method Summary

    Modifier and Type
    Method
    Description
    static Map<String,Object>
    filteredValueMap(org.apache.sling.api.resource.ValueMap props)
    Filter value map to exclude jcr:* properties and null values.
    protected Object
    getValue(Field field)
     

    Methods inherited from class org.apache.commons.lang3.builder.ReflectionToStringBuilder

    accept, appendFieldsIn, getExcludeFieldNames, getUpToClass, isAppendStatics, isAppendTransients, isExcludeNullValues, reflectionAppendArray, setAppendStatics, setAppendTransients, setExcludeFieldNames, setExcludeNullValues, setUpToClass, toString, toString, toString, toString, toString, toString, toString, toStringExclude, toStringExclude

    Methods inherited from class org.apache.commons.lang3.builder.ToStringBuilder

    append, append, append, append, append, append, append, append, append, append, append, append, append, append, append, append, append, append, append, append, append, append, append, append, append, append, append, append, append, append, append, append, append, append, append, append, append, append, append, append, append, append, append, append, append, append, appendAsObjectToString, appendSuper, appendToString, build, getDefaultStyle, getObject, getStringBuffer, getStyle, reflectionToString, reflectionToString, reflectionToString, reflectionToString, setDefaultStyle

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
  • Constructor Details

    • AemObjectReflectionToStringBuilder

      public AemObjectReflectionToStringBuilder(Object object)
      Parameters:
      object - Object to output
    • AemObjectReflectionToStringBuilder

      public AemObjectReflectionToStringBuilder(Object object, org.apache.commons.lang3.builder.ToStringStyle style)
      Parameters:
      object - Object to output
      style - Style
  • Method Details

    • getValue

      protected Object getValue(Field field) throws IllegalAccessException
      Overrides:
      getValue in class org.apache.commons.lang3.builder.ReflectionToStringBuilder
      Throws:
      IllegalAccessException
    • filteredValueMap

      public static Map<String,Object> filteredValueMap(org.apache.sling.api.resource.ValueMap props)
      Filter value map to exclude jcr:* properties and null values.
      Parameters:
      props - Value map
      Returns:
      Filtered value map, sorted by key