Class XMLTextHelper

java.lang.Object
fr.becpg.repo.helper.XMLTextHelper

public class XMLTextHelper extends Object

XMLTextHelper class.

Version:
$Id: $Id
Author:
matthieu
  • Constructor Details

    • XMLTextHelper

      private XMLTextHelper()

      Constructor for XMLTextHelper.

  • Method Details

    • writeCData

      public static String writeCData(String in)

      writeCData.

      Parameters:
      in - a String object
      Returns:
      a String object
    • isXmlChar

      public static boolean isXmlChar(int codePoint)
      Tells whether a code point may appear in an XML 1.0 document. Control characters such as the optional and non breaking hyphens Word puts in copied text (U+001F, U+001E) may not, even escaped.
      Parameters:
      codePoint - the code point to test
      Returns:
      true if the code point is allowed
    • hasInvalidChar

      public static boolean hasInvalidChar(String in)
      Tells whether a text holds a character that may not appear in an XML 1.0 document and that the datasource writer therefore drops.
      Parameters:
      in - the text to test, possibly null
      Returns:
      true if at least one character is not allowed
    • indexOfInvalidChar

      private static int indexOfInvalidChar(String in, int from)
    • writeAttribute

      public static String writeAttribute(String in)

      writeAttribute.

      Parameters:
      in - a String object
      Returns:
      a String object
    • writeContent

      public static String writeContent(String in)

      writeContent.

      Parameters:
      in - a String object
      Returns:
      a String object