|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.jhotdraw.contrib.html.ContentProducerRegistry
public class ContentProducerRegistry
ContentProducerRegistry acts as a repository for ContentProducers. It allows
for registries to be organized in a hierarchy, so that a specific producer
request will travel upwards in the hierarchy until eventually a suitable
producer is found.
Producers are registered associated with the class of the object they are suitable
to produce contents for, but ContentProducerRegistry allows for class hierarchy
searches. What this means is that for two classes A and B, B being a subclass
of A, if a producer is registered for class B it will be used, otherwise the
producer registered for class A will be used instead. ContentProducerRegistry will
always select the super class closest in the class hierarchy, so if several
producers are registered for classes in a derivation hierarchy, the producer
registered for the class closest to the requested class will be selected.
Constructor Summary | |
---|---|
ContentProducerRegistry()
Constructor for the ContentProducerRegistry object |
|
ContentProducerRegistry(ContentProducerRegistry parent)
Constructor for the ContentProducerRegistry object |
Method Summary | |
---|---|
ContentProducer |
getContentProducer(java.lang.Class targetClass)
Finds the most appropriate producer for the target class. |
static ContentProducer |
getDefaultContentProducer(java.lang.Class targetClass)
Gets the ContentProducer attribute of the HTMLTextAreaFigure object |
ContentProducer |
getExactContentProducer(java.lang.Class targetClass)
Finds the exact producer for the target class, ie: no class hierarchy search |
static ContentProducer |
getExactDefaultContentProducer(java.lang.Class targetClass)
Gets the exact application global Producer for the target class, ie: no class hierarchy search |
ContentProducerRegistry |
getParent()
Gets the parent attribute of the ContentProducerRegistry object |
boolean |
isAutonomous()
Gets the autonomous status of the ContentProducerRegistry object |
void |
read(StorableInput dr)
Storable inoput support |
ContentProducer |
registerContentProducer(java.lang.Class targetClass,
ContentProducer producer)
Registers a producer |
static ContentProducer |
registerDefaultContentProducer(java.lang.Class targetClass,
ContentProducer producer)
Registers an application global producer |
void |
setAutonomous()
Sets the autonomous attribute of the ContentProducerRegistry object. |
void |
setParent(ContentProducerRegistry newParent)
Sets the parent attribute of the ContentProducerRegistry object |
void |
unregisterContentProducer(java.lang.Class targetClass,
ContentProducer producer)
Unregisters a producer |
static void |
unregisterDefaultContentProducer(java.lang.Class targetClass,
ContentProducer producer)
Unregisters ie: removes a registered producer for a target class. |
void |
write(StorableOutput dw)
Storable write support |
Methods inherited from class java.lang.Object |
---|
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public ContentProducerRegistry()
public ContentProducerRegistry(ContentProducerRegistry parent)
parent
- the parent for this producerMethod Detail |
---|
public void setAutonomous()
setParent(ContentProducerRegistry)
public boolean isAutonomous()
public void setParent(ContentProducerRegistry newParent)
newParent
- The new parent valuesetAutonomous()
public ContentProducerRegistry getParent()
public static ContentProducer registerDefaultContentProducer(java.lang.Class targetClass, ContentProducer producer)
producer
- the registered producertargetClass
- The class associated with the producer
public static void unregisterDefaultContentProducer(java.lang.Class targetClass, ContentProducer producer)
producer
- the producer to unregistertargetClass
- the target classpublic static ContentProducer getDefaultContentProducer(java.lang.Class targetClass)
targetClass
- the target class
public static ContentProducer getExactDefaultContentProducer(java.lang.Class targetClass)
targetClass
- the target class
public ContentProducer registerContentProducer(java.lang.Class targetClass, ContentProducer producer)
producer
- the producer to registertargetClass
- the target class
public void unregisterContentProducer(java.lang.Class targetClass, ContentProducer producer)
producer
- the producer to unregistertargetClass
- the target classpublic ContentProducer getContentProducer(java.lang.Class targetClass)
targetClass
- The target class
public ContentProducer getExactContentProducer(java.lang.Class targetClass)
targetClass
- The target class
public void write(StorableOutput dw)
write
in interface Storable
dw
- the storable outputpublic void read(StorableInput dr) throws java.io.IOException
read
in interface Storable
dr
- storable input
java.io.IOException
- thrown by called methods
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |