PageBoxLib
Class RuleHandler

java.lang.Object
  extended byorg.xml.sax.helpers.DefaultHandler
      extended byPageBoxLib.RuleHandler
All Implemented Interfaces:
org.xml.sax.ContentHandler, org.xml.sax.DTDHandler, org.xml.sax.EntityResolver, org.xml.sax.ErrorHandler

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

SAX handler for rules.xml.

Changes:

alexis.grandemange@pagebox.net

Copyright (c) 2002-2004 Alexis Grandemange

This program is free software; you can redistribute it and/or
 modify it under the terms of the GNU Lesser General Public License
 as published by the Free Software Foundation; version 2.1 of the
 License.
 This library is distributed in the hope that it will be useful,
 but WITHOUT ANY WARRANTY; without even the implied warranty of
 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
 GNU Lesser General Public License for more details.
 A copy of the GNU Lesser General Public License lesser.txt should be
 included in the distribution.

Version:
0, 1, 0
Author:
Alexis Grandemange

Nested Class Summary
 class RuleHandler.DefaultAuth
          Describes the default permission of a PageBox..
 class RuleHandler.PublisherAuth
          Describes the permissions of a Publisher.
 class RuleHandler.RepositoryAuth
          Describes the permissions, subscriber and publishers of a Repository.
 class RuleHandler.Rule
          Memory representation of rules.xml.
 
Field Summary
private  RuleHandler.RepositoryAuth auth
          Repository authorization
private  java.lang.StringBuffer data
          Element data
private  java.lang.String extClass
          Extension class
private  java.lang.String extName
          Extension name
private  RuleHandler.PublisherAuth pubAuth
          Publisher authorization
private  java.lang.String publisher
          Publisher ID
private  java.lang.String resName
          resources key (well-known name)
private  ResourceInfo resource
          resources value
private  RuleHandler.Rule rule
          Memory representation of rules.xml
private  int type
          Entry type: 0 repository, 1 publisher, 2 default, 3 subscriber
private  java.lang.String url
          Repository URL
 
Constructor Summary
RuleHandler()
           
 
Method Summary
 void characters(char[] buf, int offset, int len)
          Method called to handle characters in elements.
 void endElement(java.lang.String namespaceURI, java.lang.String sName, java.lang.String qName)
          Method called at the end of an element.
 RuleHandler.Rule getRule()
           
private  int parse()
          Parse data
 void startElement(java.lang.String namespaceURI, java.lang.String sName, java.lang.String qName, org.xml.sax.Attributes attrs)
          Method called at the beginning of an element.
 
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
 

Field Detail

type

private int type
Entry type: 0 repository, 1 publisher, 2 default, 3 subscriber


data

private java.lang.StringBuffer data
Element data


url

private java.lang.String url
Repository URL


auth

private RuleHandler.RepositoryAuth auth
Repository authorization


publisher

private java.lang.String publisher
Publisher ID


pubAuth

private RuleHandler.PublisherAuth pubAuth
Publisher authorization


resName

private java.lang.String resName
resources key (well-known name)


resource

private ResourceInfo resource
resources value


extName

private java.lang.String extName
Extension name


extClass

private java.lang.String extClass
Extension class


rule

private RuleHandler.Rule rule
Memory representation of rules.xml

Constructor Detail

RuleHandler

public RuleHandler()
Method Detail

getRule

public final RuleHandler.Rule getRule()
Returns:
rules.xml data

startElement

public void startElement(java.lang.String namespaceURI,
                         java.lang.String sName,
                         java.lang.String qName,
                         org.xml.sax.Attributes attrs)
                  throws org.xml.sax.SAXException
Method called at the beginning of an element.

Parameters:
namespaceURI - name space
sName - simple name
qName - qualified name
attrs - attributes
Throws:
org.xml.sax.SAXException

endElement

public void endElement(java.lang.String namespaceURI,
                       java.lang.String sName,
                       java.lang.String qName)
                throws org.xml.sax.SAXException
Method called at the end of an element.

Parameters:
namespaceURI - name space
sName - simple name
qName - qualified name
Throws:
org.xml.sax.SAXException

parse

private int parse()
Parse data


characters

public void characters(char[] buf,
                       int offset,
                       int len)
                throws org.xml.sax.SAXException
Method called to handle characters in elements. Fills data.

Parameters:
buf - char buffer
offset - first char offset in buf
len - number of chars
Throws:
org.xml.sax.SAXException