|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.melati.template.AbstractMarkupLanguage
public abstract class AbstractMarkupLanguage
MarkupLanguage provides a variety of methods for rendering objects in a template. Each object to be rendered has 3 methods: 1 - String rendered(Object o) - this will render the object to a String 2 - void render(Object o) - renders the object to melati.getWriter() 3 - void render(Object o, MelatiWriter w) - render the object to w. When this class was written it was thought that for maximum efficiency one should render the object direct to the output stream using method (2) above. However now all but (1) is deprecated.
| Field Summary | |
|---|---|
static int |
FIELD_POSSIBILITIES_LIMIT
The maximum number of field possibilites to render. |
protected PoemLocale |
locale
|
protected Melati |
melati
|
protected TempletLoader |
templetLoader
|
| Constructor Summary | |
|---|---|
protected |
AbstractMarkupLanguage(java.lang.String name,
AbstractMarkupLanguage other)
Construct a new MarkupLanguage given a new name and an existing MarkupLanguage. |
|
AbstractMarkupLanguage(java.lang.String name,
Melati melati,
TempletLoader templetLoader,
PoemLocale locale)
Construct a Markup Language object. |
| Method Summary | |
|---|---|
protected void |
expandTemplet(Template templet,
TemplateContext tc,
MelatiWriter out)
Interpolate a templet and write it out. |
java.lang.String |
getName()
Get the name of this Markup Language. |
java.lang.String |
input(Field field)
Get an input widget for this Field. |
protected java.lang.String |
input(Field field,
java.lang.String templetName,
java.lang.String nullValue,
boolean overrideNullable)
|
java.lang.String |
inputAs(Field field,
java.lang.String templetName)
Get an input widget for this Field defined by name. |
protected void |
render(Field field,
int style,
int limit,
MelatiWriter writer)
Render a Field Object in a MarkupLanguage specific way, rendering to supplied MelatiWriter. |
protected void |
render(Field field,
MelatiWriter writer)
Render a Field Object in a MarkupLanguage specific way, rendering to supplied MelatiWriter. |
protected void |
render(java.lang.Object o)
Render an Object in a MarkupLanguage specific way, rendering to the MelatiWriter supplied by melati.getWriter(). |
protected void |
render(java.lang.Object o,
MelatiWriter writer)
Render an Object in a MarkupLanguage specific way, rendering to a supplied Writer. |
protected void |
render(java.lang.String s,
int limit,
MelatiWriter writer)
Render a String in a MarkupLanguage specific way, limiting it's length. |
protected abstract void |
render(java.lang.String s,
MelatiWriter writer)
Render a String in a MarkupLanguage specific way to a supplied MelatiWriter. |
java.lang.String |
rendered(Field field,
int style)
Render a Field Object in a MarkupLanguage specific way, returning a String. |
java.lang.String |
rendered(Field field,
int style,
int limit)
Render a Field Object in a MarkupLanguage specific way, returning a String. |
java.lang.String |
rendered(java.lang.Object o)
Render an Object in a MarkupLanguage specific way, returning a String. |
java.lang.String |
rendered(java.lang.String s,
int limit)
Render a String in a MarkupLanguage specific way, limiting it's length. |
java.lang.String |
renderedMarkup(java.lang.String s)
|
java.lang.String |
renderedStart(Field field)
Render a Date Field Object in a MarkupLanguage specific way, returning a START Date format String. |
protected abstract void |
renderMarkup(java.lang.String s,
MelatiWriter writer)
Render a markup fragment in a MarkupLanguage specific way to a supplied MelatiWriter. |
protected void |
renderStart(Field field,
MelatiWriter writer)
|
java.lang.String |
searchInput(Field field,
java.lang.String nullValue)
Get an input widget for this Field specifying the null value. |
java.lang.String |
toString()
Name and locale. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Methods inherited from interface org.melati.template.MarkupLanguage |
|---|
decoded, encoded, escaped, escaped, getAttr |
| Field Detail |
|---|
protected TempletLoader templetLoader
protected Melati melati
protected PoemLocale locale
public static final int FIELD_POSSIBILITIES_LIMIT
| Constructor Detail |
|---|
public AbstractMarkupLanguage(java.lang.String name,
Melati melati,
TempletLoader templetLoader,
PoemLocale locale)
name - - the name associated with this markup language.
This is used to determine where to load
templates from ie 'html' templates are
found in the 'html' directory.melati - - the melati currently in usetempletLoader - - the template loader in use
(taken from org.melati.MelatiConfig.properties)locale - - the locale in use
(taken from org.melati.MelatiConfig.properties)
protected AbstractMarkupLanguage(java.lang.String name,
AbstractMarkupLanguage other)
name - - the name of the new MarkupLanguageother - - the Markup Language to base this one upon| Method Detail |
|---|
public java.lang.String getName()
getName in interface MarkupLanguageMarkupLanguage.getName()public java.lang.String toString()
toString in class java.lang.ObjectObject.toString()
public java.lang.String rendered(java.lang.String s,
int limit)
throws java.io.IOException
rendered in interface MarkupLanguages - - the string to be renderedlimit - - the lenght to trim the string to
java.io.IOException - - if there is a problem during renderingMarkupLanguage.rendered(java.lang.String, int)
public java.lang.String rendered(Field field,
int style,
int limit)
throws TemplateEngineException,
java.io.IOException
rendered in interface MarkupLanguagefield - - the Field to be renderedstyle - - a DateFormat style to format this Field.limit - - the length to trim the rendered string to
TemplateEngineException - - if there is a problem with the
ServletTemplateEngine
java.io.IOException - - if there is a problem during renderingMarkupLanguage.rendered(org.melati.poem.Field, int, int)
public java.lang.String rendered(Field field,
int style)
throws TemplateEngineException,
java.io.IOException
rendered in interface MarkupLanguagefield - - the Field to be renderedstyle - - a style to format this Field.
TemplateEngineException - - if there is a problem with the
ServletTemplateEngine
java.io.IOException - - if there is a problem during renderingMarkupLanguage.rendered(org.melati.poem.Field, int)
public java.lang.String rendered(java.lang.Object o)
throws java.io.IOException
rendered in interface MarkupLanguageo - - the Object to be rendered
java.io.IOException - - if there is a problem during renderingMarkupLanguage.rendered(java.lang.Object)
public java.lang.String renderedMarkup(java.lang.String s)
throws java.io.IOException
renderedMarkup in interface MarkupLanguages - markup fragment to render
java.io.IOException - if there is a problem during renderingMarkupLanguage.renderedMarkup(java.lang.String)
protected void render(java.lang.String s,
int limit,
MelatiWriter writer)
throws java.io.IOException
s - - the string to be renderedwriter - - the MelatiWriter to render this String tolimit - - the lenght to trim the string to
java.io.IOException - - if there is a problem during rendering
protected abstract void render(java.lang.String s,
MelatiWriter writer)
throws java.io.IOException
s - - the string to be renderedwriter - - the MelatiWriter to render this String to
java.io.IOException - - if there is a problem during rendering
protected abstract void renderMarkup(java.lang.String s,
MelatiWriter writer)
throws java.io.IOException
s - - the fragment to be renderedwriter - - the MelatiWriter to render this String to
java.io.IOException - - if there is a problem during rendering
protected void render(Field field,
MelatiWriter writer)
throws java.io.IOException
field - - the Field to be renderedwriter - - the MelatiWriter to render this Object to
java.io.IOException - - if there is a problem during rendering
protected void render(Field field,
int style,
int limit,
MelatiWriter writer)
throws java.io.IOException
field - - the Field to be renderedstyle - - a style to format this Field.limit - - the length to trim the rendered string towriter - - the MelatiWriter to render this Object to
java.io.IOException - - if there is a problem during rendering(java.lang.Object,org.melati.poem.PoemLocale, int)
public java.lang.String renderedStart(Field field)
throws java.io.IOException
renderedStart in interface MarkupLanguagefield - - the Field to be rendered
java.io.IOException - - if there is a problem during renderingMarkupLanguage.renderedStart(org.melati.poem.Field)
protected void renderStart(Field field,
MelatiWriter writer)
throws java.io.IOException
java.io.IOException
protected void render(java.lang.Object o)
throws java.io.IOException
MelatiWriter supplied by melati.getWriter().
o - - the Object to be rendered
java.io.IOException - - if there is a problem during rendering
TemplateEngineException - - if there is a problem with the
ServletTemplateEngine
protected void render(java.lang.Object o,
MelatiWriter writer)
throws java.io.IOException
o - - the Object to be renderedwriter - - the MelatiWriter to render this Object to
java.io.IOException
public java.lang.String input(Field field)
throws TemplateEngineException,
java.io.IOException,
NotFoundException
input in interface MarkupLanguagefield - The Field
NotFoundException - if template not found
TemplateEngineException
java.io.IOExceptionMarkupLanguage.input(org.melati.poem.Field)
public java.lang.String inputAs(Field field,
java.lang.String templetName)
throws TemplateEngineException,
java.io.IOException,
NotFoundException
inputAs in interface MarkupLanguagefield - The FieldtempletName - the templet to use instead of the default
NotFoundException - if template not found
TemplateEngineException
java.io.IOExceptionMarkupLanguage.inputAs(org.melati.poem.Field, java.lang.String)
public java.lang.String searchInput(Field field,
java.lang.String nullValue)
throws TemplateEngineException,
java.io.IOException,
NotFoundException
searchInput in interface MarkupLanguagefield - The FieldnullValue - the value to use for null for example in a dropdown.
NotFoundException - if template not found
TemplateEngineException
java.io.IOExceptionMarkupLanguage.searchInput(org.melati.poem.Field, java.lang.String)
protected java.lang.String input(Field field,
java.lang.String templetName,
java.lang.String nullValue,
boolean overrideNullable)
throws java.io.IOException,
NotFoundException
java.io.IOException
NotFoundException
protected void expandTemplet(Template templet,
TemplateContext tc,
MelatiWriter out)
throws java.io.IOException
templet - Template to interpolatetc - TemplateContext against which to instantiate variablesout - MelatiWriter to write results to
TemplateEngineException - if something unexpected happens
java.io.IOException
|
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||