|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.inria.ns.reflex.processor.catalog.Builder
public abstract class Builder
A Builder uses an input to deliver an instance of the object
that the input represents. A single builder is not intended to deliver
several instances each time the getInstance() method is
invoked. However, XMLBuilder
seems to waive this principle, because it can deliver either a SAX event
producer or a DOM tree ; in fact, both represent the same
data model, giving just different APIs ; so the instance delivered
is effectively "the same" in a higher point of view.
To deliver an instance, the following steps are performed :
If an instance of the object can be delivered, next requests should deliver it quickly.
This class is used to provide instances of huge objects stored in a file or in a data base ; for example, EXP modules, catalogs, and schemata are usually backed by a builder. The input is usually a file name, or an URI...
This builder can act as a wrapper if a ready-to-use object is available.
To do so, concrete implementations of this class must fill the protected member #object that will be directly delivered.
| Constructor Summary | |
|---|---|
Builder(Object name,
Object input)
Create a builder from an input. |
|
| Method Summary | |
|---|---|
boolean |
equals(Object obj)
|
Object |
getInstance()
Return an instance that is represented by the input. |
int |
hashCode()
|
| Methods inherited from class java.lang.Object |
|---|
getClass, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public Builder(Object name,
Object input)
If a string is given as input, it may be in the following format : "res:org.acme.MyCatalog".
name - The name of the object.input - The input that will be used to build the instance.| Method Detail |
|---|
public boolean equals(Object obj)
equals in class ObjectObject.equals(java.lang.Object)public int hashCode()
hashCode in class ObjectObject.hashCode()
public Object getInstance()
throws Exception
Once an instance is resolved, this builder always delivers it, except if the reference is a class name (a new instance will be created).
Exception - When the input can't be used to build a new instance.
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||