Class RMXMLMapMaker

java.lang.Object
com.ribs.datasource.RMXMLMapMaker

public class RMXMLMapMaker extends Object
This class abstracts an object (or object graph) into core Java types (Map, List, String Number, Boolean, Date and byte[]) via Java reflection/introspection. This is done recursively (through any non-core types), so a whole object graph can be abstracted. This allows ReportMill to import a representation of an object/object-graph, potentially made up of custom Java classes or EJBs, without the original classes being present.

Copyright (c) 2002 ReportMill Software, Inc. All Rights Reserved. This code may be used free of charge as long as this message remains. Contact Jeff Martin <jeff@reportmill.com>.

  • Field Summary

    Fields
    Modifier and Type
    Field
    Description
    static final String
     
    static final String
     
    static final String
     
    static final String
     
    static final String
     
  • Constructor Summary

    Constructors
    Constructor
    Description
    Creates a plain map-maker instance.
  • Method Summary

    Modifier and Type
    Method
    Description
    This is an override hook to convert object relations to List/Map if they are otherwise (eg, WebObjects/NSArray).
    Returns a className for an Object whether String or Class (may trim class name according to _useShortClassNames).
    getSchema(Map aMap)
    This code returns an RMSchema for a given object graph of Java primatives (Map, List, String, Number, Date).
    boolean
    ignore(String aName)
    Returns whether map-maker should ignore any member with the given name.
    boolean
    Returns whether map-maker should ignore any member with the given name (provided as a potential over-ride hook).
    void
    Tells map-maker to ignore any members encountered with the given class.
    void
    ignoreClass(String aClassName)
    Tells map-maker to ignore any members encountered with the given class (by class name).
    void
    Tells map-maker to ignore any members encountered with the given name.
    boolean
    Returns whether map maker logs calls to methods.
    makeMap(Object anObj)
    Core method to abstract anObject into Java Collections and Java core types (degree of separation is 3).
    makeMap(Object anObj, int degreeOfSeparation)
    Core method to abstract anObject into Java Collections and Java core types with a given degree of separation.
    void
    Sets whether RM only explores getXXX accessor methods (as opposed to any method returning a value).
    void
    setUseShortClassNames(boolean aFlag)
    Returns whether map-maker should make schema prettier by not using fully specified class names.
    void
    setVerbose(boolean aFlag)
    Sets whether map maker logs calls to methods.
    boolean
    Returns whether RM only explores getXXX accessor methods (as opposed to any method returning a value).
    boolean
    Returns whether map-maker should make schema prettier by not using fully specified class names.

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Field Details

  • Constructor Details

    • RMXMLMapMaker

      public RMXMLMapMaker()
      Creates a plain map-maker instance.
  • Method Details

    • useGetAndIsMethodsOnly

      public boolean useGetAndIsMethodsOnly()
      Returns whether RM only explores getXXX accessor methods (as opposed to any method returning a value).
    • setUseGetAndIsMethodsOnly

      public void setUseGetAndIsMethodsOnly(boolean aFlag)
      Sets whether RM only explores getXXX accessor methods (as opposed to any method returning a value).
    • isVerbose

      public boolean isVerbose()
      Returns whether map maker logs calls to methods.
    • setVerbose

      public void setVerbose(boolean aFlag)
      Sets whether map maker logs calls to methods.
    • useShortClassNames

      public boolean useShortClassNames()
      Returns whether map-maker should make schema prettier by not using fully specified class names.
    • setUseShortClassNames

      public void setUseShortClassNames(boolean aFlag)
      Returns whether map-maker should make schema prettier by not using fully specified class names.
    • ignoreClass

      public void ignoreClass(Class aClass)
      Tells map-maker to ignore any members encountered with the given class.
    • ignoreClass

      public void ignoreClass(String aClassName)
      Tells map-maker to ignore any members encountered with the given class (by class name).
    • ignoreMember

      public void ignoreMember(String aName)
      Tells map-maker to ignore any members encountered with the given name.
    • ignore

      public boolean ignore(String aName)
      Returns whether map-maker should ignore any member with the given name.
    • ignore_super

      public boolean ignore_super(String aName)
      Returns whether map-maker should ignore any member with the given name (provided as a potential over-ride hook).
    • convertFromAppServerType

      public Object convertFromAppServerType(Object anObj)
      This is an override hook to convert object relations to List/Map if they are otherwise (eg, WebObjects/NSArray).
    • makeMap

      public Map makeMap(Object anObj)
      Core method to abstract anObject into Java Collections and Java core types (degree of separation is 3).
    • makeMap

      public Map makeMap(Object anObj, int degreeOfSeparation)
      Core method to abstract anObject into Java Collections and Java core types with a given degree of separation.
    • getSchema

      public RMSchema getSchema(Map aMap)
      This code returns an RMSchema for a given object graph of Java primatives (Map, List, String, Number, Date).
    • getClassName

      public String getClassName(Object anObj)
      Returns a className for an Object whether String or Class (may trim class name according to _useShortClassNames).