oss.net.pstream.sax
Class ElementHandler

java.lang.Object
  |
  +--oss.net.pstream.sax.ElementHandler
Direct Known Subclasses:
PatternElement, PortletElement, PstreamElement, RewriteConditionElement, RewriteElement, RewriteRuleElement, SubstitutionElement, TargetElement, UservarElement

public abstract class ElementHandler
extends java.lang.Object

This abstract class was designed to lessen the pain of implementing a SAX handler. I really think this library is bastardized, but for the sake of compliance I wrote a sax handler. This class sets up all the potential attribute names and element names to save a little memory and a lot of overhead.

Title:

Description:

Copyright: Copyright (c) 2002

Company:

Version:
1.0
Author:
unascribed

Field Summary
protected static java.lang.String action_attr
           
protected static java.lang.String authenticate_element
           
protected static java.lang.String debug_attr
           
protected static java.lang.String fcookie_element
           
protected static java.lang.String fhost_element
           
protected static java.lang.String flags_attr
           
protected static java.lang.String forward_params_element
           
protected static java.lang.String host_element
           
protected static java.lang.String href_attr
           
protected static java.lang.String jndi_resource_element
           
protected static java.lang.String name_attr
           
protected static java.lang.String password_attr
           
protected static java.lang.String path_attr
           
protected static java.lang.String pattern_element
           
protected static java.lang.String port_attr
           
protected static java.lang.String portlet_element
           
protected static java.lang.String protocol_attr
           
protected static java.lang.String protocol_element
           
protected static java.lang.String pstream_element
           
protected static java.lang.String rewrite_condition_element
           
protected static java.lang.String rewrite_element
           
protected static java.lang.String rewrite_rule_element
           
protected static java.lang.String session_params_element
           
protected static java.lang.String sparam_element
           
protected static java.lang.String src_attr
           
protected static java.lang.String substitution_element
           
protected static java.lang.String target_attr
           
protected static java.lang.String target_element
           
protected static java.lang.String target_host_element
           
protected static java.lang.String type_attr
           
protected static java.lang.String url_attr
           
protected static java.lang.String use_attr
           
protected static java.lang.String use_httpclientra_attr
           
protected static java.lang.String username_attr
           
protected static java.lang.String uservar_element
           
protected static java.lang.String usetemplate_attr
           
protected static java.lang.String value_attr
           
 
Constructor Summary
ElementHandler(boolean Debug)
          global constructor designed to set element debug options.
 
Method Summary
 void AttributeException(java.lang.String Name, java.lang.String value)
          A shortcut for throwing a SAXException for attributes.
 void debug(java.lang.String ename, org.xml.sax.Attributes Attrs)
          Debug function for printing out all the stuff in the current element.
 void debug(java.lang.String ename, java.lang.String info)
          Debug function for printing random info Very handy for figuring out which element is blowing up on you and where.
abstract  java.lang.String getName()
          Returns the name of the element this Handler handles.
abstract  PortletStreamParameters handleElementEnd(java.lang.StringBuffer content, PortletStreamParametersMap Params, java.lang.String PortletName)
          Handles the end of an element (ending editing of an element for instance).
abstract  PortletStreamParameters handleElementStart(PortletStreamParametersMap Params, java.lang.String PortletName, org.xml.sax.Attributes Attrs)
          Handles the start of an element (setting params and stuff).
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

protocol_attr

protected static java.lang.String protocol_attr

name_attr

protected static java.lang.String name_attr

port_attr

protected static java.lang.String port_attr

path_attr

protected static java.lang.String path_attr

href_attr

protected static java.lang.String href_attr

src_attr

protected static java.lang.String src_attr

action_attr

protected static java.lang.String action_attr

url_attr

protected static java.lang.String url_attr

use_attr

protected static java.lang.String use_attr

password_attr

protected static java.lang.String password_attr

username_attr

protected static java.lang.String username_attr

flags_attr

protected static java.lang.String flags_attr

debug_attr

protected static java.lang.String debug_attr

use_httpclientra_attr

protected static java.lang.String use_httpclientra_attr

usetemplate_attr

protected static java.lang.String usetemplate_attr

target_attr

protected static java.lang.String target_attr

value_attr

protected static java.lang.String value_attr

type_attr

protected static java.lang.String type_attr

pstream_element

protected static java.lang.String pstream_element

host_element

protected static java.lang.String host_element

target_host_element

protected static java.lang.String target_host_element

authenticate_element

protected static java.lang.String authenticate_element

rewrite_element

protected static java.lang.String rewrite_element

rewrite_condition_element

protected static java.lang.String rewrite_condition_element

rewrite_rule_element

protected static java.lang.String rewrite_rule_element

target_element

protected static java.lang.String target_element

substitution_element

protected static java.lang.String substitution_element

pattern_element

protected static java.lang.String pattern_element

fcookie_element

protected static java.lang.String fcookie_element

fhost_element

protected static java.lang.String fhost_element

forward_params_element

protected static java.lang.String forward_params_element

jndi_resource_element

protected static java.lang.String jndi_resource_element

portlet_element

protected static java.lang.String portlet_element

protocol_element

protected static java.lang.String protocol_element

session_params_element

protected static java.lang.String session_params_element

sparam_element

protected static java.lang.String sparam_element

uservar_element

protected static java.lang.String uservar_element
Constructor Detail

ElementHandler

public ElementHandler(boolean Debug)
global constructor designed to set element debug options.

Parameters:
Debug -
Method Detail

getName

public abstract java.lang.String getName()
Returns the name of the element this Handler handles.

Returns:
A static String.

handleElementStart

public abstract PortletStreamParameters handleElementStart(PortletStreamParametersMap Params,
                                                           java.lang.String PortletName,
                                                           org.xml.sax.Attributes Attrs)
                                                    throws org.xml.sax.SAXException
Handles the start of an element (setting params and stuff).

Parameters:
Attrs - the SAX Attributes of the element.
Returns:
a PortletStreamParameters which may or may not be the same one passed into the function. If this happens to be the start of a new tag then a new PortletStreamParameters is created and returned. In that case, the new Parameter should be saved to the array.
Throws:
org.xml.sax.SAXException - If you screw up.

handleElementEnd

public abstract PortletStreamParameters handleElementEnd(java.lang.StringBuffer content,
                                                         PortletStreamParametersMap Params,
                                                         java.lang.String PortletName)
                                                  throws org.xml.sax.SAXException
Handles the end of an element (ending editing of an element for instance). Also manages any content found since the end of the startelement tag.

Parameters:
content - A StringBuffer of all data found since the handleElementStart tag was called.
Params - The parameters of the current PortletStream.
Returns:
A PortletStreamParameters which may or may not be the same one passed to the function.
Throws:
org.xml.sax.SAXException - if you screw up.

AttributeException

public void AttributeException(java.lang.String Name,
                               java.lang.String value)
                        throws org.xml.sax.SAXException
A shortcut for throwing a SAXException for attributes.

Parameters:
Name - the attribute name.
value - the attribute value.
Throws:
org.xml.sax.SAXException - always.

debug

public void debug(java.lang.String ename,
                  org.xml.sax.Attributes Attrs)
Debug function for printing out all the stuff in the current element. Very handy for figuring out which element is blowing up on you and where.

Parameters:
ename - The name of the element.
Attrs - The attribute list.

debug

public void debug(java.lang.String ename,
                  java.lang.String info)
Debug function for printing random info Very handy for figuring out which element is blowing up on you and where.

Parameters:
ename - The name of the element.


Copyright © 2000 Dummy Corp. All Rights Reserved.