Handler Processing

From Filtered Push Wiki
Jump to: navigation, search




The rdf handler uses the ModelDescriptorBuilder to construct a representation of the information in the xml model descriptor as Java classes (see the diagram above for the classes) for use by the handler. It separates out resources and the different property types.

There are three property types (which in the xml have only one corresponding element, property):

  1. BoundProperty - A property that is static and does not need to be obtained from java class fields/methods. May either be a string literal or datatype property.
  2. UnboundProperty - A property that is mapped to a value of a field or method return type value in a java class. The class name and method or field info is held in the descriptor class.
  3. ObjectProperty - Refers to another resource. Can also hold a reference to a container (such as an rdf bag)

ModelDescriptorBuilder usage: This class and its methods are invoked by the rdf handler to create a series of java classes that describe the xml descriptor. All that is needed is the xml config file argument:

mdb = new ModelDescriptorBuilder("desriptor.xml");
ModelDescriptor modelDescriptor = mdb.buildModelDescriptor();

The ModelDescriptor has one or more ResourceDescriptor references. Each of the ResourceDescriptors has zero or more references to ObjectProperty, UnboundProperty, and BoundProperty Descriptors.

RdfBeanHandler uses the information in these descriptor classes instead of accessing the xml directly. The xml is processed via jaxb to contstruct the values of the members of these classes.