|
||||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||||
java.lang.Object | +--org.sapia.gumby.RenderContext
An instance of this class holds tag definitions (in object form) and its own
environment. It can be created through a RenderContextFactory or
as a child of another instance of this class.
If it is created as a child of another context, it inherits the tag definitions and the environment of that context.
Instances of this class can be shared between multiple threads.
GuiEnv,
RenderContextFactory,
newChildInstance()| Method Summary | |
|---|---|
View |
createView(String scope)
Internally creates a view, maps as a scope under the given name, and returns it. |
GuiEnv |
getEnv()
Returns the global environment object that this instance holds. |
Settings |
getSettings()
|
void |
loadDefinitions(InputStream is)
Loads the definitions corresponding to the givens stream within this context. |
RenderContext |
newChildInstance()
This method returns a context that is a "child" of this instance: the child's environment will inherit its parent's. |
Object |
render(File xmlDesc)
|
Object |
render(InputStream xmlDesc)
|
void |
render(Object parent,
File xmlDesc)
|
void |
render(Object parent,
InputStream xmlDesc)
|
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Method Detail |
public GuiEnv getEnv()
GuiEnv instance.public Settings getSettings()
Settings that this instance holds.public RenderContext newChildInstance()
Similarly, all tags defined as part of the child will be visible only from the child downwards - if contexts are also created from the child and so on.
Creating different contexts with this method allows inheriting from the parent's environment and separating different instances when usage dictates it (for example, in a multithreaded context).
This is especially usefull when used in conjunction with views: the views can be created in isolation from one another, without risking naming conflicts and other side effects.
RenderContext.Viewpublic View createView(String scope)
Calling this method as the same effect as the following code:
View v = new View(context);
context.getEnv().addScope("someScope", v);
scope - the name of a scope.
View.
public Object render(InputStream xmlDesc)
throws Exception
xmlDesc - the InputStream corresponding to an
XML descriptor.
Object.
Exception - if a problem occurs while rendering.
public void render(Object parent,
InputStream xmlDesc)
throws Exception
parent - Object that is intented to be the parent of the
rendered root objects.xmlDesc - the InputStream corresponding to an
XML descriptor.
Exception - if a problem occurs while rendering.
public Object render(File xmlDesc)
throws Exception
Exceptionrender(InputStream)
public void render(Object parent,
File xmlDesc)
throws Exception
Exceptionrender(Object, InputStream)
public void loadDefinitions(InputStream is)
throws Exception
is - an InputStream corresponding to XML object definitions.
Exception - if a problem occurs while loading the definitions.
|
||||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||||