Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS FRAMES NO FRAMES All Classes
SUMMARY: NESTED | FIELD | CONSTR | METHOD DETAIL: FIELD | CONSTR | METHOD

diva.util.xml
Interface XmlBuilder

All Known Implementing Classes:
AbstractXmlBuilder

public interface XmlBuilder

An XmlBuilder is an interface that can be implemented by classes that convert between XmlElements and some internal data representation. The main reason for doing so is to allow other builders to "reuse" parts of an XML DTD. For example, we could have a builder that builds Java2D objects, such as "line" and "polygon". Then some other builder, that for example builds libraries of graphical icons, can use an instance of the Java2D builder internally -- if it does not recognize the type of an XML element, it calls the Java2D builder to see if it can get a low-level graphical object.

Version:
$Id: XmlBuilder.java,v 1.11 2005年07月08日 19:55:20 cxh Exp $
Author:
John Reekie
Accepted Rating:
Red

Method Summary
java.lang.Object build(XmlElement elt, java.lang.String type)
Given an XmlElement, create and return an internal representation of it.
XmlElement generate(java.lang.Object obj)
Given an object, produce an XML representation of it.
void setDelegate(XmlBuilder child)
Delegate builders can be used to build/generate for objects that are unknown by the current builder, as might be the case in a hierarchy of heterogeneous objects.

Method Detail

build

public java.lang.Object build(XmlElement elt,
 java.lang.String type)
 throws java.lang.Exception
Given an XmlElement, create and return an internal representation of it. Implementors should also provide a more type-specific version of this method:
 public Graph build (XmlELement elt, String type);
 

Throws:
java.lang.Exception

setDelegate

public void setDelegate(XmlBuilder child)
Delegate builders can be used to build/generate for objects that are unknown by the current builder, as might be the case in a hierarchy of heterogeneous objects.

See Also:
CompositeBuilder

generate

public XmlElement generate(java.lang.Object obj)
 throws java.lang.Exception
Given an object, produce an XML representation of it.

Throws:
java.lang.Exception

Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS FRAMES NO FRAMES All Classes
SUMMARY: NESTED | FIELD | CONSTR | METHOD DETAIL: FIELD | CONSTR | METHOD

AltStyle によって変換されたページ (->オリジナル) /