org.mmbase.richtext.processors.xml
Class Util

java.lang.Object
  extended by org.mmbase.richtext.processors.xml.Util

public abstract class Util
extends Object

Utility functions, used by various classes in the package.

Version:
$Id: Util.java 35335 2009-05-21 08:14:41Z michiel $
Author:
Michiel Meeuwissen

Field Summary
static Pattern ABSOLUTE_URL
           
(package private) static long indexCounter
          Used for generating unique id's
(package private) static Pattern OK_URL
           
 
Constructor Summary
Util()
           
 
Method Summary
static void copyAttributes(Element source, Element destination)
           
static void copyChilds(Element source, Element destination)
           
static NodeList get(Cloud cloud, NodeList list, String field, String value)
          Just searches the nodes in a NodeList for which a certain field has a certain value.
static String getCssClass(Set<String> classes)
           
static String getCssClass(String cl)
           
static String getCssClass(String cl, Set<String> allowed)
           
static SortedSet<String> getCssClasses(String cl, Set<String> allowed)
           
static NodeList getRelatedNodes(Node editedNode, NodeManager dest)
           
static Node getUrlNode(Cloud cloud, String href, Element a)
           
static String normalizeURL(HttpServletRequest request, String url)
          Normalizes URL to absolute on server
static String normalizeURL(String url)
          Adds missing protocol
static String normalizeWhiteSpace(String s)
           
static Document parse(InputStream value)
          Just parses InputStream to Document (without validation).
static Document parse(Object value)
          Just parses String to Document
static String toString(Object value)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

indexCounter

static long indexCounter
Used for generating unique id's


ABSOLUTE_URL

public static final Pattern ABSOLUTE_URL

OK_URL

static final Pattern OK_URL
Constructor Detail

Util

public Util()
Method Detail

parse

public static Document parse(Object value)
                      throws ParserConfigurationException,
                             SAXException,
                             IOException
Just parses String to Document

Throws:
ParserConfigurationException
SAXException
IOException

parse

public static Document parse(InputStream value)
                      throws ParserConfigurationException,
                             SAXException,
                             IOException
Just parses InputStream to Document (without validation).

Throws:
ParserConfigurationException
SAXException
IOException

copyAttributes

public static void copyAttributes(Element source,
                                  Element destination)

copyChilds

public static void copyChilds(Element source,
                              Element destination)

getCssClasses

public static SortedSet<String> getCssClasses(String cl,
                                              Set<String> allowed)

getCssClass

public static String getCssClass(Set<String> classes)

getCssClass

public static String getCssClass(String cl,
                                 Set<String> allowed)

getCssClass

public static String getCssClass(String cl)

normalizeWhiteSpace

public static String normalizeWhiteSpace(String s)
Since:
MMBase-1.9

get

public static NodeList get(Cloud cloud,
                           NodeList list,
                           String field,
                           String value)
Just searches the nodes in a NodeList for which a certain field has a certain value.


getUrlNode

public static Node getUrlNode(Cloud cloud,
                              String href,
                              Element a)

normalizeURL

public static String normalizeURL(HttpServletRequest request,
                                  String url)
Normalizes URL to absolute on server


normalizeURL

public static String normalizeURL(String url)
Adds missing protocol


getRelatedNodes

public static NodeList getRelatedNodes(Node editedNode,
                                       NodeManager dest)

toString

public static String toString(Object value)


MMBase 2.0-SNAPSHOT - null