org.swixml

Class Parser


public class Parser
extends java.lang.Object

Singleton Parser to render XML for Swing Documents

Version:
$Revision: 1.4 $
Authors:
Wolf Paulus
Frank Meissner
See Also:
SwingTagLibrary, ConverterLibrary

Field Summary

static String
ATTR_ACTION
Allows to provides swixml tags with a dynamic update class
static String
ATTR_BUNDLE
Additional attribute to collect layout constrain information
static String
ATTR_CONSTRAINTS
Additional attribute to collect layout constrain information
static String
ATTR_ID
Allows to provides swixml tags with an unique id
static String
ATTR_INCLUDE
Allows to provides swixml tags with an unique id
static String
ATTR_INITCLASS
Allows to provides swixml tags with a dynamic update class
static String
ATTR_LOCALE
Additional attribute to collect layout constrain information
static String
ATTR_MACOS_ABOUT
Attribute name that flags an Action as the default Aboutbox handler on a Mac
static String
ATTR_MACOS_OPENAPP
Attribute name that flags an Action as the default Open Application handler on a Mac
static String
ATTR_MACOS_OPENFILE
Attribute name that flags an Action as the default Open File handler on a Mac
static String
ATTR_MACOS_PREF
Attribute name that flags an Action as the default Preferences handler on a Mac
static String
ATTR_MACOS_PREFIX
Prefix for all MAC OS X related attributes
static String
ATTR_MACOS_PRINT
Attribute name that flags an Action as the default Print handler on a Mac
static String
ATTR_MACOS_QUIT
Attribute name that flags an Action as the default Quit handler on a Mac
static String
ATTR_MACOS_REOPEN
Attribute name that flags an Action as the default Re-Open Applicaiton handler on a Mac
static String
ATTR_PLAF
Additional attribute to collect information about the PLAF implementation
static String
ATTR_REFID
Allows to provides swixml tags with an unique id
static String
ATTR_USE
Deprecated. use refid instead
static String
GETINSTANCE
Method name used with initclass - if this exit, the update class will no be instanced but getInstance is called
static Vector
LOCALIZED_ATTRIBUTES
Localiced Attributes

Constructor Summary

Parser(SwingEngine engine)
Constructs a new SwixMl Parser for the provided engine.

Method Summary

Object
parse(Document jdoc)
Converts XML into a javax.swing object tree.
void
parse(Document jdoc, Container container)
Converts XML into a javax.swing object tree.

Field Details

ATTR_ACTION

public static final String ATTR_ACTION
Allows to provides swixml tags with a dynamic update class

ATTR_BUNDLE

public static final String ATTR_BUNDLE
Additional attribute to collect layout constrain information

ATTR_CONSTRAINTS

public static final String ATTR_CONSTRAINTS
Additional attribute to collect layout constrain information

ATTR_ID

public static final String ATTR_ID
Allows to provides swixml tags with an unique id

ATTR_INCLUDE

public static final String ATTR_INCLUDE
Allows to provides swixml tags with an unique id

ATTR_INITCLASS

public static final String ATTR_INITCLASS
Allows to provides swixml tags with a dynamic update class

ATTR_LOCALE

public static final String ATTR_LOCALE
Additional attribute to collect layout constrain information

ATTR_MACOS_ABOUT

public static final String ATTR_MACOS_ABOUT
Attribute name that flags an Action as the default Aboutbox handler on a Mac

ATTR_MACOS_OPENAPP

public static final String ATTR_MACOS_OPENAPP
Attribute name that flags an Action as the default Open Application handler on a Mac

ATTR_MACOS_OPENFILE

public static final String ATTR_MACOS_OPENFILE
Attribute name that flags an Action as the default Open File handler on a Mac

ATTR_MACOS_PREF

public static final String ATTR_MACOS_PREF
Attribute name that flags an Action as the default Preferences handler on a Mac

ATTR_MACOS_PREFIX

public static final String ATTR_MACOS_PREFIX
Prefix for all MAC OS X related attributes

ATTR_MACOS_PRINT

public static final String ATTR_MACOS_PRINT
Attribute name that flags an Action as the default Print handler on a Mac

ATTR_MACOS_QUIT

public static final String ATTR_MACOS_QUIT
Attribute name that flags an Action as the default Quit handler on a Mac

ATTR_MACOS_REOPEN

public static final String ATTR_MACOS_REOPEN
Attribute name that flags an Action as the default Re-Open Applicaiton handler on a Mac

ATTR_PLAF

public static final String ATTR_PLAF
Additional attribute to collect information about the PLAF implementation

ATTR_REFID

public static final String ATTR_REFID
Allows to provides swixml tags with an unique id

ATTR_USE

public static final String ATTR_USE

Deprecated. use refid instead

Allows to provides swixml tags with an unique id

GETINSTANCE

public static final String GETINSTANCE
Method name used with initclass - if this exit, the update class will no be instanced but getInstance is called

LOCALIZED_ATTRIBUTES

public static final Vector LOCALIZED_ATTRIBUTES
Localiced Attributes

Constructor Details

Parser

public Parser(SwingEngine engine)
Constructs a new SwixMl Parser for the provided engine.
Parameters:
engine - SwingEngine

Method Details

parse

public Object parse(Document jdoc)
            throws Exception
Converts XML into a javax.swing object tree.
    Reads XML from the provied Reader and builds an intermediate jdom document.
    Tags and their attributes are getting converted into swing objects.
 
Parameters:
jdoc - Document providing the XML document
Returns:
java.awt.Container root object for the swing object tree

parse

public void parse(Document jdoc,
                  Container container)
            throws Exception
Converts XML into a javax.swing object tree.
 Note: This parse method does not return a swing object but converts all sub nodes
 of the xml documents root into seing objects and adds those into the provided container.
 This is useful when a JApplet for instance already exists and need to get some gui inserted.
 
Parameters:
jdoc - Document providing the XML document
container - Container container for the XML root's children

Copyright B) 2002 - 2005 - Wolf Paulus - CarlsbadCubes.com . All rights reserved.