nl.idgis.giserver
Class Tools

java.lang.Object
  extended by nl.idgis.giserver.Tools

public class Tools
extends java.lang.Object

Tools for the GiServer package.

  • tranform exception message to a HttpResponse exception format
  • calculation of the bounding box for a set of envelopes
  • transform a string to a qualified name with the given namespace.
  • catStrings concatenation of string to a set of strings

    Author:
    bretelerjj

    Constructor Summary
    Tools()
               
     
    Method Summary
    static java.lang.String catStrings(java.lang.String[] strings, java.lang.String catMnemonic)
              Concatenate set of string to one string.
    static java.net.URL createURL(java.lang.String fileName)
               
    static java.lang.String escapeXML(java.lang.String string)
              Replace special characters with XML escapes: & <small>(ampersand)</small> is replaced by &amp; < <small>(less than)</small> is replaced by &lt; > <small>(greater than)</small> is replaced by &gt; " <small>(double quote)</small> is replaced by &quot;
    static org.deegree.model.spatialschema.Envelope getBoundingEnvelope(org.deegree.model.spatialschema.Envelope[] envelopes)
              Calculate the bounding envelope for a collection of envelopes.
    static void respondException(javax.servlet.http.HttpServletRequest request, javax.servlet.http.HttpServletResponse response, java.lang.String exceptionString)
              Transform a exception message to a HttpServlet reponse exception signature.
    static org.deegree.datatypes.QualifiedName transformToQualifiedName(java.lang.String value, org.deegree.framework.xml.NamespaceContext nsc)
              Transform a string to a qualified name with the given namespace domain.
    static org.deegree.datatypes.QualifiedName transformToQualifiedName(java.lang.String value, java.lang.String namespace)
              Transform a string to a qualified name with the given namespace.
     
    Methods inherited from class java.lang.Object
    equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
     

    Constructor Detail

    Tools

    public Tools()
    Method Detail

    respondException

    public static void respondException(javax.servlet.http.HttpServletRequest request,
                                        javax.servlet.http.HttpServletResponse response,
                                        java.lang.String exceptionString)
    Transform a exception message to a HttpServlet reponse exception signature.

    Parameters:
    request - HttpServlet request.
    response - HttpServlet respons.
    exceptionString - the message from a exception

    getBoundingEnvelope

    public static org.deegree.model.spatialschema.Envelope getBoundingEnvelope(org.deegree.model.spatialschema.Envelope[] envelopes)
    Calculate the bounding envelope for a collection of envelopes.

    Parameters:
    envelopes - the envelopes which determine the result.
    Returns:
    calculated envelope

    transformToQualifiedName

    public static org.deegree.datatypes.QualifiedName transformToQualifiedName(java.lang.String value,
                                                                               java.lang.String namespace)
    Transform a string to a qualified name with the given namespace.

    Parameters:
    value - the name string to be converted
    nsc - the given name space
    Returns:
    QualifiedName

    transformToQualifiedName

    public static org.deegree.datatypes.QualifiedName transformToQualifiedName(java.lang.String value,
                                                                               org.deegree.framework.xml.NamespaceContext nsc)
    Transform a string to a qualified name with the given namespace domain. The prefix is the key for namespace in the domain.

    Parameters:
    value - the name string to be converted
    nsc - the given name space domain
    Returns:
    QualifiedName

    catStrings

    public static java.lang.String catStrings(java.lang.String[] strings,
                                              java.lang.String catMnemonic)
    Concatenate set of string to one string.

    Parameters:
    strings - the set of strings available for concatenation.
    catMnemonic - concatenation mnemonic between two concatenated strings.
    Returns:
    concatenated string

    createURL

    public static java.net.URL createURL(java.lang.String fileName)
                                  throws java.net.MalformedURLException
    Throws:
    java.net.MalformedURLException

    escapeXML

    public static java.lang.String escapeXML(java.lang.String string)
    Replace special characters with XML escapes:
     & <small>(ampersand)</small> is replaced by &amp;
     < <small>(less than)</small> is replaced by &lt;
     > <small>(greater than)</small> is replaced by &gt;
     " <small>(double quote)</small> is replaced by &quot;
     

    Parameters:
    string - The string to be escaped.
    Returns:
    The escaped string.