Collaboration API Documentation

com.filenet.bso.api.util
Interface BsoContentBinder


public interface BsoContentBinder

Classes that implement the BsoContentBinder interface encapsulate support for marshaling and unmarshaling of XML content to and from Java objects. They also provide a way to get a BsoElements interface, which has methods for manipulating these Java objects.

Each derived concrete class encapsulates knowledge of how to marshal and unmarshal XML content into a hierarchy of Java objects.


Method Summary
 void clearContent()
          Clears the XML-based object hierarchy.
 BsoElements getElements()
          Returns an element manager that implements the BsoElements interface.
 boolean getGuidsValid()
          Returns whether the Content Engine GUIDs in the elements are valid or not.
 java.lang.Object getRootObject()
          Returns the root object in the XML-based object hierarchy.
 java.lang.String marshalContent()
          Returns XML representing the current state of the XML-based Java objects.
 java.lang.String marshalElement(BsoElement elem)
          Returns the XML for an upper-level object.
 void setGuidsValid(boolean guidsValid)
          Sets whether the Content Engine GUIDs in the elements are valid or not.
 void unmarshalContent(java.lang.String xml)
          Sets XML content into the binder, which creates the XML-based Java objects.
 BsoElement unmarshalElement(java.lang.String xml, int type)
          Returns a BsoElement created from XML.
 

Method Detail

unmarshalContent

public void unmarshalContent(java.lang.String xml)
Sets XML content into the binder, which creates the XML-based Java objects.

Parameters:
xml - A String containing valid, well-formed XML for the content.

marshalContent

public java.lang.String marshalContent()
Returns XML representing the current state of the XML-based Java objects.

Returns:
A String containing the XML content of all Java objects.

getRootObject

public java.lang.Object getRootObject()
Returns the root object in the XML-based object hierarchy.

Consumers of this API must cast the returned object to a specific Java class.

Returns:
The root Object of the XML-based object hierarchy.

clearContent

public void clearContent()
Clears the XML-based object hierarchy.

unmarshalElement

public BsoElement unmarshalElement(java.lang.String xml,
                                   int type)
Returns a BsoElement created from XML. Use this method to create the Java objects for upper-level elements in the object hierarchy. The input XML must be valid for the type of object being created. In the case manifest implementation, an example is:
      BsoCaseManifest manifest = (BsoCaseManifest) binder.getRootObject();
      String xml = "<document-ordering ManifestID='1234'>" +
                       "<order-id>5678</order-id>" +
                       "<order-id>9ABC</order-id>" +
                   "</document-ordering>";
      BsoElement elem = binder.unmarshalElement(xml, BsoManifest.TYPE_DOCUMENT_ORDERING);
      manifest.setDocumentOrdering((BsoDocumentOrdering) elem);
 

Parameters:
xml - A String containing valid, well-formed XML for a particular upper-level element.

type - An integer representing the type of element. Valid values vary with the implementation. (Constants for the element type are defined in BsoManifest class.)

Returns:
The actual XML-based Java object, which must implement the BsoElement interface.

marshalElement

public java.lang.String marshalElement(BsoElement elem)
Returns the XML for an upper-level object.

Parameters:
elem - An upper-level XML-based Java object.

Returns:
A String containing the XML for the requested object.

getGuidsValid

public boolean getGuidsValid()
Returns whether the Content Engine GUIDs in the elements are valid or not. This method is used internally for consistency checks.

Returns:
True if valid and false if not.

setGuidsValid

public void setGuidsValid(boolean guidsValid)
Sets whether the Content Engine GUIDs in the elements are valid or not. This method is used internally for consistency checks.

Parameters:
guidsValid - True if valid and false if not.

getElements

public BsoElements getElements()
Returns an element manager that implements the BsoElements interface. This manager provides useful methods that return an iterator over the upper-level content elements and also allow you to get, set, add, and remove elements.

Returns:
An element manager.

See Also:
BsoElement, BsoElements

Collaboration API Documentation

Copyright ?2002 - 2005 FileNet Corporation. All rights reserved.