All Downloads are FREE. Search and download functionalities are using the official Maven repository.

jadex.xml.reader.IObjectReaderHandler Maven / Gradle / Ivy

Go to download

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.

There is a newer version: 4.0.267
Show newest version
package jadex.xml.reader;


import java.util.List;
import java.util.Map;

import jadex.xml.IPostProcessor;
import jadex.xml.TypeInfo;
import jadex.xml.stax.QName;

/**
 *  Interface for object reader handler.
 *  Is called when a tag start is found and an object could be created.
 *  Is called when an end tag is found and an object could be linked to its parent.
 */
public interface IObjectReaderHandler extends IObjectLinker, IBulkObjectLinker
{
	/**
	 *  Create an object for the current tag.
	 *  @param type The object type to create.
	 *  @param root Flag, if object should be root object.
	 *  @param context The context.
	 *  @return The created object (or null for none).
	 */
	public Object createObject(Object typeinfo, boolean root, AReadContext context, Map rawattributes) throws Exception;
	
//	/**
//	 *  Get the object type
//	 *  @param object The object.
//	 *  @return The object type.
//	 */
//	public Object getObjectType(Object object, ReadContext context);
	
	/**
	 *  Convert a content string object to another type of object.
	 */
	public Object convertContentObject(String object, QName tag, AReadContext context) throws Exception;
	
	/**
	 *  Handle the attribute of an object.
	 *  @param object The object.
	 *  @param xmlattrname The attribute name.
	 *  @param attrval The attribute value.
	 *  @param attrinfo The attribute info.
	 *  @param context The context.
	 */
	public void handleAttributeValue(Object object, QName xmlattrname, List attrpath, String attrval, 
		Object attrinfo, AReadContext context) throws Exception;
	
//	/**
//	 *  Get the most specific mapping info.
//	 *  @param tag The tag.
//	 *  @param fullpath The full path.
//	 *  @return The most specific mapping info.
//	 */
//	public TypeInfo getTypeInfo(QName tag, QName[] fullpath, Map rawattributes);
	
	/**
	 *  Get the most specific mapping info.
	 *  @param tag The tag.
	 *  @param fullpath The full path.
	 *  @return The most specific mapping info.
	 */
	public TypeInfo getTypeInfo(Object type, QName[] fullpath, AReadContext context);
	
	/**
	 *  Get the post-processor.
	 *  @return The post-processor
	 */
	public IPostProcessor[] getPostProcessors(Object object, Object typeinfo);
}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy