jadex.xml.SXML Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of jadex-xml Show documentation
Show all versions of jadex-xml Show documentation
Jadex XML is an XML data binding framework for Java and also for other representations. The main idea of Jadex XML is that neither the XML-Schema on the one side nor the Java classes on the other side should define other binding. Instead, a separate mapping between both is used as a mediation. This allows designing the XML representation independent of the Java side but still being able to connect both as desired.
This idea was first put forward by the JiBX data binding framework. Jadex XML pushes it further by combining it with the configuration by exception principle. The framework can detect obvious correspondences between both sides automatically and only needs configuration information when translations are necessary. The configuration information is currently specified directly in form of Java configuration classes.
package jadex.xml;
import java.lang.reflect.Field;
import java.lang.reflect.Method;
import jadex.commons.transformation.annotations.Classname;
import jadex.xml.stax.QName;
/**
* Constants for xml handling.
*/
public class SXML
{
//-------- constants --------
/** The ID attribute constant. */
public static final String ID = "__ID";
/** The IDREF attribute constant. */
public static final String IDREF = "__IDREF";
/** The package protocol constant. */
public static final String PROTOCOL_TYPEINFO = "typeinfo:";
/** The value of this attribute is used as idref. */
public static final String ARRAYLEN = "__len";
/** The null tag. */
public static final QName NULL = new QName(SXML.PROTOCOL_TYPEINFO, "null");
/** Constant for anonymous inner classes. */
public static final String XML_CLASSNAME = "XML_CLASSNAME";
/** The linefeed separator. */
public static final String lf = (String) System.getProperty("line.separator");
/** The default encoding. */
public static final String DEFAULT_ENCODING = "utf-8";
/**
* Get the xmlclassname annotation.
*/
public static Classname getXMLClassnameAnnotation(Class clazz)
{
Classname xmlc = null;
// Find annotation in fields or methods of class, because annotations are not supported on anonymous classes directly.
Field[] fields = clazz.getDeclaredFields();
for(int i=0; xmlc==null && i
© 2015 - 2025 Weber Informatics LLC | Privacy Policy