Demo Documentation
8/18/08 6:25 PM
Package Summary
net.sf.jolene.constants Global constants used by Jolene.
net.sf.jolene.data
net.sf.jolene.dom HTML DOM objects.
net.sf.jolene.factories Document factory used to retrieve cached documents.
net.sf.jolene.html HTML style and attribute classes.
net.sf.jolene.servlet Servlet for document handling.
net.sf.jolene.struts Default struts action for Jolene based on a DispatchAction.
net.sf.jolene.util Utilities.
Package net.sf.jolene.constants
Global constants used by Jolene.
See:
Description
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
net.sf.jolene.constants
java.lang.Object
  java.lang.Enum<Elements>
      net.sf.jolene.constants.Elements
All Implemented Interfaces:
Comparable<Elements>, Serializable

public enum Elements
extends Enum<Elements>
Supported parsable HTML elements.
Author:
Dan Howard
Since:
Mar 4, 2006 7:07:58 AM

Enum Constant Summary
button
checkbox
grid
image
input
label
radio
select
text
textarea
Method Summary
static Elements
valueOf(String name)
static Elements[]
values()
Enum Constant Detail
input
public static final Elements input

button
public static final Elements button

grid
public static final Elements grid

image
public static final Elements image

label
public static final Elements label

select
public static final Elements select

textarea
public static final Elements textarea

checkbox
public static final Elements checkbox

radio
public static final Elements radio

text
public static final Elements text
Method Detail
values
public static final Elements[] values()

valueOf
public static Elements valueOf(String name)
Class Entities
net.sf.jolene.constants
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 Summary
static String
ampersand
static String
greaterthan
static String
lessthan
static String
quote
static String
space
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
net.sf.jolene.constants
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 Summary
static Prefs
CacheSize
Default: 32.
static Prefs
DocumentCaching
Default: true.
static Prefs
GenerateLocaleStrings
When set to true /resources/application.properites file is updated based on the template labels.
static Prefs
SelectValueSeperator
Default comma (,).
static Prefs
StreamLabelTags
Default true.
static Prefs
XHTMLStrict
Default false.
Method Summary
String
getValue()
void
setValue(Object value)
String
toString()
static Prefs
valueOf(String name)
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
net.sf.jolene.constants
java.lang.Object
  java.lang.Enum<StyleClasses>
      net.sf.jolene.constants.StyleClasses
All Implemented Interfaces:
Comparable<StyleClasses>, Serializable

public enum StyleClasses
extends Enum<StyleClasses>
Style definitions used bu Jolene.
Author:
: Dan Howard
Since:
: Aug 7, 2006 8:47:17 AM

Enum Constant Summary
EvenRow
Grid
OddRow
Method Summary
valueOf(String name)
static StyleClasses[]
values()
Enum Constant Detail
Grid
public static final StyleClasses Grid

OddRow
public static final StyleClasses OddRow

EvenRow
public static final StyleClasses EvenRow
Method Detail
values
public static final StyleClasses[] values()

valueOf
public static StyleClasses valueOf(String name)
Enum Tags
net.sf.jolene.constants
java.lang.Object
  java.lang.Enum<Tags>
      net.sf.jolene.constants.Tags
All Implemented Interfaces:
Comparable<Tags>, Serializable

public enum Tags
extends Enum<Tags>
Supported HTML tags.
Author:
: Dan Howard
Since:
: Oct 12, 2005 5:08:17 AM

Enum Constant Summary
button
form
img
input
label
link
meta
option
script
select
style
table
td
textarea
th
tr
Method Summary
static Tags
valueOf(String name)
static Tags[]
values()
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
net.sf.jolene.data
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 Summary
DataBinder()
Constructor Detail
DataBinder
public DataBinder()
Package net.sf.jolene.dom
HTML DOM objects.
See:
Description
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.
Exception Summary
MalformedHTMLException Exception thrown by the parser if it finds some unparsable html.
Package net.sf.jolene.dom Description
HTML DOM objects.
Class Button
net.sf.jolene.dom
java.lang.Object
  net.sf.jolene.dom.HTMLElement
      net.sf.jolene.dom.Button
All Implemented Interfaces:

final public class Button
extends HTMLElement
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
public Button clone()
Returns a clone of the button object.
Overrides:
Returns:
Button object.
See Also:
Class CheckBox
net.sf.jolene.dom
java.lang.Object
  net.sf.jolene.dom.HTMLElement
      net.sf.jolene.dom.CheckBox
All Implemented Interfaces:

final public class CheckBox
extends HTMLElement
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
public 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
net.sf.jolene.dom
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.
List<Header>
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
public Document(String fileName)
         throws IOException,
                MalformedHTMLException
