ca.sqlpower.wabit.dao
Class WorkspaceSAXHandler

java.lang.Object
  extended by org.xml.sax.helpers.DefaultHandler
      extended by ca.sqlpower.wabit.dao.WorkspaceSAXHandler
All Implemented Interfaces:
org.xml.sax.ContentHandler, org.xml.sax.DTDHandler, org.xml.sax.EntityResolver, org.xml.sax.ErrorHandler

public class WorkspaceSAXHandler
extends org.xml.sax.helpers.DefaultHandler

This will be used with a parser to load a saved workspace from a file.


Constructor Summary
WorkspaceSAXHandler(WabitSessionContext context)
          Creates a new SAX handler which is capable of reading in a series of workspace descriptions from an XML stream.
WorkspaceSAXHandler(WabitSessionContext context, WabitServerInfo serverInfo)
          Creates a new SAX handler which is capable of reading in a series of workspace descriptions from an XML stream.
 
Method Summary
 void characters(char[] ch, int start, int length)
           
 void endElement(java.lang.String uri, java.lang.String localName, java.lang.String name)
           
 org.olap4j.metadata.Member findMember(org.xml.sax.Attributes attributes, org.olap4j.metadata.Cube cube)
          This method finds a member from a cube based on given attributes.
 java.lang.String getMessage()
           
 WabitSession getSession()
           
 boolean isCancelled()
           
 void setCancelled(boolean cancelled)
           
 void startElement(java.lang.String uri, java.lang.String localName, java.lang.String name, org.xml.sax.Attributes attr)
           
 
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, toString, wait, wait, wait
 

Constructor Detail

WorkspaceSAXHandler

public WorkspaceSAXHandler(WabitSessionContext context)
Creates a new SAX handler which is capable of reading in a series of workspace descriptions from an XML stream. The list of workspaces encountered in the stream become available as a Wabit Session.

This constructor must be called from the foreground thread

Parameters:
context - The context that will create sessions for loading and creates user prompters if input is required.

WorkspaceSAXHandler

public WorkspaceSAXHandler(WabitSessionContext context,
                           WabitServerInfo serverInfo)
Creates a new SAX handler which is capable of reading in a series of workspace descriptions from an XML stream. The list of workspaces encountered in the stream become available as a Wabit Session.

This constructor must be called from the foreground thread

Parameters:
context - The context that will create sessions for loading and creates user prompters if input is required.
serverInfo - Describes a connection to a server. If this is not null, a server session will be created that is connected to a server.
Method Detail

startElement

public void startElement(java.lang.String uri,
                         java.lang.String localName,
                         java.lang.String name,
                         org.xml.sax.Attributes attr)
                  throws org.xml.sax.SAXException
Specified by:
startElement in interface org.xml.sax.ContentHandler
Overrides:
startElement in class org.xml.sax.helpers.DefaultHandler
Throws:
org.xml.sax.SAXException

findMember

public org.olap4j.metadata.Member findMember(org.xml.sax.Attributes attributes,
                                             org.olap4j.metadata.Cube cube)
This method finds a member from a cube based on given attributes.


endElement

public void endElement(java.lang.String uri,
                       java.lang.String localName,
                       java.lang.String name)
                throws org.xml.sax.SAXException
Specified by:
endElement in interface org.xml.sax.ContentHandler
Overrides:
endElement in class org.xml.sax.helpers.DefaultHandler
Throws:
org.xml.sax.SAXException

characters

public void characters(char[] ch,
                       int start,
                       int length)
                throws org.xml.sax.SAXException
Specified by:
characters in interface org.xml.sax.ContentHandler
Overrides:
characters in class org.xml.sax.helpers.DefaultHandler
Throws:
org.xml.sax.SAXException

getSession

public WabitSession getSession()

getMessage

public java.lang.String getMessage()

isCancelled

public boolean isCancelled()

setCancelled

public void setCancelled(boolean cancelled)


Copyright © 2009. All Rights Reserved.