Demo Documentation
8/18/08 6:25 PM
Package net.sf.jolene.constants
Global constants used by Jolene.
See:
-
Class Summary |
Entities |
Simple defines of common HTML entities. |
Prefs |
Defined preferences for jolene.properties file. |
Enum Summary |
Elements |
Supported parsable HTML elements. |
StyleClasses |
Style definitions used bu Jolene. |
Tags |
Supported HTML tags. |
Package net.sf.jolene.constants Description
Global constants used by Jolene.
Enum Elements
java.lang.Object
net.sf.jolene.constants.Elements All Implemented Interfaces:
-
public enum Elements
Supported parsable HTML elements.
Author:
-
Dan Howard
Since:
-
Mar 4, 2006 7:07:58 AM
Enum Constant Detail
input
button
grid
image
label
select
textarea
checkbox
radio
text
Method Detail
values
valueOf
public static Elements valueOf(String name) Class Entities
java.lang.Object
net.sf.jolene.constants.Entities
public class Entities
extends Object
Simple defines of common HTML entities.
Author:
-
Dan Howard
Since:
-
Jun 16, 2008 6:28:58 AM
Field Detail
space
public static final String space
quote
public static final String quote
ampersand
public static final String ampersand
lessthan
public static final String lessthan
greaterthan
public static final String greaterthan
Class Prefs
java.lang.Object
net.sf.jolene.constants.Prefs
public class Prefs
extends Object
Defined preferences for jolene.properties file. TODO maybe conver to Enum.
Author:
-
Dan Howard
Since:
-
Dec 31, 2005 10:40 PM
Field Detail
DocumentCaching
public static final Prefs DocumentCaching -
Default: true. Indicates whether or not document cacheing is enabled. Cached documents
are read once when requested and copies are returned from the DocumentFactory. If cacheing
is disabled then documents are read and parsed whenever they are requested.
See Also:
-
CacheSize
public static final Prefs CacheSize -
Default: 32. The initial size of the internal maps used to store documents.
See Also:
-
XHTMLStrict
public static final Prefs XHTMLStrict -
Default false. Indicates whether or not the streaming engine and the string utilities should
output in XHTML or HTML format. It does not affect the parser.
SelectValueSeperator
public static final Prefs SelectValueSeperator -
Default comma (,). Used by Multi-Select objects when setting or getting option values.
StreamLabelTags
public static final Prefs StreamLabelTags -
Default true. Indicates whether Label objects should stream back their label tags. You
might want to set this to false if you intend to use Labels to stream back arbitrary
HTML or JavaScript. In these cases you could also use the Text object.
See Also:
-
GenerateLocaleStrings
public static final Prefs GenerateLocaleStrings -
When set to true /resources/application.properites file is updated based on the template labels.
Method Detail
toString
public String toString()
-
Overrides:
-
toString in class Object
getValue
public String getValue()
setValue
public void setValue(Object value)
valueOf
public static Prefs valueOf(String name) Enum StyleClasses
java.lang.Object
net.sf.jolene.constants.StyleClasses All Implemented Interfaces:
-
public enum StyleClasses
Style definitions used bu Jolene.
Author:
-
: Dan Howard
Since:
-
: Aug 7, 2006 8:47:17 AM
Enum Constant Detail
Grid
OddRow
EvenRow
Method Detail
values
valueOf
Enum Tags
java.lang.Object
java.lang.Enum<Tags>
net.sf.jolene.constants.Tags All Implemented Interfaces:
-
Comparable<Tags>, Serializable
public enum Tags
Supported HTML tags.
Author:
-
: Dan Howard
Since:
-
: Oct 12, 2005 5:08:17 AM
Enum Constant Detail
input
public static final Tags input
button
public static final Tags button
form
public static final Tags form
table
public static final Tags table
img
public static final Tags img
label
public static final Tags label
select
public static final Tags select
textarea
public static final Tags textarea
tr
public static final Tags tr
td
public static final Tags td
th
public static final Tags th
option
public static final Tags option
meta
public static final Tags meta
script
public static final Tags script
link
public static final Tags link
style
public static final Tags style Method Detail
values
public static final Tags[] values()
valueOf
public static Tags valueOf(String name) Package net.sf.jolene.data
Class Summary |
DataBinder |
Not currently used - or required. |
Class DataBinder
java.lang.Object
net.sf.jolene.data.DataBinder
public class DataBinder
extends Object
Not currently used - or required.
Author:
-
: Dan Howard
Since:
-
: Aug 4, 2005 06:01 AM
Constructor Detail
DataBinder
public DataBinder()
Package net.sf.jolene.dom
HTML DOM objects.
See:
-
Class Summary |
Button |
A button in a html document using the button - not the input tag. |
CheckBox |
A checkbox in a html document. |
Document |
HTML Document object. |
Form |
A form in a html document. |
Grid |
A renderable data bound grid object. |
GridColumn |
A grid column object. |
Header |
An element in the header in a html document. |
HTMLElement |
Base class for all html elements. |
Image |
An image in a html document. |
Input |
An input field in a html document. |
Label |
A lable in an html document. |
Option |
A select option object. |
OptionGroup |
Not currently supported. |
Radio |
A radio button in an html document. |
Select |
A Select in an html document. |
Text |
This represents arbitrary text to be rendered in an html document. |
TextArea |
A TextArea in a html document. |
Package net.sf.jolene.dom Description
HTML DOM objects.
Class Button
java.lang.Object
net.sf.jolene.dom.Button All Implemented Interfaces:
-
final public class Button
A button in a html document using the button - not the input tag.
Author:
-
Dan Howard
Since:
-
Nov 16, 2003
Constructor Summary |
Button() Default constructor. |
Button(String name) Construct a button with the specified name. |
Method Summary |
|
clone() Returns a clone of the button object. |
void |
setName(String name) Sets the name of the button. |
void |
setValue(String value) Sets the value of the button. |
String |
toString() Renders the button. |
Methods inherited from class net.sf.jolene.dom.HTMLElement |
clear, getAfterText, getAttribute, getBeforeText, getContent, getName, getStyle, getTag, getValue, hasAttribute, hasStyle, hide, isChecked, isDisabled, isHidden, isReadonly, keySet, removeAttribute, removeStyle, resetStyles, setAfterText, setAttribute, setBeforeText, setChecked, setContent, setDisabled, setReadonly, setStyle, setStyles, swapWith, values |
Constructor Detail
Button
public Button()
-
Default constructor.
Button
public Button(String name)
-
Construct a button with the specified name.
Parameters:
-
name - name of the button.
Method Detail
setName
public void setName(String name)
-
Sets the name of the button.
Overrides:
-
Parameters:
-
name - name of the button.
setValue
public void setValue(String value)
-
Sets the value of the button.
Overrides:
-
Parameters:
-
value - value of the button.
toString
public String toString()
-
Renders the button.
Overrides:
-
Returns:
-
The button as a html string.
clone
-
Returns a clone of the button object.
Overrides:
-
Returns:
-
Button object.
See Also:
-
Class CheckBox
java.lang.Object
net.sf.jolene.dom.CheckBox All Implemented Interfaces:
-
final public class CheckBox
A checkbox in a html document.
Author:
-
Dan Howard
Since:
-
Oct 14, 2005 6:18:36 AM
Constructor Summary |
CheckBox() Default constructor. |
CheckBox(String name) Construct a checkbox with the specified name. |
Method Summary |
|
clone() Returns a clone of the checkbox object. |
void |
setName(String name) Sets the name of the checkbox. |
void |
setValue(String value) Sets the value of the checbox. |
Methods inherited from class net.sf.jolene.dom.HTMLElement |
clear, getAfterText, getAttribute, getBeforeText, getContent, getName, getStyle, getTag, getValue, hasAttribute, hasStyle, hide, isChecked, isDisabled, isHidden, isReadonly, keySet, removeAttribute, removeStyle, resetStyles, setAfterText, setAttribute, setBeforeText, setChecked, setContent, setDisabled, setReadonly, setStyle, setStyles, swapWith, toString, values |
Constructor Detail
CheckBox
public CheckBox()
-
Default constructor.
CheckBox
public CheckBox(String name)
-
Construct a checkbox with the specified name.
Parameters:
-
name - name of the checkbox.
Method Detail
setName
public void setName(String name)
-
Sets the name of the checkbox.
Overrides:
-
Parameters:
-
name - name of the checkbox.
clone
-
Returns a clone of the checkbox object.
Overrides:
-
Returns:
-
CheckBox object.
See Also:
-
setValue
public void setValue(String value)
-
Sets the value of the checbox. See setChecked to indicate it has been checked.
Overrides:
-
Parameters:
-
value - value of the checkbox.
-
See Also:
-
Class Document
java.lang.Object
net.sf.jolene.dom.Document
final public class Document
extends Object
HTML Document object.
Author:
-
Dan Howard
Since:
-
Sep 21, 2003 5:22:33 PM
Constructor Summary |
Document(String fileName) |
Document(String fileName, String contextPath, String uri) |
Method Summary |
|
clone() This is a custom clone implementation which ensures the document
is cleanly and safely cloned. |
int |
formCount() |
|
forms(int form) Returns the form object specified by the number. |
String |
getDoctype() Gets the doc type of the document. |
|
getElementById(String id) Returns a object by searching all forms in the document. |
|
getHeader() |
String |
getTitle() Gets the document title. |
String |
getUri() |
boolean |
isTranslated() Indicator for labels being translated. |
void |
setDoctype(String doctype) Sets the doc type of the document. |
void |
setTitle(String string) Set the document title. |
void |
setTranslated(boolean translated) Indicator for labels being translated. |
void |
stream(Writer out) Writes the document to the specified Writer object and closes the Writer. |
void |
stream(String filename) Writes the document to the specified fileName. |
String |
toString() Returns the document file name. |
Constructor Detail
Document
-
Parameters:
-
fileName - - file name of the document.
Throws:
-
IOException - - if an IOException occurs
-
Document
-
Throws:
-
IOException
-
Method Detail
forms
public Form forms(int form) -
Returns the form object specified by the number.
Parameters:
-
form - form number (starting with 0)
Returns:
-
Form a Form object
formCount
public int formCount()
-
Returns:
-
Number of forms in the document.
stream
public void stream(String filename)
throws IOException
-
Writes the document to the specified fileName.
Parameters:
-
filename - The filename to write to.
-
Throws:
-
IOException - if there's an IOException
stream
public void stream(Writer out)
throws IOException
-
Writes the document to the specified Writer object and closes the Writer.
Parameters:
-
out - an output Writer to write to.
-
Throws:
-
IOException - it there's an IOException
getTitle
public String getTitle()
-
Gets the document title.
Returns:
-
title
setTitle
public void setTitle(String string)
-
Set the document title.
Parameters:
-
string - The document title.
getDoctype
public String getDoctype()
-
Gets the doc type of the document.
Returns:
-
String
setDoctype
public void setDoctype(String doctype)
-
Sets the doc type of the document.
Parameters:
-
doctype - The HTML doctype string.
toString
public String toString()
-
Returns the document file name.
Overrides:
-
toString in class Object
Returns:
-
String
getElementById
-
Returns a object by searching all forms in the document.
Parameters:
-
id - The id of the element.
Returns:
-
HTMLElement
clone
-
This is a custom clone implementation which ensures the document
is cleanly and safely cloned. Used by the DocumentFactory.
Overrides:
-
clone in class Object
Returns:
-
Document
isTranslated
public boolean isTranslated()
-
Indicator for labels being translated. We do not do the translations here.
We expect that the translation is done at the application level. This can
therefore be used to decide if the document is already translated (so you
don't need to do it over again.
see net.sf.jolene.struts.DomletAction for the struts implementation Returns:
-
true if this document is translated
setTranslated
public void setTranslated(boolean translated)
-
Indicator for labels being translated. We do not do the translations here.
We expect that the translation is done at the application level. This can
therefore be used to decide if the document is already translated (so you
don't need to do it over again.
see net.sf.jolene.struts.DomletAction for the struts implementation
Parameters:
-
translated - set to true if the doc has been translated.
getUri
public String getUri()
-
Returns:
-
uri string for this document.
getHeader
public List<Header> getHeader() -
Returns:
-
List of Header objects on the document.
Class Form
java.lang.Object
net.sf.jolene.dom.Form All Implemented Interfaces:
-
final public class Form
A form in a html document. This acts as a container for other html objects.
Author:
-
Dan Howard
Since:
-
Oct 21, 2003
Constructor Summary |
Form() |
Method Summary |
|
clone() Core clone implementation. |
int |
elementCount() |
|
elements(int element) This method returns the widget specified by the numeric index. |
|
elements(String elementName) todo maybe we should look for NAME first?
This method retrieves an object from the document by name or id. |
|
getGrid(String name) Returns the specified element casted to a Grid object. |
|
getRadioGroup(String name) Returns a Map of Radio objects based the specified radio group name. |
|
getSelect(String name) Returns the specified element casted to a Select object. |
boolean |
hasElement(String element) Checks if the specified object exists in the form. |
void |
populate(Object bean) Poplates the form objects based on the supplied java bean. |
void |
populate(Map map) Populates the form object from the supplied map object. |
Methods inherited from class net.sf.jolene.dom.HTMLElement |
clear, getAfterText, getAttribute, getBeforeText, getContent, getName, getStyle, getTag, getValue, hasAttribute, hasStyle, hide, isChecked, isDisabled, isHidden, isReadonly, keySet, removeAttribute, removeStyle, resetStyles, setAfterText, setAttribute, setBeforeText, setChecked, setContent, setDisabled, setName, setReadonly, setStyle, setStyles, setValue, swapWith, toString, values |
Constructor Detail
Form
public Form()
Method Detail
elements
-
This method returns the widget specified by the numeric index.
The prefered way of retrieving an object from the form is to
use it's name or id instead since the order of the objects can be
changed easily by a page designer.
Parameters:
-
element - - The integer element number of the object desired.
Returns:
-
HTMLElement
elements
-
todo maybe we should look for NAME first?
This method retrieves an object from the document by name or id.
When the document is opened it creates objects by looking at the ID
attribute first. If that attribute doesn't exist it uses the NAME
attribute. If neither exist then the only way to address these
objects is by number (not recommended).
This method returns the base HTMLElement object so if you want a Select or
Grid object you can either cast it:
Grid grid grid = (Grid)document.forms(0).elements("Grid1");
or use the appropriate getter:
Grid grid = document.forms(0).getGrid("Grid1");
Parameters:
-
elementName - - The string name or id of the object desired.
Returns:
-
HTMLElement
elementCount
public int elementCount()
-
Returns:
-
Number of elements in the form.
hasElement
public boolean hasElement(String element)
-
Checks if the specified object exists in the form.
Parameters:
-
element - name to check
Returns:
-
boolean
getSelect
public Select getSelect(String name) -
Returns the specified element casted to a Select object.
Parameters:
-
name - name of select
Returns:
-
Select
getGrid
public Grid getGrid(String name) -
Returns the specified element casted to a Grid object.
Parameters:
-
name - name of grid
Returns:
-
Grid
populate
public void populate(Object bean)
-
Poplates the form objects based on the supplied java bean.
Parameters:
-
bean - - any object which can be examined by BeanUtils
populate
public void populate(Map map)
-
Populates the form object from the supplied map object.
It's possible that this map is a parameter map from the request.
In that case the objects in the map are arrays of strings and
we'd be looking for the first element in that array.
(TODO not used or tested yet)
Parameters:
-
map - - name/values where names match element names
getRadioGroup
public Map<String,HTMLElement> getRadioGroup(String name) -
Returns a Map of Radio objects based the specified radio group name.
The map's order is insertion-order.
Parameters:
-
name - of radios
Returns:
-
Map
clone
-
Core clone implementation. Safely clones HTMLElement objects. Used by the DocumentFactory.
Overrides:
-
Returns:
-
HTMLElement
See Also:
-
Class Grid
java.lang.Object
net.sf.jolene.dom.Grid All Implemented Interfaces:
-
final public class Grid
A renderable data bound grid object. A grid is detected by the parser by having a table using an ID tag
that starts with 'grid'. The grid object can be accessed in the document just like any other object.
See the bind method to see how to 'datalink' the grid to a list of data objects.
Author:
-
Dan Howard
Since:
-
Aug 1, 2005 5:54:59 PM
Constructor Summary |
Grid() Default constructor. |
Method Summary |
void |
bind(List<GridColumn> header, List<String> fields, List data) Binds the grid object to the specified data. |
|
clone() Returns a clone of the grid object. |
String |
toString() Renders the grid. |
Methods inherited from class net.sf.jolene.dom.HTMLElement |
clear, getAfterText, getAttribute, getBeforeText, getContent, getName, getStyle, getTag, getValue, hasAttribute, hasStyle, hide, isChecked, isDisabled, isHidden, isReadonly, keySet, removeAttribute, removeStyle, resetStyles, setAfterText, setAttribute, setBeforeText, setChecked, setContent, setDisabled, setName, setReadonly, setStyle, setStyles, setValue, swapWith, values |
Constructor Detail
Grid
public Grid()
-
Default constructor.
Method Detail
toString
public String toString()
-
Renders the grid.
Overrides:
-
Returns:
-
Grid as html string.
bind
public void bind(List<GridColumn> header, List<String> fields, List data) throws NoSuchMethodException, IllegalAccessException, InvocationTargetException -
Binds the grid object to the specified data.
Parameters:
-
header - List of GridColumn objects defining the column information for the grid
-
fields - List of fields (property names) which are accessed via PropertyUtils to set the values for each cell
-
data - List of data objects used to retrieve the values
-
Throws:
-
NoSuchMethodException - from PropertyUtils
-
IllegalAccessException - from PropertyUtils
-
InvocationTargetException - from PropertyUtils
clone
-
Returns a clone of the grid object.
Overrides:
-
Returns:
-
Grid object.
See Also:
-
Class GridColumn
java.lang.Object
net.sf.jolene.dom.GridColumn
final public class GridColumn
extends Object
A grid column object. This is used to define the columns that the grid will display. The columns define the
header text, width, align and cell object. The cell object can be any of the HTMLElement objects. Cell objects
render the object in the grid cell instead of just text. Commonly this would be used to display checkboxes in
the grid.
Author:
-
Dan Howard
Since:
-
Oct 11, 2005 Time: 6:51:04 PM
Constructor Summary |
GridColumn() Default constructor. |
GridColumn(String header, String width) Constructs a GridColumn using a header string and a width string. |
Method Summary |
String |
getAlign() Return the align for the column. |
|
getCellObject() Gets the CellObject for the column. |
String |
getHeader() Returns the column header string. |
String |
getWidth() Returns the column width. |
void |
setAlign(String align) Sets the column align. |
void |
setCellObject(HTMLElement cellObject) Sets the CellObject for the column. |
void |
setHeader(String header) Sets the column header. |
void |
setWidth(String width) Sets the column width. |
Constructor Detail
GridColumn
public GridColumn()
-
Default constructor.
GridColumn
public GridColumn(String header,
String width)
-
Constructs a GridColumn using a header string and a width string.
Parameters:
-
header - header string for the column.
-
width - width of the column.
Method Detail
getWidth
public String getWidth()
-
Returns the column width.
Returns:
-
Width of the column.
setWidth
public void setWidth(String width)
-
Sets the column width.
Parameters:
-
width - Width of the column.
getHeader
public String getHeader()
-
Returns the column header string.
Returns:
-
Header of the column.
setHeader
public void setHeader(String header)
-
Sets the column header.
Parameters:
-
header - Header of the column.
getAlign
public String getAlign()
-
Return the align for the column.
Returns:
-
Alignment of the column.
setAlign
public void setAlign(String align)
-
Sets the column align.
Parameters:
-
align - Alignment of the column.
getCellObject
-
Gets the CellObject for the column.
Returns:
-
HTMLElement cell object.
setCellObject
-
Sets the CellObject for the column.
Parameters:
-
cellObject - Any HTMLElement object.
Class Header
java.lang.Object
net.sf.jolene.dom.Header All Implemented Interfaces:
-
final public class Header
An element in the header in a html document. Usually a meta, script, link or style tag.
Author:
-
Dan Howard
Since:
-
Sep 19, 2006 9:11:49 AM
Constructor Summary |
Header() Default construcor. |
Header(Tags tag) Construct a Header using a predefined Tag. |
Method Summary |
|
clone() Returns a clone of the header element object. |
void |
setValue(String value) Sets the value of the element. |
String |
toString() Renders the Header. |
Methods inherited from class net.sf.jolene.dom.HTMLElement |
clear, getAfterText, getAttribute, getBeforeText, getContent, getName, getStyle, getTag, getValue, hasAttribute, hasStyle, hide, isChecked, isDisabled, isHidden, isReadonly, keySet, removeAttribute, removeStyle, resetStyles, setAfterText, setAttribute, setBeforeText, setChecked, setContent, setDisabled, setName, setReadonly, setStyle, setStyles, swapWith, values |
Constructor Detail
Header
public Header()
-
Default construcor.
Header
-
Construct a Header using a predefined Tag. Note the shoot in the footness here. You can define a header with
any defined Tag. Really you should only use meta, link, script or style.
Parameters:
-
tag - A Tag enum. Usually script, link, meta.
Method Detail
setValue
public void setValue(String value)
-
Sets the value of the element.
Overrides:
-
Parameters:
-
value - value of object
toString
public String toString()
-
Renders the Header.
Overrides:
-
Returns:
-
The header element as a html string.
clone
-
Returns a clone of the header element object.
Overrides:
-
Returns:
-
Header object.
See Also:
-
Class HTMLElement
java.lang.Object
net.sf.jolene.dom.HTMLElement All Implemented Interfaces:
-
Direct Known Subclasses:
-
Button, CheckBox, Form, Grid, Header, Image, Input, Label, Radio, Select, Text, TextArea
abstract public class HTMLElement
extends Object
Base class for all html elements.
Author:
-
Dan Howard
Since:
-
Oct 11, 2003
Method Summary |
void |
clear() Clears this element's attributes. |
|
clone() Core clone implementation. |
String |
getAfterText() Gets the afterText string for the object. |
String |
getAttribute(String key) Return the html attribute specified by the key or null if it's not found. |
String |
getBeforeText() Gets the beforeText string for the object. |
String |
getContent()
Returns the content of the HTMLElement. |
String |
getName() Gets the element name. |
String |
getStyle(String key) Get the element style based on a style name. |
|
getTag() Get the tag for the element. |
String |
getValue() Gets the current value of the element. |
boolean |
hasAttribute(String key) Indicates if the specified attribute exists. |
boolean |
hasStyle(String key) Indicates if a style exists. |
void |
hide() This method hides objects from the page before rendering. |
boolean |
isChecked() Returns true if a Radio or CheckBox is checked. |
boolean |
isDisabled() Returns true if the element is disabled |
boolean |
isHidden() Returns whether this object is hidden or not. |
boolean |
isReadonly() Returns true if the element is readonly |
Set<String> |
keySet() Returns the set of attribute names. |
String |
removeAttribute(String key) Remove the specified attribute. |
String |
removeStyle(String key) Removes a style from the element. |
void |
resetStyles(String style) Sets the styles on the element based on the formatted style string, clearing all exisiting styles first. |
void |
setAfterText(String string) Sets the afterText string for the object. |
String |
setAttribute(String key, String value) Sets the specified attribute. |
void |
setBeforeText(String string) Sets the beforeText string for the object. |
void |
setChecked(boolean checked) Used for Radios and Checkboxes |
void |
setContent(String content) Sets the content of the HTMLElement. |
void |
setDisabled(boolean disabled) Set the element to be disabled. |
void |
setName(String name) Set the element name. |
void |
setReadonly(boolean readonly) Set the element to be readonly. |
String |
setStyle(String key, String value) Set the element style. |
void |
setStyles(String style) Sets the styles on the element based on a formatted style string. |
void |
setValue(String value) Sets the value of the element. |
void |
swapWith(String swapWith) Replace this element's string representation with the specified string. |
String |
toString() Renders the element as an html string. |
Collection<String> |
values() Return a collecton of attribute values. |
Constructor Detail
HTMLElement
protected HTMLElement(String name)
HTMLElement
protected HTMLElement()
Method Detail
getAfterText
public String getAfterText()
-
Gets the afterText string for the object.
The afterText is any string value that you want to be rendered immediatley after
the object itself.
Returns:
-
String
getAttribute
public final String getAttribute(String key)
-
Return the html attribute specified by the key or null if it's not found.
Specified by:
-
Parameters:
-
key - case insensitive attribute name.
Returns:
-
attribute value string.
getBeforeText
public String getBeforeText()
-
Gets the beforeText string for the object.
The beforeText is any string value that you want to be rendered immediatley before
the object itself.
Returns:
-
String
getValue
public String getValue()
-
Gets the current value of the element.
Returns:
-
String
setValue
public void setValue(String value)
-
Sets the value of the element.
Parameters:
-
value - value of object
getContent
public String getContent()
-
Returns the content of the HTMLElement. The content is part of the element between the end of the start tag
and the beginning of the end tag. In the example below Button text is the content.
<button name="test">Button text</button>
Note that some elements do not have content. For these elements this content
property has no effect on the rendering of the element.
Elements which have a content.
- Button
- Label
- TextArea
- Header Some header elements do and some don't.
Elements which do NOT have a content.
- ChecBox
- Grid
- Image
- Input
- Radio
- Select
Note also that for TextArea, Text and Label the content is also the value. In this case the value and content properties are
interchangable.
Returns:
-
String content part of the HTMLElement
setContent
public void setContent(String content)
-
Sets the content of the HTMLElement.
Parameters:
-
content - text or value to set.
-
See Also:
-
hasAttribute
public boolean hasAttribute(String key)
-
Indicates if the specified attribute exists.
Specified by:
-
Parameters:
-
key - case insensitive attribute name.
Returns:
-
true if the attribute exists.
hide
public void hide()
-
This method hides objects from the page before rendering. Hidden objects
are rendered as empty strings to the browser.
isHidden
public boolean isHidden()
-
Returns whether this object is hidden or not.
Returns:
-
boolean
keySet
public Set<String> keySet()
-
Returns the set of attribute names.
Specified by:
-
Returns:
-
set of attribute names.
removeAttribute
public String removeAttribute(String key)
-
Remove the specified attribute.
Specified by:
-
Parameters:
-
key - case insensitive attribute name.
Returns:
-
previous value associated with specified key, or null if there was no mapping for key.
setAfterText
public void setAfterText(String string)
-
Sets the afterText string for the object.
The afterText is any string value that you want to be rendered immediately after the object itself.
Example:
document.forms(0).elements("Submit").setAfterText(" Click this button to submit this form.");
This would render the following back to the browser:
<input type="SUBMIT" name="Submit" value="Submit"> Click this button to submit this form.
Parameters:
-
string - text after object
setAttribute
public final String setAttribute(String key,
String value)
-
Sets the specified attribute.
Specified by:
-
Parameters:
-
key - case insensitive attribute name.
-
value - value of the attribute.
Returns:
-
previous value associated with specified key, or null if there was no attribute for the key.
setBeforeText
public void setBeforeText(String string)
-
Sets the beforeText string for the object.
The beforeText is any string value that you want to be rendered immediatley before
the object itself.
Example:
document.forms(0).elements("Name").setBeforeText("Name: ");
This would render the following back to the browser:
Name: <input type="text" name="Name">
Parameters:
-
string - of text
toString
public String toString()
-
Renders the element as an html string.
Overrides:
-
toString in class Object
values
public Collection<String> values()
-
Return a collecton of attribute values.
Specified by:
-
Returns:
-
collecton of attribute values.
clone
-
Core clone implementation. Safely clones HTMLElement objects. Used by the DocumentFactory.
Overrides:
-
clone in class Object
Returns:
-
HTMLElement
See Also:
-
setChecked
public void setChecked(boolean checked)
-
Used for Radios and Checkboxes
Parameters:
-
checked - to indicate if the checkbox is checke or not
isChecked
public boolean isChecked()
-
Returns true if a Radio or CheckBox is checked.
Returns:
-
checked
setDisabled
public void setDisabled(boolean disabled)
-
Set the element to be disabled.
Parameters:
-
disabled - indicator for disabled or not
isDisabled
public boolean isDisabled()
-
Returns true if the element is disabled
Returns:
-
disabled
setReadonly
public void setReadonly(boolean readonly)
-
Set the element to be readonly.
Parameters:
-
readonly - indicator for readonly or not
isReadonly
public boolean isReadonly()
-
Returns true if the element is readonly
Returns:
-
readonly
getName
public String getName()
-
Gets the element name.
Returns:
-
name of the html element.
setName
public void setName(String name)
-
Set the element name.
Parameters:
-
name - name of the html element.
getTag
-
Get the tag for the element.
Returns:
-
the tag for the element.
swapWith
public void swapWith(String swapWith)
-
Replace this element's string representation with the specified string.
Parameters:
-
swapWith - any string you wish to render instead of this object.
getStyle
public String getStyle(String key)
-
Get the element style based on a style name.
Specified by:
-
Parameters:
-
key - case insensitive style name.
Returns:
-
String value for the specified style or null if not found.
setStyle
public String setStyle(String key,
String value)
-
Set the element style.
Specified by:
-
Parameters:
-
key - Style key name.
-
value - Style value.
Returns:
-
previous value associated with specified key, or null if there was no mapping for key.
hasStyle
public boolean hasStyle(String key)
-
Indicates if a style exists.
Specified by:
-
Parameters:
-
key - case instensitive style key name.
Returns:
-
true if the style exists in the string.
removeStyle
public String removeStyle(String key)
-
Removes a style from the element.
Specified by:
-
Parameters:
-
key - Style key name to remove.
Returns:
-
previous value associated with specified key, or null if there was no mapping for key.
setStyles
public void setStyles(String style)
-
Sets the styles on the element based on a formatted style string.
Expects the string to be in style format.
Specified by:
-
Parameters:
-
style - string in a format like azimuth:behind;background:aliceblue;background-color:aquamarine;border-bottom-style:solid;clip:auto;border-top-width:medium;
resetStyles
public void resetStyles(String style)
-
Sets the styles on the element based on the formatted style string, clearing all exisiting styles first.
Specified by:
-
Parameters:
-
style - string in a format like azimuth:behind;background:aliceblue;background-color:aquamarine;border-bottom-style:solid;clip:auto;border-top-width:medium;
clear
public void clear()
-
Clears this element's attributes.
Specified by:
-
Class Image
java.lang.Object
net.sf.jolene.dom.Image All Implemented Interfaces:
-
final public class Image
An image in a html document.
Author:
-
Dan Howard
Constructor Summary |
Image() Default constructor. |
Method Summary |
|
clone() Returns a clone of the image object. |
Methods inherited from class net.sf.jolene.dom.HTMLElement |
clear, getAfterText, getAttribute, getBeforeText, getContent, getName, getStyle, getTag, getValue, hasAttribute, hasStyle, hide, isChecked, isDisabled, isHidden, isReadonly, keySet, removeAttribute, removeStyle, resetStyles, setAfterText, setAttribute, setBeforeText, setChecked, setContent, setDisabled, setName, setReadonly, setStyle, setStyles, setValue, swapWith, toString, values |
Constructor Detail
Image
public Image()
-
Default constructor.
Method Detail
clone
-
Returns a clone of the image object.
Overrides:
-
Returns:
-
Image object.
See Also:
-
Class Input
java.lang.Object
net.sf.jolene.dom.Input All Implemented Interfaces:
-
final public class Input
An input field in a html document. Usually used for entry fields, hidden fields or buttons.
Use CheckBox and Radio for checkboxes and radio buttons.
Author:
-
Dan Howard
Constructor Summary |
Input() Default constructor. |
Input(String name) Construct an input object with the specified name. |
Method Summary |
|
clone() Returns a clone of the input object. |
void |
setName(String name) Sets the name of the input object. |
void |
setValue(String value) Sets the value of the input object. |
Methods inherited from class net.sf.jolene.dom.HTMLElement |
clear, getAfterText, getAttribute, getBeforeText, getContent, getName, getStyle, getTag, getValue, hasAttribute, hasStyle, hide, isChecked, isDisabled, isHidden, isReadonly, keySet, removeAttribute, removeStyle, resetStyles, setAfterText, setAttribute, setBeforeText, setChecked, setContent, setDisabled, setReadonly, setStyle, setStyles, swapWith, toString, values |
Constructor Detail
Input
public Input()
-
Default constructor.
Input
public Input(String name)
-
Construct an input object with the specified name.
Parameters:
-
name - name of the input.
Method Detail
setName
public void setName(String name)
-
Sets the name of the input object.
Overrides:
-
Parameters:
-
name - name of the input.
setValue
public void setValue(String value)
-
Sets the value of the input object.
Overrides:
-
Parameters:
-
value - value of the input.
clone
-
Returns a clone of the input object.
Overrides:
-
Returns:
-
Input object.
See Also:
-
Class Label
java.lang.Object
net.sf.jolene.dom.Label All Implemented Interfaces:
-
final public class Label
A lable in an html document.
Author:
-
Dan Howard
Since:
-
Oct 19, 2003
Constructor Summary |
Label() Default constructor. |
Method Summary |
|
clone() Returns a clone of the label object. |
void |
setValue(String value) Sets the value of the label. |
String |
toString() Renders the label. |
Methods inherited from class net.sf.jolene.dom.HTMLElement |
clear, getAfterText, getAttribute, getBeforeText, getContent, getName, getStyle, getTag, getValue, hasAttribute, hasStyle, hide, isChecked, isDisabled, isHidden, isReadonly, keySet, removeAttribute, removeStyle, resetStyles, setAfterText, setAttribute, setBeforeText, setChecked, setContent, setDisabled, setName, setReadonly, setStyle, setStyles, swapWith, values |
Constructor Detail
Label
public Label()
-
Default constructor.
Method Detail
toString
public String toString()
-
Renders the label.
Overrides:
-
Returns:
-
The label as a html string.
setValue
public void setValue(String value)
-
Sets the value of the label. Same as setText.
Overrides:
-
Parameters:
-
value - text value of the label.
clone
-
Returns a clone of the label object.
Overrides:
-
Returns:
-
Label object.
See Also:
-
Class MalformedHTMLException
java.lang.Object
java.lang.Throwable
java.lang.Exception
java.lang.RuntimeException
net.sf.jolene.dom.MalformedHTMLException All Implemented Interfaces:
-
Serializable
final public class MalformedHTMLException
extends RuntimeException
Exception thrown by the parser if it finds some unparsable html.
Author:
-
Dan Howard
Constructor Detail
MalformedHTMLException
public MalformedHTMLException()
MalformedHTMLException
public MalformedHTMLException(String message)
-
Constructs the exception with the specified message string.
Parameters:
-
message - - message string
MalformedHTMLException
public MalformedHTMLException(Throwable cause)
-
Constructs the exception with the specified cause.
Parameters:
-
cause - - cause of the exception
MalformedHTMLException
public MalformedHTMLException(String message,
Throwable cause)
-
Constructs the exception with the specified message string and cause.
Parameters:
-
message - - message string
-
cause - - cause of the exception
Class Option
java.lang.Object
net.sf.jolene.dom.Option
final public class Option
extends Object
A select option object.
Author:
-
Dan Howard
Since:
-
Nov 30, 2003
Constructor Summary |
Option() Creates a new Option object. |
Option(int value, String text) Creates an Option object using an int value and String text parameters. |
Option(String value, String text) Creates an Option object using the String value and text parameters. |
Method Summary |
int |
getIndex() Return the index of this option in the list of selections. |
String |
getText() Get the option text. |
String |
getValue() Get the option value. |
boolean |
isSelected() Determines if the option is currently selected. |
void |
setSelected(boolean selected) Sets the option as currently selected. |
void |
setText(String string) Sets the text to display in the option. |
void |
setValue(String string) Sets the value which would be submitted when the form is submitted. |
String |
toString() Renders the option. |
Constructor Detail
Option
public Option()
-
Creates a new Option object.
Option
public Option(String value,
String text)
-
Creates an Option object using the String value and text parameters.
Parameters:
-
value - The value of the option
-
text - The display text of the option
Option
public Option(int value,
String text)
-
Creates an Option object using an int value and String text parameters.
Parameters:
-
value - The value of the option
-
text - The display text of the option
Method Detail
getIndex
public int getIndex()
-
Return the index of this option in the list of selections.
Returns:
-
the index of this option in the list of selections.
isSelected
public boolean isSelected()
-
Determines if the option is currently selected. This boolean value is read/write.
Returns:
-
selected
getText
public String getText()
-
Get the option text.
Returns:
-
text
getValue
public String getValue()
-
Get the option value.
Returns:
-
value
setSelected
public void setSelected(boolean selected)
-
Sets the option as currently selected.
Parameters:
-
selected - boolean
setText
public void setText(String string)
-
Sets the text to display in the option.
Parameters:
-
string - text to display.
setValue
public void setValue(String string)
-
Sets the value which would be submitted when the form is submitted.
Parameters:
-
string - value of the option.
toString
public String toString()
-
Renders the option.
Overrides:
-
toString in class Object
Returns:
-
The option as a html string.
Class OptionGroup
java.lang.Object
net.sf.jolene.dom.OptionGroup
final public class OptionGroup
extends Object
Not currently supported.
Author:
-
DanH
Constructor Detail
OptionGroup
public OptionGroup()
OptionGroup
public OptionGroup(String value)
Method Detail
getValue
public String getValue()
-
Returns:
-
value
setValue
public void setValue(String value)
Class Radio
java.lang.Object
net.sf.jolene.dom.Radio All Implemented Interfaces:
-
final public class Radio
A radio button in an html document.
Author:
-
Dan Howard
Since:
-
Oct 13, 2005 8:25:11 PM
Constructor Summary |
Radio() Default constructor. |
Radio(String name) Construct a radio button with the specified name. |
Method Summary |
|
clone() Returns a clone of the radio button object. |
void |
setName(String name) Set the name of the radio button. |
void |
setValue(String value) Set the value of the radio button. |
Methods inherited from class net.sf.jolene.dom.HTMLElement |
clear, getAfterText, getAttribute, getBeforeText, getContent, getName, getStyle, getTag, getValue, hasAttribute, hasStyle, hide, isChecked, isDisabled, isHidden, isReadonly, keySet, removeAttribute, removeStyle, resetStyles, setAfterText, setAttribute, setBeforeText, setChecked, setContent, setDisabled, setReadonly, setStyle, setStyles, swapWith, toString, values |
Constructor Detail
Radio
public Radio()
-
Default constructor.
Radio
public Radio(String name)
-
Construct a radio button with the specified name.
Parameters:
-
name - name of the radio button.
Method Detail
setName
public void setName(String name)
-
Set the name of the radio button.
Overrides:
-
Parameters:
-
name - name of the radio button.
setValue
public void setValue(String value)
-
Set the value of the radio button.
Overrides:
-
Parameters:
-
value - name of the radio button.
clone
-
Returns a clone of the radio button object.
Overrides:
-
Returns:
-
Radio object.
See Also:
-
Class Select
java.lang.Object
net.sf.jolene.dom.Select All Implemented Interfaces:
-
final public class Select
A Select in an html document.
Author:
-
Dan Howard
Constructor Summary |
Select() Default constructor. |
Select(String name) Construct a select with the specified name. |
Method Summary |
int |
addOption(Option option) This method adds a new option to the available options for the select object. |
void |
clearOptions() Clears the list of options on the select. |
|
clone() Returns a clone of the select object. |
String |
getValue() Gets the value of the select object. |
boolean |
isMultiple() Indicates if the select is a multiple select. |
|
options(int index) Returns the specified option object by the numeric index. |
void |
setMultiple(boolean multiple) Sets if this select is a multiple select. |
void |
setName(String name) Set the name of the select object. |
void |
setValue(String value) Sets the value for the select object. |
void |
sortOptions() Sort the options on the select. |
String |
toString() Renders the select. |
Methods inherited from class net.sf.jolene.dom.HTMLElement |
clear, getAfterText, getAttribute, getBeforeText, getContent, getName, getStyle, getTag, hasAttribute, hasStyle, hide, isChecked, isDisabled, isHidden, isReadonly, keySet, removeAttribute, removeStyle, resetStyles, setAfterText, setAttribute, setBeforeText, setChecked, setContent, setDisabled, setReadonly, setStyle, setStyles, swapWith, values |
Constructor Detail
Select
public Select()
-
Default constructor.
Select
public Select(String name)
-
Construct a select with the specified name.
Parameters:
-
name - name of the select.
Method Detail
addOption
public int addOption(Option option) -
This method adds a new option to the available options for the select object.
Parameters:
-
option - An option object to add to the select list
Returns:
-
int - the new size of the option list.
options
public Option options(int index) -
Returns the specified option object by the numeric index.
Parameters:
-
index - the index of the option to retrive
Returns:
-
Option object.
setName
public void setName(String name)
-
Set the name of the select object.
Overrides:
-
Parameters:
-
name - name of the select object.
toString
public String toString()
-
Renders the select.
Overrides:
-
Returns:
-
The select as a html string.
clearOptions
public void clearOptions()
-
Clears the list of options on the select.
sortOptions
public void sortOptions()
-
Sort the options on the select.
setValue
public void setValue(String value)
-
Sets the value for the select object. The value to assign
may be a single value or multiple values seperate by a comma.
Overrides:
-
Parameters:
-
value - String value to set.
getValue
public String getValue()
-
Gets the value of the select object.
Overrides:
-
Returns:
-
value of the select object.
isMultiple
public boolean isMultiple()
-
Indicates if the select is a multiple select.
Returns:
-
mulitple
setMultiple
public void setMultiple(boolean multiple)
-
Sets if this select is a multiple select.
Parameters:
-
multiple - boolean.
clone
-
Returns a clone of the select object.
Overrides:
-
Returns:
-
Select object.
See Also:
-
Class Text
java.lang.Object
net.sf.jolene.dom.Text All Implemented Interfaces:
-
final public class Text
This represents arbitrary text to be rendered in an html document.
These objects are created when the Parser detects a LABEL tag containing other HTML elements.
Author:
-
Dan Howard
Since:
-
Feb 11, 2006 8:21:44 AM
Constructor Summary |
Text() |
Method Summary |
|
clone() Returns a clone of the text object. |
void |
setValue(String value) Sets the text on the text object. |
String |
toString() Renders the text. |
Methods inherited from class net.sf.jolene.dom.HTMLElement |
clear, getAfterText, getAttribute, getBeforeText, getContent, getName, getStyle, getTag, getValue, hasAttribute, hasStyle, hide, isChecked, isDisabled, isHidden, isReadonly, keySet, removeAttribute, removeStyle, resetStyles, setAfterText, setAttribute, setBeforeText, setChecked, setContent, setDisabled, setName, setReadonly, setStyle, setStyles, swapWith, values |
Constructor Detail
Text
public Text()
Method Detail
setValue
public void setValue(String value)
-
Sets the text on the text object. Same as setText.
Overrides:
-
Parameters:
-
value - text to set.
clone
-
Returns a clone of the text object.
Overrides:
-
Returns:
-
Text object.
See Also:
-
toString
public String toString()
-
Renders the text.
Overrides:
-
Returns:
-
The text as a html string.
Class TextArea
java.lang.Object
net.sf.jolene.dom.TextArea All Implemented Interfaces:
-
final public class TextArea
A TextArea in a html document.
Author:
-
Dan Howard
Since:
-
Oct 11, 2003
Constructor Summary |
TextArea() Default constructor. |
TextArea(String name) Construct a textarea with the specified name. |
Method Summary |
|
clone() Returns a clone of the textarea object. |
void |
setContent(String text) Sets the text of the textarea. |
void |
setName(String name) Sets the name of the textarea. |
String |
toString() Renders the textarea. |
Methods inherited from class net.sf.jolene.dom.HTMLElement |
clear, getAfterText, getAttribute, getBeforeText, getContent, getName, getStyle, getTag, getValue, hasAttribute, hasStyle, hide, isChecked, isDisabled, isHidden, isReadonly, keySet, removeAttribute, removeStyle, resetStyles, setAfterText, setAttribute, setBeforeText, setChecked, setDisabled, setReadonly, setStyle, setStyles, setValue, swapWith, values |
Constructor Detail
TextArea
public TextArea()
-
Default constructor.
TextArea
public TextArea(String name)
-
Construct a textarea with the specified name.
Parameters:
-
name - name of the textarea.
Method Detail
setContent
public void setContent(String text)
-
Sets the text of the textarea. Same as setValue.
Overrides:
-
Parameters:
-
text - text value to set on TextArea.
-
See Also:
-
toString
public String toString()
-
Renders the textarea.
Overrides:
-
Returns:
-
The textarea as a html string.
setName
public void setName(String name)
-
Sets the name of the textarea.
Overrides:
-
Parameters:
-
name - name of the textarea.
clone
-
Returns a clone of the textarea object.
Overrides:
-
Returns:
-
TextArea object.
See Also:
-
Package net.sf.jolene.factories
Document factory used to retrieve cached documents.
See:
-
Class Summary |
DocumentFactory |
DocumentFactory is a Singleton used to perform cacheing of documents. |
Package net.sf.jolene.factories Description
Document factory used to retrieve cached documents.
Class DocumentFactory
java.lang.Object
net.sf.jolene.factories.DocumentFactory
public class DocumentFactory
extends Object
DocumentFactory is a Singleton used to perform cacheing of documents. Documents added to the cache
are not parsed again. Instead they are cloned which is faster.
Author:
-
Dan Howard
Method Summary |
|
getDocument(String docFileName) Returns a new document instance using the full filename as the factory key. |
|
getDocument(String docFileName, String contextPath, String uri) Returns a new document instance using the full filename as the factory key. |
|
getInstance() Gets the factory instance. |
Method Detail
getInstance
-
Gets the factory instance.
Returns:
-
DocumentFactory instance.
getDocument
public Document getDocument(String docFileName) throws IOException -
Returns a new document instance using the full filename as the factory key.
Parameters:
-
docFileName - full path and name to the file to get.
Returns:
-
Document the document object from the cache.
Throws:
-
IOException - if any IOException occurs.
getDocument
public Document getDocument(String docFileName, String contextPath, String uri) throws IOException -
Returns a new document instance using the full filename as the factory key.
Parameters:
-
docFileName - full path and name to the file to get.
-
contextPath - aids in finding the document's real path from the uri.
-
uri - uri to the document.
Returns:
-
Document the document object from the cache.
Throws:
-
IOException - if ever an IOException occurs.
Package net.sf.jolene.html
HTML style and attribute classes.
See:
-
Class Summary |
Attributes |
Map wrapper to handle html attributes. |
HTMLString |
Some html utilites. |
Styles |
Class to manage a style string. |
Package net.sf.jolene.html Description
HTML style and attribute classes.
Class Attributes
java.lang.Object
net.sf.jolene.html.Attributes All Implemented Interfaces:
-
public class Attributes
extends Object
Map wrapper to handle html attributes. It's a case insensitive sorted map.
Author:
-
Dan Howard
Method Summary |
void |
clear() Clears the attributes. |
String |
getAttribute(String key) Gets an attribute from the attribute map or NULL if not found. |
boolean |
hasAttribute(String key) Indicates whether or not an attribute exists. |
Set<String> |
keySet() Returns the attributes as a Set. |
String |
removeAttribute(String key) Remove an attribute. |
String |
setAttribute(String key, String value) Sets an attribute. |
String |
toString() |
Collection<String> |
values() Returns the attribute values as a Collection. |
Constructor Detail
Attributes
public Attributes()
Method Detail
setAttribute
public String setAttribute(String key,
String value)
-
Sets an attribute.
Specified by:
-
Parameters:
-
key - - attribute name
-
value - - attribute value
Returns:
-
String
getAttribute
public String getAttribute(String key)
-
Gets an attribute from the attribute map or NULL if not found.
Specified by:
-
Parameters:
-
key - - attribute name
Returns:
-
String or NULL of key is null or not found
removeAttribute
public String removeAttribute(String key)
-
Remove an attribute.
Specified by:
-
Parameters:
-
key - - attribute name
Returns:
-
String
hasAttribute
public boolean hasAttribute(String key)
-
Indicates whether or not an attribute exists.
Specified by:
-
Parameters:
-
key - - attribute name
Returns:
-
boolean
keySet
public Set<String> keySet()
-
Returns the attributes as a Set.
Specified by:
-
Returns:
-
Set
values
public Collection<String> values()
-
Returns the attribute values as a Collection.
Specified by:
-
Returns:
-
Collection
clear
public void clear()
-
Clears the attributes.
Specified by:
-
toString
public String toString()
-
Overrides:
-
toString in class Object
Class HTMLString
java.lang.Object
net.sf.jolene.html.HTMLString
public class HTMLString
extends Object
Some html utilites.
Author:
-
Dan Howard
Method Summary |
static String |
bold(String s) |
static String |
head(int n, String s) |
static String |
hr() |
static String |
image(String image) |
static String |
image(String image, String alt) |
static String |
image(String image, String alt, String align) |
static String |
italics(String s) |
static String |
linebreak() |
static String |
link(String url, String text) |
static String |
link(String url, String text, String image) |
static String |
paragraph(String s) |
static String |
preformat(String s) |
Method Detail
head
public static String head(int n,
String s)
linebreak
public static String linebreak()
paragraph
public static String paragraph(String s)
preformat
public static String preformat(String s)
hr
public static String hr()
image
public static String image(String image,
String alt,
String align)
image
public static String image(String image,
String alt)
image
public static String image(String image)
link
public static String link(String url,
String text)
link
public static String link(String url,
String text,
String image)
bold
public static String bold(String s)
italics
public static String italics(String s)
Interface IAttributes
All Superinterfaces:
-
All Known Implementing Classes:
-
Attributes, Button, CheckBox, Form, Grid, Header, HTMLElement, Image, Input, Label, Radio, Select, Text, TextArea
public interface IAttributes
Author:
-
Dan Howard
Method Detail
getAttribute
String getAttribute(String key)
hasAttribute
boolean hasAttribute(String key)
removeAttribute
String removeAttribute(String key)
setAttribute
String setAttribute(String key,
String value)
Interface ICollection
All Known Subinterfaces:
-
All Known Implementing Classes:
-
Attributes, Button, CheckBox, Form, Grid, Header, HTMLElement, Image, Input, Label, Radio, Select, Styles, Text, TextArea
public interface ICollection
Comments for ICollection go here.
Author:
-
Dan Howard
Since:
-
Aug 3, 2008 6:12:40 PM
Method Detail
keySet
Set<String> keySet()
values
Collection<String> values()
clear
void clear()
Interface IStyles
All Superinterfaces:
-
All Known Implementing Classes:
-
Button, CheckBox, Form, Grid, Header, HTMLElement, Image, Input, Label, Radio, Select, Styles, Text, TextArea
public interface IStyles
Comments for IStyles go here.
Author:
-
Dan Howard
Since:
-
Aug 3, 2008 6:13:43 PM
Method Detail
getStyle
String getStyle(String key)
setStyle
String setStyle(String key,
String value)
hasStyle
boolean hasStyle(String key)
removeStyle
String removeStyle(String key)
setStyles
void setStyles(String style)
resetStyles
void resetStyles(String style)
Class Styles
java.lang.Object
net.sf.jolene.html.Styles All Implemented Interfaces:
-
final public class Styles
extends Object
Class to manage a style string.
Author:
-
Dan Howard
Since:
-
Aug 3, 2008 6:09:50 PM
Constructor Summary |
Styles() Default style constructor |
Styles(String styles) Construct a style object passing in formatted style string. |
Method Summary |
void |
clear() Clears the styles. |
String |
getStyle(String key) Get a style based on a style name. |
boolean |
hasStyle(String key) Indicates if a style exists. |
Set<String> |
keySet() Returns a set of style keys from the Style. |
String |
removeStyle(String key) Removes a style from the Style object. |
void |
resetStyles(String style) Sets the style based on the formatted style string, clearing all exisiting styles first. |
String |
setStyle(String key, String value) Set a style on the Style object. |
void |
setStyles(String style) Sets styles on the Style object based on a formatted style string. |
String |
toString() Renders this Style as a style string. |
Collection<String> |
values() Returns a Collection of Style values. |
Constructor Detail
Styles
public Styles()
-
Default style constructor
Styles
public Styles(String styles)
-
Construct a style object passing in formatted style string.
Parameters:
-
styles - formatted style string.
Method Detail
getStyle
public String getStyle(String key)
-
Get a style based on a style name.
Specified by:
-
Parameters:
-
key - case insensitive style name.
Returns:
-
String value for the specified style.
hasStyle
public boolean hasStyle(String key)
-
Indicates if a style exists.
Specified by:
-
Parameters:
-
key - case instensitive style key name.
Returns:
-
true if the style exists in the string.
keySet
public Set<String> keySet()
-
Returns a set of style keys from the Style.
Specified by:
-
Returns:
-
set of style keys from the Style.
removeStyle
public String removeStyle(String key)
-
Removes a style from the Style object.
Specified by:
-
Parameters:
-
key - Style key name to remove.
Returns:
-
previous value associated with specified key, or null
if there was no mapping for key.
clear
public void clear()
-
Clears the styles.
Specified by:
-
setStyle
public String setStyle(String key,
String value)
-
Set a style on the Style object.
Specified by:
-
Parameters:
-
key - Style key name.
-
value - Style value.
Returns:
-
previous value associated with specified key, or null if there was no mapping for key.
setStyles
public void setStyles(String style)
-
Sets styles on the Style object based on a formatted style string.
Expects the string to be in style format.
Specified by:
-
Parameters:
-
style - string in a format like azimuth:behind;background:aliceblue;background-color:aquamarine;border-bottom-style:solid;clip:auto;border-top-width:medium;
resetStyles
public void resetStyles(String style)
-
Sets the style based on the formatted style string, clearing all exisiting styles first.
Specified by:
-
Parameters:
-
style - string in a format like azimuth:behind;background:aliceblue;background-color:aquamarine;border-bottom-style:solid;clip:auto;border-top-width:medium;
values
public Collection<String> values()
-
Returns a Collection of Style values.
Specified by:
-
Returns:
-
Collection of Style values.
toString
public String toString()
-
Renders this Style as a style string.
Overrides:
-
toString in class Object
Returns:
-
a string formatted for a style attribute.
Package net.sf.jolene.servlet
Servlet for document handling.
See:
-
Package net.sf.jolene.servlet Description
Servlet for document handling.
Class Domlet
java.lang.Object
javax.servlet.GenericServlet
javax.servlet.http.HttpServlet
net.sf.jolene.servlet.Domlet All Implemented Interfaces:
-
Serializable, Servlet, ServletConfig
public class Domlet
extends HttpServlet
Author:
-
Dan Howard
Since:
-
Aug 7, 2005 8:21:03 AM
Method Summary |
protected void |
doGet(HttpServletRequest request, HttpServletResponse response) |
protected void |
doPost(HttpServletRequest request, HttpServletResponse response) |
protected static void |
handleRequest(HttpServletRequest request, HttpServletResponse response) Basic request handler for servlet requests. |
void |
init() |
Constructor Detail
Domlet
public Domlet()
Method Detail
doGet
protected void doGet(HttpServletRequest request,
HttpServletResponse response)
throws ServletException,
IOException
-
Overrides:
-
doGet in class HttpServlet
Parameters:
-
request - HttpServletRequest
-
response - HttpServletResponse
-
Throws:
-
ServletException
-
IOException
doPost
protected void doPost(HttpServletRequest request,
HttpServletResponse response)
throws ServletException,
IOException
-
Overrides:
-
doPost in class HttpServlet
Parameters:
-
request - HttpServletRequest
-
response - HttpServletResponse
-
Throws:
-
ServletException
-
IOException
init
public void init()
throws ServletException
-
Overrides:
-
init in class GenericServlet
-
Throws:
-
ServletException
handleRequest
protected static void handleRequest(HttpServletRequest request,
HttpServletResponse response)
throws IOException
-
Basic request handler for servlet requests. Looks at the the request or session to locate the
document object to stream out the response writer.
Parameters:
-
request - HttpServletRequest
-
response - HttpServletResponse
-
Throws:
-
IOException - if an IOException occurs
Package net.sf.jolene.struts
Default struts action for Jolene based on a DispatchAction.
See:
-
Class Summary |
DomletAction |
Default action servlet for jolene. |
Package net.sf.jolene.struts Description
Default struts action for Jolene based on a DispatchAction.
Class DomletAction
java.lang.Object
org.apache.struts.action.Action
org.apache.struts.actions.BaseAction
org.apache.struts.actions.DispatchAction
net.sf.jolene.struts.DomletAction
public class DomletAction
extends org.apache.struts.actions.DispatchAction
Default action servlet for jolene. Implements a modified DispatchAction which can match request uri string
to the method name of the action class. The primary purpose is to associate a uri to a document object.
There are several ways to do this see the method descriptions.
Author:
-
Dan Howard
Since:
-
Sep 23, 2006 5:40:15 PM
Fields inherited from class org.apache.struts.actions.DispatchAction |
clazz, methods, types |
Fields inherited from class org.apache.struts.actions.BaseAction |
messages |
Fields inherited from class org.apache.struts.action.Action |
servlet |
Method Summary |
org.apache.struts.action.ActionForward |
execute(org.apache.struts.action.ActionMapping mapping, org.apache.struts.action.ActionForm form, HttpServletRequest request, HttpServletResponse response) Performs a basic dispatch of the request looking for the parameter from the struts mapping or by using
the struts action name itself. |
|
getDocument(org.apache.struts.action.ActionMapping mapping, String forward, HttpServletRequest request) Retrives a document object based on the specified forward. |
|
getDocument(org.apache.struts.action.ActionMapping mapping, HttpServletRequest request) Retrives a document object based on the mapping input attribute and attaches it to the proper scope. |
Methods inherited from class org.apache.struts.actions.DispatchAction |
cancelled, dispatchMethod, getMethod, getMethodName, getParameter, unspecified |
Methods inherited from class org.apache.struts.action.Action |
addErrors, addMessages, execute, generateToken, getErrors, getLocale, getMessages, getResources, getResources, getServlet, isCancelled, isTokenValid, isTokenValid, resetToken, saveErrors, saveErrors, saveMessages, saveMessages, saveToken, setLocale, setServlet |
Constructor Detail
DomletAction
public DomletAction()
Method Detail
execute
public org.apache.struts.action.ActionForward execute(org.apache.struts.action.ActionMapping mapping,
org.apache.struts.action.ActionForm form,
HttpServletRequest request,
HttpServletResponse response)
throws Exception
-
Performs a basic dispatch of the request looking for the parameter from the struts mapping or by using
the struts action name itself.
Overrides:
-
execute in class org.apache.struts.actions.DispatchAction
Parameters:
-
mapping - ActionMapping
-
form - ActionForm
-
request - HttpServletRequest
-
response - HttpServletResponse
Returns:
-
ActionForward
Throws:
-
Exception
getDocument
public Document getDocument(org.apache.struts.action.ActionMapping mapping, HttpServletRequest request) throws IOException -
Retrives a document object based on the mapping input attribute and attaches it to the proper scope.
The reason for this method is to allow a default document to be associated with an action since
actions can have many forwards.
For example, calling this method would get the document from the /domlet/login.html uri.
<action
path="/login"
type="domlet.kbsample.web.actions.LoginAction"
name="LoginForm"
scope="session"
validate="false"
input="/domlet/login.html">
<forward name="success" path="/browse.do"/>
<forward name="fail" path="/domlet/error.html"/>
<forward name="login" path="/domlet/login.html"/>
</action>
Parameters:
-
mapping - ActionMapping
-
request - HttpServletRequest
Returns:
-
Document or null if the uri for input mapping is undefined in struts-config.xml
Throws:
-
IOException - if an IOException occurs
getDocument
public Document getDocument(org.apache.struts.action.ActionMapping mapping, String forward, HttpServletRequest request) throws IOException -
Retrives a document object based on the specified forward.
For example, using the following in struts-config.xml:
<action
path="/login"
type="domlet.kbsample.web.actions.LoginAction"
name="LoginForm"
scope="session"
validate="false"
input="/domlet/login.html">
<forward name="success" path="/browse.do"/>
<forward name="fail" path="/domlet/error.html"/>
<forward name="login" path="/domlet/login.html"/>
</action>
getDocument(mapping, "fail", request);
Returns document from /domlet/error.html
getDocument(mapping, "login", request);
Returns document from /domlet/login.html Parameters:
-
mapping - ActionMapping
-
forward - forward string
-
request - HttpServletRequest
Returns:
-
Document or null if the forward cannot be found in struts-config.xml
Throws:
-
IOException - if an IOException occurs
Package net.sf.jolene.util
Utilities.
See:
-
Class Summary |
PrefsReader |
Class to read jolene preferences from the jolene.properties file. |
Translator |
Not used. |
Package net.sf.jolene.util Description
Utilities.
Class PrefsReader
java.lang.Object
net.sf.jolene.util.PrefsReader
public class PrefsReader
extends Object
Class to read jolene preferences from the jolene.properties file.
Author:
-
Dan Howard
Since:
-
Dec 30, 2005 10:41:11 AM
Method Summary |
static void |
init() |
Method Detail
init
public static void init()
Class Translator
java.lang.Object
net.sf.jolene.util.Translator
public class Translator
extends Object
Not used.
User: Dan
Date: Jun 1, 2008
Time: 5:22:33 PM
todo dumb class name - it's not translating anything.
Method Summary |
static void |
main(String[] args) java -jar jolene.jar net.sf.jolene.util.Translator |
Method Detail
main
public static void main(String[] args)
-
java -jar jolene.jar net.sf.jolene.util.Translator
Parameters:
-
args - 2 params are expected: full path to the FOLDER where the html files reside - full path to the output resources file.
DocFlex/Doclet is both a multi-format Javadoc doclet and a free edition of DocFlex/Javadoc. If you need to customize your Javadoc without writing a full-blown doclet from scratch, DocFlex/Javadoc may be the only tool able to help you! Find out more at www.docflex.com