JHotDraw 7.5.1

org.jhotdraw.xml
Interface DOMFactory

All Known Implementing Classes:
DefaultDOMFactory, DrawFigureFactory, JavaPrimitivesDOMFactory, NetFactory, PertFactory

public interface DOMFactory

DOMFactory.


Design Patterns

Abstract Factory
DOMFactory is used by DOMInput and DOMOutput for creating Java objects and DOM elements. Abstract Factory: DOMFactory
Client: DOMInput, DOMOutput.

Strategy
DOMFactory is used by DOMInput and DOMOutput for reading and writing objects. Client: DOMInput, DOMOutput.
Strategy: DOMFactory.

Chain of Responsibility
DOMFactory can delegate reading and writing to objects which implement the DOMStorable interface. Client: DOMFactory.
Handler: DOMStorable.

Version:
$Id: DOMFactory.java 633 2010-01-22 12:07:20Z rawcoder $
Author:
Werner Randelshofer

Method Summary
 java.lang.Object create(java.lang.String name)
          Creates an object from the specified element name.
 java.lang.String getName(java.lang.Object o)
          Returns the element name for the specified object.
 java.lang.Object read(DOMInput in)
          Reads the specified object from DOMInput.
 void write(DOMOutput out, java.lang.Object object)
          Writes the specified object to DOMOutput.
 

Method Detail

getName

java.lang.String getName(java.lang.Object o)
Returns the element name for the specified object.


create

java.lang.Object create(java.lang.String name)
Creates an object from the specified element name.


write

void write(DOMOutput out,
           java.lang.Object object)
           throws java.io.IOException
Writes the specified object to DOMOutput.

This method is only ever called from DOMOutput. You should never call this method directly.

Parameters:
object - The object to be written.
Throws:
java.io.IOException

read

java.lang.Object read(DOMInput in)
                      throws java.io.IOException
Reads the specified object from DOMInput.

This method is only ever called from DOMInput. You should never call this method directly.

Parameters:
in - The DOMInput object which creates the object from an element in a DOM.
Throws:
java.io.IOException

Copyright 1996-2010 (c) by the authors and contributors of the JHotDraw project.
Some rights reserved.