Class XMLBinder
java.lang.Object
com.vividsolutions.jump.util.java2xml.XMLBinder
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic interfaceSometimes you need to use a CustomConverter rather than a .java2xml file i.e. when the class is from a third party (e.g. a Swing class) and you can't add a .java2xml file to the jar.protected static interfacestatic class -
Constructor Summary
ConstructorsConstructorDescriptionInitialize an XMLBinder and register CustomConverters for current classes like Class, Color, Date, Font... -
Method Summary
Modifier and TypeMethodDescriptionvoidaddCustomConverter(Class<?> c, XMLBinder.CustomConverter converter) protected Class<?> fieldClass(Method setter) protected booleanhasCustomConverter(Class<?> fieldClass) protected List<org.jdom2.Element> specElements(Class<?> c) Return the List of XML Elements to be used to serialize a Class.protected booleanprotected Stringprotected voidvisit(List<org.jdom2.Element> specElements, XMLBinder.SpecVisitor visitor, Class<?> c)
-
Constructor Details
-
XMLBinder
public XMLBinder()Initialize an XMLBinder and register CustomConverters for current classes like Class, Color, Date, Font...
-
-
Method Details
-
specElements
protected List<org.jdom2.Element> specElements(Class<?> c) throws XMLBinder.XMLBinderException, org.jdom2.JDOMException, IOException Return the List of XML Elements to be used to serialize a Class.- Throws:
XMLBinder.XMLBinderExceptionorg.jdom2.JDOMExceptionIOException
-
addCustomConverter
-
visit
protected void visit(List<org.jdom2.Element> specElements, XMLBinder.SpecVisitor visitor, Class<?> c) throws Exception - Parameters:
c- for error messages- Throws:
Exception
-
toJava
-
specifyingTypeExplicitly
-
fieldClass
-
setter
- Throws:
XMLBinder.XMLBinderException
-
toXML
-
hasCustomConverter
-