FileDocCategorySizeDatePackage
Framer.javaAPI DocGlassfish v2 API6246Fri May 04 22:24:36 BST 2007com.sun.enterprise.config.serverbeans.validation

Framer

public class Framer extends DefaultHandler
This class provides the basic mechanism for constructing Frames in which variable definitions can be recorded, and then used to dereference variable references. The idea is that it manages a collection of frames, held in a frameholder. (The frameholder can either be provided by clients, or a default one is provided). As SAX events come in frames are added to this frameholder, in the appropriate place.

Fields Summary
private Stack
frameStack
protected FrameHolder
frameHolder
public static final String
CLUSTER
public static final String
CONFIG
public static final String
CONFIG_REF
public static final String
NAME
public static final String
NAMESPACE
public static final String
SERVER
public static final String
SERVER_REF
public static final String
SYSTEM_PROPERTY
public static final String
VALUE
Constructors Summary
Framer()

        this(new FrameHolder());
    
Framer(FrameHolder fh)

        frameHolder = fh;
        frameStack.push(fh.getDomainFrame());
    
Methods Summary
FramecurrentFrame()

        return (Frame) frameStack.peek();
    
public voidendElement(java.lang.String namespaceURI, java.lang.String localName, java.lang.String qName)

        if (isConfigEvent(localName) || isServerEvent(localName) || isClusterEvent(localName)){
            frameStack.pop();
        }
        super.endElement(namespaceURI, localName, qName);
    
protected FramegetClusterFrame(org.xml.sax.Attributes atts)

        return frameHolder.getClusterFrame(getFrameName(atts));
    
protected FramegetConfigFrame(org.xml.sax.Attributes atts)

        return frameHolder.getConfigFrame(getFrameName(atts));
    
FrameHoldergetFrameHolder()

        return frameHolder;
    
private java.lang.StringgetFrameName(org.xml.sax.Attributes atts)

        return atts.getValue(NAMESPACE, NAME);
    
protected FramegetServerFrame(org.xml.sax.Attributes atts)

        return frameHolder.getServerFrame(getFrameName(atts));
    
private voidhandleStartClusterEvent(org.xml.sax.Attributes atts)

        frameStack.push(getClusterFrame(atts));
    
private voidhandleStartConfigEvent(org.xml.sax.Attributes atts)

        frameStack.push(getConfigFrame(atts));
    
private voidhandleStartServerEvent(org.xml.sax.Attributes atts)

        frameStack.push(getServerFrame(atts));
    
protected voidhandleStartServerRefEvent(org.xml.sax.Attributes atts)

private voidhandleSystemPropertyEvent(org.xml.sax.Attributes atts)

        currentFrame().put(atts.getValue(NAMESPACE, NAME), atts.getValue(NAMESPACE, VALUE));
    
private booleanisClusterEvent(java.lang.String n)

        return n.equals(CLUSTER);
    
private booleanisConfigEvent(java.lang.String n)

        return n.equals(CONFIG);
    
private booleanisServerEvent(java.lang.String n)

        return n.equals(SERVER);
    
private booleanisServerRefEvent(java.lang.String n)

        return n.equals(SERVER_REF);
    
private booleanisSystemPropertyElement(java.lang.String n)

        return n.equals(SYSTEM_PROPERTY);
    
public voidstartElement(java.lang.String namespaceURI, java.lang.String localName, java.lang.String qName, org.xml.sax.Attributes atts)

        if (isSystemPropertyElement(localName)){
            handleSystemPropertyEvent(atts);
        } else if (isConfigEvent(localName)) {
            handleStartConfigEvent(atts);
        } else if (isServerEvent(localName)) {
            handleStartServerEvent(atts);
        } else if (isClusterEvent(localName)) {
            handleStartClusterEvent(atts);
        } else if (isServerRefEvent(localName)) {
            handleStartServerRefEvent(atts);
        }
        super.startElement(namespaceURI, localName, qName, atts);