Class XMLReflect

java.lang.Object
org.apache.batik.test.xml.XMLReflect
All Implemented Interfaces:
XMLReflectConstants

public class XMLReflect extends Object implements XMLReflectConstants
This helper class can be used to build Java object from their XML description.
Version:
$Id: XMLReflect.java 1810083 2017-09-29 10:39:45Z ssteiner $
  • Field Details

    • NO_MATCHING_CONSTRUCTOR

      public static final String NO_MATCHING_CONSTRUCTOR
      An error happened while trying to construct a test. No constructor matching the list of arguments could be found {0} : The test's class name {1} : The list of argument types for which no constructor was found
      See Also:
  • Constructor Details

    • XMLReflect

      public XMLReflect()
  • Method Details

    • buildObject

      public static Object buildObject(Element element) throws Exception
      Implementation helper: builds a generic object
      Throws:
      Exception
    • configureObject

      public static Object configureObject(Object obj, Element element, Element classDefiningElement) throws Exception
      Implementation helper: configures a generic object
      Throws:
      Exception
    • setObjectProperty

      public static void setObjectProperty(Object obj, String propertyName, Object propertyValue) throws Exception
      Sets the property with given name on object to the input value
      Throws:
      Exception
    • getDeclaredConstructor

      public static Constructor getDeclaredConstructor(Class cl, Class[] argClasses)
      Returns a constructor that has can be used for the input class types.
    • buildArgument

      public static Object buildArgument(Element element) throws Exception
      Limitation: Arguments *must* have a String based constructor. Or be an object that takes a set of string based arguments.
      Throws:
      Exception
    • getClassDefiningElement

      public static Element getClassDefiningElement(Element element)
      Gets the defining class element