|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--org.xml.sax.helpers.DefaultHandler | +--org.millstone.webadapter.Theme
This class provides an interface to the meta-information regarding a particular webadapter theme. This entails for instanace the inheritance tree of the various xsl-template files, the different requirments that the theme imposes on the client browser, etc.
The WebAdapter uses themes to convert the UIDL description into client representation, typically HTML or XHTML. A theme consists of set of XSL template files which are used to perform XSL transform.
XSL files are divided into sets, which can have requirements. A file set is included in transformation only if the given requirements are met. Following requirements are supported:
The theme description is XML data, and it can be loaded from file or stream.
The default filename is specified by Theme.DESCRIPTIONFILE
.
Example of theme description file:
<?xml version="1.0" encoding="UTF-8"?> <theme name="normal"> <extends theme="simple"/> <description>The normal theme for all browsers</description> <author name="IT Mill Ltd" email="millstone@itmill.com" /> <fileset> <require> <supports javascript="JavaScript 1.0"/> </require> <file name="common/error.xsl" /> <file name="components/button.xsl" /> <file name="components/select.xsl" /> <file name="components/textfield.xsl" /> <file name="components/table.xsl" /> </fileset> </theme>
Nested Class Summary | |
class |
Theme.AgentRequirement
HTTP user agent requirement This requirements is used to ensure that the User-Agent string provided in HTTP request headers contains given substring. |
class |
Theme.AndRequirement
Logical AND requirement. |
class |
Theme.Author
Author information class. |
class |
Theme.File
Theme XSL file description Description of a single XSL file included a theme. |
class |
Theme.Fileset
A recursive set of files sharing the same requirements. |
class |
Theme.JavaScriptRequirement
Javascript version requirement This requirement is used to ensure a certain level of JavaScript version support. |
class |
Theme.MarkupLanguageRequirement
Markup language version requirement This requirement is used to ensure a certain level of Markup language version support. |
class |
Theme.NotRequirement
Logical NOT requirement. |
class |
Theme.OrRequirement
Logical OR requirement. |
static interface |
Theme.Requirement
Generic requirement. |
static interface |
Theme.RequirementCollection
Generic requirement collection interface. |
Field Summary | |
static java.lang.String |
DESCRIPTIONFILE
Default description file name. |
Constructor Summary | |
Theme(java.io.File descriptionFile)
Creates a new instance using XML description file. |
|
Theme(java.io.InputStream descriptionStream)
Creates a new instance using XML description stream. |
Method Summary | |
void |
characters(char[] data,
int start,
int length)
Parse character data in XML stream. |
void |
endElement(java.lang.String namespaceURI,
java.lang.String localName,
java.lang.String qName)
Parse end tag in XML stream. |
Theme.Author |
getAuthor()
Returns the author of this theme. |
java.util.List |
getFileNames()
Get list of all files in this theme. |
java.util.List |
getFileNames(WebBrowser terminal)
Get list of file names matching WebBrowserType. |
java.lang.String |
getName()
Returns the name of this theme. |
java.util.List |
getParentThemes()
Returns the list of parent themes of this theme. |
java.lang.String |
getVersion()
Returns the version of this theme. |
void |
startElement(java.lang.String uri,
java.lang.String local,
java.lang.String qName,
org.xml.sax.Attributes atts)
Parse start tag in XML stream. |
java.lang.String |
toString()
String representation of Theme object. |
Methods inherited from class org.xml.sax.helpers.DefaultHandler |
endDocument, endPrefixMapping, error, fatalError, ignorableWhitespace, notationDecl, processingInstruction, resolveEntity, setDocumentLocator, skippedEntity, startDocument, startPrefixMapping, unparsedEntityDecl, warning |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Field Detail |
public static final java.lang.String DESCRIPTIONFILE
Constructor Detail |
public Theme(java.io.File descriptionFile) throws java.io.FileNotFoundException
descriptionFile
- Description file
java.io.FileNotFoundException
- Thrown if the given file is not found.public Theme(java.io.InputStream descriptionStream)
descriptionStream
- XML input to parseMethod Detail |
public void startElement(java.lang.String uri, java.lang.String local, java.lang.String qName, org.xml.sax.Attributes atts)
startElement
in interface org.xml.sax.ContentHandler
startElement
in class org.xml.sax.helpers.DefaultHandler
ContentHandler.startElement(java.lang.String, java.lang.String, java.lang.String, org.xml.sax.Attributes)
public void endElement(java.lang.String namespaceURI, java.lang.String localName, java.lang.String qName) throws org.xml.sax.SAXException
endElement
in interface org.xml.sax.ContentHandler
endElement
in class org.xml.sax.helpers.DefaultHandler
org.xml.sax.SAXException
ContentHandler.endElement(String, String, String)
public void characters(char[] data, int start, int length)
characters
in interface org.xml.sax.ContentHandler
characters
in class org.xml.sax.helpers.DefaultHandler
ContentHandler.characters(char[], int, int)
public java.util.List getFileNames()
public java.util.List getFileNames(WebBrowser terminal)
public java.lang.String toString()
toString
in class java.lang.Object
Object.toString()
public Theme.Author getAuthor()
public java.lang.String getName()
public java.util.List getParentThemes()
public java.lang.String getVersion()
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |