|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.progeeks.meta.xml.XmlRenderContext
public class XmlRenderContext
Contains the session specific information during a single rendering engine write call, including the XmlPrintWriter, a reference to the engine, an object cache, etc..
Constructor Summary | |
---|---|
XmlRenderContext(XmlRenderingEngine engine,
XmlPrintWriter out,
MetaKit metaKit)
|
Method Summary | |
---|---|
MetaObject |
createMetaObjectWrapper(java.lang.Object obj)
Auto-wraps the specified object if possible or just returns null if not. |
XmlRenderingEngine |
getEngine()
Returns the engine from which this context is operating. |
MetaForm |
getMetaForm(MetaClass type,
MetaFormFlavor flavor)
Returns the MetaForm for the specified meta-class and flavor. |
MetaKit |
getMetaKit()
Returns the meta-kit to use when auto-resolving regular objects to meta-objects for rendering. |
java.lang.String |
getObjectId(java.lang.Object object)
Returns the ID for the specified object if it has been stored in the object cache or null if it hasn't. |
XmlPropertyRenderer |
getRenderer(PropertyType type,
java.lang.Object value)
Deprecated. Use the getRendererProxy() method instead. |
RendererProxy |
getRendererProxy(PropertyType type,
java.lang.Object value)
Delegates to the rendering engine to retrieve a renderer for the specified type and object. |
XmlPrintWriter |
getWriter()
Returns the XmlPrintWriter to which renderers should be writing. |
java.lang.String |
registerObject(java.lang.Object object)
Registers the specified object with the object cache using a generated ID. |
void |
registerObject(java.lang.String id,
java.lang.Object object)
Registers the specified object with the object cache using the specified ID. |
void |
renderMetaObject(MetaObject obj,
boolean registerObject)
Looks up the appropriate renderers and generates XML output for the specified meta-object using this context's internal settings. |
void |
renderObject(java.lang.Object obj,
boolean forceWrap,
boolean registerObject)
Renders the specified object to XML using some heuristics based on type, the current meta-kit, registered meta-classes, etc. to attempt to find the best renderer using this context's internal settings. |
void |
renderTypedObject(java.lang.Object obj,
PropertyType type,
boolean forceWrap,
boolean registerObject)
Looks up the appropriate renderers and generates XML output for the specified object using a renderer associated with the specified PropertyType using this context's internal settings. |
java.lang.String |
transformClassName(java.lang.String name)
Performs any necessary transformations on the specified class name and then returns it. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public XmlRenderContext(XmlRenderingEngine engine, XmlPrintWriter out, MetaKit metaKit)
Method Detail |
---|
public XmlRenderingEngine getEngine()
public XmlPrintWriter getWriter()
public MetaKit getMetaKit()
public MetaForm getMetaForm(MetaClass type, MetaFormFlavor flavor)
public java.lang.String transformClassName(java.lang.String name)
public MetaObject createMetaObjectWrapper(java.lang.Object obj)
public XmlPropertyRenderer getRenderer(PropertyType type, java.lang.Object value)
public RendererProxy getRendererProxy(PropertyType type, java.lang.Object value)
public void renderMetaObject(MetaObject obj, boolean registerObject)
obj
- The meta-object to render.registerObject
- Set to true if the object should be added to the
registry and the appropriate xml.oid attribute emitted.
The object will only be registered if it is not already
in the registry.public void renderTypedObject(java.lang.Object obj, PropertyType type, boolean forceWrap, boolean registerObject)
obj
- The object to render.type
- The type of the object used for renderer lookups.forceWrap
- Set to true if the renderer should wrap the value in
its own style of start/end tags. False indicates that
the renderer can optionally leave them out. This is usually
used by renderers that support types that can be defined
as strings directly.registerObject
- Set to true if the object should be added to the
registry and the appropriate xml.oid attribute emitted.
The object will only be registered if it is not already
in the registry.public void renderObject(java.lang.Object obj, boolean forceWrap, boolean registerObject)
obj
- The object to render.forceWrap
- Set to true if the renderer should wrap the value in
its own style of start/end tags. False indicates that
the renderer can optionally leave them out. This is usually
used by renderers that support types that can be defined
as strings directly.registerObject
- Set to true if the object should be added to the
registry and the appropriate xml.oid attribute emitted.
The object will only be registered if it is not already
in the registry.public void registerObject(java.lang.String id, java.lang.Object object)
public java.lang.String registerObject(java.lang.Object object)
public java.lang.String getObjectId(java.lang.Object object)
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |