org.apache.cocoon
Class Utils

java.lang.Object
  |
  +--org.apache.cocoon.Utils

public final class Utils
extends java.lang.Object

Utility methods for Cocoon and its classes.

Version:
$Revision: 1.7 $ $Date: 1999/10/25 14:03:38 $
Author:
Stefano Mazzocchi

Constructor Summary
Utils()
           
 
Method Summary
static java.lang.String encode(javax.servlet.http.HttpServletRequest req)
          Encodes the given request into a string using the format protocol://serverName:serverPort/requestURI?
static java.lang.String encode(javax.servlet.http.HttpServletRequest req, boolean agent)
          Encodes the given request into a string using the format userAgent:protocol://serverName:serverPort/requestURI?
static java.lang.String encode(javax.servlet.http.HttpServletRequest req, boolean agent, boolean query)
          Encodes the given request into a string using the format userAgent:protocol://serverName:serverPort/requestURI?
static java.util.Vector getAllPIs(org.w3c.dom.Document document, java.lang.String name)
          This method returns a vector of PI nodes based on the PI target name.
static java.util.Vector getAllPIs(org.w3c.dom.Document document, java.lang.String name, boolean remove)
          This method returns a vector of PI nodes based on the PI target name and removes the found PIs from the document if the remove flag is true.
static org.w3c.dom.ProcessingInstruction getFirstPI(org.w3c.dom.Document document, java.lang.String name)
          This method returns the first PI node based on the PI target name.
static org.w3c.dom.ProcessingInstruction getFirstPI(org.w3c.dom.Document document, java.lang.String name, boolean remove)
          This method returns the first PI node based on the PI target name and removes it from the document if the remove flag is true.
static java.util.Hashtable getPIPseudoAttributes(org.w3c.dom.Document document, java.lang.String name)
          This method returns an hashtable with all the pseudo attributes collected in the document.
static java.util.Hashtable getPIPseudoAttributes(org.w3c.dom.ProcessingInstruction pi)
          This method returns an hashtable of pseudo attributes found in the first occurrence of the PI with the given name in the given document.
 
Methods inherited from class java.lang.Object
, clone, equals, finalize, getClass, hashCode, notify, notifyAll, registerNatives, toString, wait, wait, wait
 

Constructor Detail

Utils

public Utils()
Method Detail

getAllPIs

public static final java.util.Vector getAllPIs(org.w3c.dom.Document document,
                                               java.lang.String name)
This method returns a vector of PI nodes based on the PI target name.

getAllPIs

public static final java.util.Vector getAllPIs(org.w3c.dom.Document document,
                                               java.lang.String name,
                                               boolean remove)
This method returns a vector of PI nodes based on the PI target name and removes the found PIs from the document if the remove flag is true.

getFirstPI

public static final org.w3c.dom.ProcessingInstruction getFirstPI(org.w3c.dom.Document document,
                                                                 java.lang.String name)
This method returns the first PI node based on the PI target name.

getFirstPI

public static final org.w3c.dom.ProcessingInstruction getFirstPI(org.w3c.dom.Document document,
                                                                 java.lang.String name,
                                                                 boolean remove)
This method returns the first PI node based on the PI target name and removes it from the document if the remove flag is true.

getPIPseudoAttributes

public static final java.util.Hashtable getPIPseudoAttributes(org.w3c.dom.Document document,
                                                              java.lang.String name)
This method returns an hashtable with all the pseudo attributes collected in the document. If more PI have the same target, the attributes are all put in the same hashtable. If there are collisions, the last attribute is insered.

getPIPseudoAttributes

public static final java.util.Hashtable getPIPseudoAttributes(org.w3c.dom.ProcessingInstruction pi)
This method returns an hashtable of pseudo attributes found in the first occurrence of the PI with the given name in the given document. No validation is performed on the PI pseudo syntax

encode

public static final java.lang.String encode(javax.servlet.http.HttpServletRequest req)
Encodes the given request into a string using the format protocol://serverName:serverPort/requestURI?query

encode

public static final java.lang.String encode(javax.servlet.http.HttpServletRequest req,
                                            boolean agent)
Encodes the given request into a string using the format userAgent:protocol://serverName:serverPort/requestURI?query with the agent flag controlling the presence of the userAgent field.

encode

public static final java.lang.String encode(javax.servlet.http.HttpServletRequest req,
                                            boolean agent,
                                            boolean query)
Encodes the given request into a string using the format userAgent:protocol://serverName:serverPort/requestURI?query with the agent flag controlling the presence of the userAgent field and the query flag controlling the query field.


Copyright 1999 Java Apache Project. All Rights Reserved.