Package org.apache.batik.test.xml
Class XMLReflect
java.lang.Object
org.apache.batik.test.xml.XMLReflect
- All Implemented Interfaces:
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 Summary
FieldsModifier and TypeFieldDescriptionstatic final StringAn error happened while trying to construct a test.Fields inherited from interface org.apache.batik.test.xml.XMLReflectConstants
XR_ARG_TAG, XR_CLASS_ATTRIBUTE, XR_NAME_ATTRIBUTE, XR_PROPERTY_TAG, XR_VALUE_ATTRIBUTE -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic ObjectbuildArgument(Element element) Limitation: Arguments *must* have a String based constructor.static ObjectbuildObject(Element element) Implementation helper: builds a generic objectstatic ObjectconfigureObject(Object obj, Element element, Element classDefiningElement) Implementation helper: configures a generic objectstatic ElementgetClassDefiningElement(Element element) Gets the defining class elementstatic ConstructorgetDeclaredConstructor(Class cl, Class[] argClasses) Returns a constructor that has can be used for the input class types.static voidsetObjectProperty(Object obj, String propertyName, Object propertyValue) Sets the property with given name on object to the input value
-
Field Details
-
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
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
Returns a constructor that has can be used for the input class types. -
buildArgument
Limitation: Arguments *must* have a String based constructor. Or be an object that takes a set of string based arguments.- Throws:
Exception
-
getClassDefiningElement
Gets the defining class element
-