Parameters:
fileName - - file name of the document.
Throws:
IOException - - if an IOException occurs
MalformedHTMLException - - runtime exception

Document
public Document(String fileName,
                String contextPath,
                String uri)
         throws IOException,
                MalformedHTMLException
Throws:
IOException
MalformedHTMLException - - runtime exception
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
public HTMLElement getElementById(String id)
Returns a object by searching all forms in the document.
Parameters:
id - The id of the element.
Returns:
HTMLElement

clone
public Document 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<HeadergetHeader()
Returns:
List of Header objects on the document.
Class Form
net.sf.jolene.dom
java.lang.Object
  net.sf.jolene.dom.HTMLElement
      net.sf.jolene.dom.Form
All Implemented Interfaces:

final public class Form
extends HTMLElement
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.
Map<String,HTMLElement>
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
public HTMLElement elements(int element)
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
public HTMLElement elements(String elementName)
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,HTMLElementgetRadioGroup(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
public Form clone()
Core clone implementation. Safely clones HTMLElement objects. Used by the DocumentFactory.
Overrides:
Returns:
HTMLElement
See Also:
Class Grid
net.sf.jolene.dom
java.lang.Object
  net.sf.jolene.dom.HTMLElement
      net.sf.jolene.dom.Grid
All Implemented Interfaces:

final public class Grid
extends HTMLElement
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
public Grid clone()
Returns a clone of the grid object.
Overrides:
Returns:
Grid object.
See Also:
Class GridColumn
net.sf.jolene.dom
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
public HTMLElement getCellObject()
Gets the CellObject for the column.
Returns:
HTMLElement cell object.

setCellObject
public void setCellObject(HTMLElement cellObject)
Sets the CellObject for the column.
Parameters:
cellObject - Any HTMLElement object.
Class Header
net.sf.jolene.dom
java.lang.Object
  net.sf.jolene.dom.HTMLElement
      net.sf.jolene.dom.Header
All Implemented Interfaces:

final public class Header
extends HTMLElement
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
public Header(Tags tag)
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
public Header clone()
Returns a clone of the header element object.
Overrides:
Returns:
Header object.
See Also:
Class HTMLElement
net.sf.jolene.dom
java.lang.Object
  net.sf.jolene.dom.HTMLElement
All Implemented Interfaces:
Direct Known Subclasses:

abstract public class HTMLElement
extends Object
implements IAttributes, IStyles, Cloneable
Base class for all html elements.
Author:
Dan Howard
Since:
Oct 11, 2003

Constructor Summary
protected
HTMLElement()
protected
HTMLElement(String name)
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:
keySet in interface ICollection
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:
values in interface ICollection
Returns:
collecton of attribute values.

clone
public HTMLElement 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
public Tags 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:
getStyle in interface IStyles
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:
setStyle in interface IStyles
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:
hasStyle in interface IStyles
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:
removeStyle in interface IStyles
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:
setStyles in interface IStyles
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:
resetStyles in interface IStyles
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:
clear in interface ICollection
Class Image
net.sf.jolene.dom
java.lang.Object
  net.sf.jolene.dom.HTMLElement
      net.sf.jolene.dom.Image
All Implemented Interfaces:

final public class Image
extends HTMLElement
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
public Image clone()
Returns a clone of the image object.
Overrides:
Returns:
Image object.
See Also:
Class Input
net.sf.jolene.dom
java.lang.Object
  net.sf.jolene.dom.HTMLElement
      net.sf.jolene.dom.Input
All Implemented Interfaces:

final public class Input
extends HTMLElement
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
public Input clone()
Returns a clone of the input object.
Overrides:
Returns:
Input object.
See Also:
Class Label
net.sf.jolene.dom
java.lang.Object
  net.sf.jolene.dom.HTMLElement
      net.sf.jolene.dom.Label
All Implemented Interfaces:

final public class Label
extends HTMLElement
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
public Label clone()
Returns a clone of the label object.
Overrides:
Returns:
Label object.
See Also:
Class MalformedHTMLException
net.sf.jolene.dom
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 Summary
MalformedHTMLException()
MalformedHTMLException(String message)
Constructs the exception with the specified message string.
MalformedHTMLException(String message, Throwable cause)
Constructs the exception with the specified message string and cause.
MalformedHTMLException(Throwable cause)
Constructs the exception with the specified cause.
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
net.sf.jolene.dom
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
net.sf.jolene.dom
java.lang.Object
  net.sf.jolene.dom.OptionGroup

final public class OptionGroup
extends Object
Not currently supported.
Author:
DanH

Constructor Summary
OptionGroup()
OptionGroup(String value)
Method Summary
String
getValue()
void
setValue(String value)
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
net.sf.jolene.dom
java.lang.Object
  net.sf.jolene.dom.HTMLElement
      net.sf.jolene.dom.Radio
All Implemented Interfaces:

final public class Radio
extends HTMLElement
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
public Radio clone()
Returns a clone of the radio button object.
Overrides:
Returns:
Radio object.
See Also:
Class Select
net.sf.jolene.dom
java.lang.Object
  net.sf.jolene.dom.HTMLElement
      net.sf.jolene.dom.Select
All Implemented Interfaces:

final public class Select
extends HTMLElement
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
public Select clone()
Returns a clone of the select object.
Overrides:
Returns:
Select object.
See Also:
Class Text
net.sf.jolene.dom
java.lang.Object
  net.sf.jolene.dom.HTMLElement
      net.sf.jolene.dom.Text
All Implemented Interfaces:

final public class Text
extends HTMLElement
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
public Text 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
net.sf.jolene.dom
java.lang.Object
  net.sf.jolene.dom.HTMLElement
      net.sf.jolene.dom.TextArea
All Implemented Interfaces:

final public class TextArea
extends HTMLElement
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
public 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:
Description
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
net.sf.jolene.factories
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
public static DocumentFactory 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:
Description
Interface Summary
IAttributes
ICollection Comments for ICollection go here.
IStyles Comments for IStyles go here.
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
net.sf.jolene.html
java.lang.Object
  net.sf.jolene.html.Attributes
All Implemented Interfaces:

public class Attributes
extends Object
implements IAttributes
Map wrapper to handle html attributes. It's a case insensitive sorted map.
Author:
Dan Howard

Constructor Summary
Attributes()
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:
keySet in interface ICollection
Returns:
Set

values
public Collection<String> values()
Returns the attribute values as a Collection.
Specified by:
values in interface ICollection
Returns:
Collection

clear
public void clear()
Clears the attributes.
Specified by:
clear in interface ICollection

toString
public String toString()
Overrides:
toString in class Object
Class HTMLString
net.sf.jolene.html
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
net.sf.jolene.html
All Superinterfaces:
All Known Implementing Classes:

public interface IAttributes
extends ICollection
Author:
Dan Howard

Method Summary
String
getAttribute(String key)
boolean
hasAttribute(String key)
String
removeAttribute(String key)
String
setAttribute(String key, String value)
Methods inherited from interface net.sf.jolene.html.ICollection
clear, keySet, values
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
net.sf.jolene.html
All Known Subinterfaces:
All Known Implementing Classes:

public interface ICollection
Comments for ICollection go here.
Author:
Dan Howard
Since:
Aug 3, 2008 6:12:40 PM

Method Summary
void
clear()
Set<String>
keySet()
Collection<String>
values()
Method Detail
keySet
Set<String> keySet()

values
Collection<String> values()

clear
void clear()
Interface IStyles
net.sf.jolene.html
All Superinterfaces:
All Known Implementing Classes:

public interface IStyles
extends ICollection
Comments for IStyles go here.
Author:
Dan Howard
Since:
Aug 3, 2008 6:13:43 PM

Method Summary
String
getStyle(String key)
boolean
hasStyle(String key)
String
removeStyle(String key)
void
resetStyles(String style)
String
setStyle(String key, String value)
void
setStyles(String style)
Methods inherited from interface net.sf.jolene.html.ICollection
clear, keySet, values
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
net.sf.jolene.html
java.lang.Object
  net.sf.jolene.html.Styles
All Implemented Interfaces:

final public class Styles
extends Object
implements IStyles
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:
getStyle in interface IStyles
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:
hasStyle in interface IStyles
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:
keySet in interface ICollection
Returns:
set of style keys from the Style.

removeStyle
public String removeStyle(String key)
Removes a style from the Style object.
Specified by:
removeStyle in interface IStyles
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:
clear in interface ICollection

setStyle
public String setStyle(String key,
                       String value)
Set a style on the Style object.
Specified by:
setStyle in interface IStyles
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:
setStyles in interface IStyles
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:
resetStyles in interface IStyles
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:
values in interface ICollection
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:
Description
Class Summary
Domlet
Package net.sf.jolene.servlet Description
Servlet for document handling.
Class Domlet
net.sf.jolene.servlet
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

Constructor Summary
Domlet()
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:
Description
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
net.sf.jolene.struts
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
Constructor Summary
DomletAction()
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.
Java API documentation generated with DocFlex/Doclet v1.5.5
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