Codota Logo
Translate.decode
Code IndexAdd Codota to your IDE (free)

How to use
decode
method
in
org.htmlparser.util.Translate

Best Java code snippets using org.htmlparser.util.Translate.decode (Showing top 20 results out of 315)

  • Add the Codota plugin to your IDE and get smart completions
private void myMethod () {
Connection c =
  • Codota IconDataSource dataSource;dataSource.getConnection()
  • Codota IconString url;DriverManager.getConnection(url)
  • Codota IconIdentityDatabaseUtil.getDBConnection()
  • Smart code suggestions by Codota
}
origin: org.htmlparser/htmlparser

/**
 * Decode a string containing references.
 * Change all numeric character reference and character entity references
 * to unicode characters.
 * @param string The string to translate.
 */
public static String decode (String string)
{
  return decode(string, null);
}
origin: org.opencms/opencms-core

/**
 * Decodes entities in a string if it isn't null.<p>
 *
 * @param value the string for which to decode entities
 *
 * @return the string with the decoded entities
 */
protected static String decodeEntities(String value) {
  if (value != null) {
    value = Translate.decode(value);
  }
  return value;
}
origin: org.htmlparser/htmlparser

/**
 * Decode the characters in a string buffer containing references.
 * Change all numeric character reference and character entity references
 * to unicode characters.
 * @param buffer The StringBuffer containing references.
 * @return The decoded string.
 */
public static String decode (StringBuffer buffer)
{
  return decode (buffer.toString());
}
origin: com.bbossgroups/bboss-htmlparser

/**
 * Decode the characters in a string buffer containing references.
 * Change all numeric character reference and character entity references
 * to unicode characters.
 * @param buffer The StringBuilder containing references.
 * @return The decoded string.
 */
public static String decode (StringBuilder buffer)
{
  return decode (buffer.toString());
}
origin: com.bbossgroups/bboss-htmlparser

/**
 * Convert a reference to a unicode character.
 * Convert a single numeric character reference or character entity reference
 * to a unicode character.
 * @param string The string to convert. Of the form &xxxx; or &amp;#xxxx; with
 * or without the leading ampersand or trailing semi-colon.
 * @return The converted character or '' (zero) if the string is an
 * invalid reference.
 * @deprecated Use {@link #decode(String) decode}.
 */
public static char convertToChar (String string)
{
  return (decode (string).charAt (0));
}
origin: com.bbossgroups/bboss-htmlparser

/**
 * Convert a reference to a unicode character.
 * Convert a single numeric character reference or character entity reference
 * to a unicode character.
 * @param string The string to convert. Of the form &xxxx; or &amp;#xxxx; with
 * or without the leading ampersand or trailing semi-colon.
 * @param start The starting pooint in the string to look for a character reference.
 * @param end The ending point in the string to stop looking for a character reference.
 * @return The converted character or '' (zero) if the string is an
 * invalid reference.
 * @deprecated Use {@link #decode(String) decode}.
 */
public static char convertToChar (String string, int start, int end)
{
  return (decode (string.substring (start, end)).charAt (0));
}
origin: com.bbossgroups/bboss-htmlparser

  public String toPlainTextString() {
    return Translate.decode(delegate.toPlainTextString());
  }
}
origin: oaqa/knn4qa

private static String cleanText(String text) {
 return replaceNonBreakingSpaceWithOrdinarySpace(Translate.decode(text));
}
 
origin: com.bbossgroups/bboss-htmlparser

  /**
   * Numeric character reference and character entity reference to unicode codec.
   * Translate the <code>System.in</code> input into an encoded or decoded
   * stream and send the results to <code>System.out</code>.
   * @param args If arg[0] is <code>-encode</code> perform an encoding on
   * <code>System.in</code>, otherwise perform a decoding.
   */
  public static void main (String[] args)
  {
    boolean encode;

    if (0 < args.length && args[0].equalsIgnoreCase ("-encode"))
      encode = true;
    else
      encode = false;
    if (encode)
      encode (System.in, System.out);
    else
      decode (System.in, System.out);
  }
}
origin: org.htmlparser/htmlparser

  /**
   * Numeric character reference and character entity reference to unicode codec.
   * Translate the <code>System.in</code> input into an encoded or decoded
   * stream and send the results to <code>System.out</code>.
   * @param args If arg[0] is <code>-encode</code> perform an encoding on
   * <code>System.in</code>, otherwise perform a decoding.
   */
  public static void main (String[] args)
  {
    boolean encode;

    if (0 < args.length && args[0].equalsIgnoreCase ("-encode"))
      encode = true;
    else
      encode = false;
    if (encode)
      encode (System.in, System.out);
    else
      decode (System.in, System.out);
  }
}
origin: org.htmlparser/htmlparser

public void visitStringNode(Text stringNode) {
  String text = stringNode.getText();
  if (!preTagBeingProcessed) {
    text = Translate.decode(text);
    text = replaceNonBreakingSpaceWithOrdinarySpace(text);
  }
  textAccumulator.append(text);
}
origin: iipc/openwayback

/**
 * test of {@link Translate#decode(String)}
 * Note: we no longer use this method for decoding entities.
 */
public void testTranslate() {
  String orig = "http://foo.com/main?arg1=1&lang=2";
  String xlated = Translate.decode(orig);
  System.out.format("Orig(%s) xlated(%s)\n",orig,xlated);
  String orig2 = "&#32;               gaz.cgi?foo=bar&lang=2";
  String xlated2 = Translate.decode(orig2);
  System.out.format("Orig2(%s) xlated2(%s)\n",orig2,xlated2);
}

origin: com.bbossgroups/bboss-htmlparser

public void visitStringNode(Text stringNode) {
  String text = stringNode.getText();
  if (!preTagBeingProcessed) {
    text = Translate.decode(text);
    text = replaceNonBreakingSpaceWithOrdinarySpace(text);
  }
  textAccumulator.append(text);
}
origin: iipc/openwayback

private void compareDecodes(String orig) {
  String htmlparserDecoded = Translate.decode(orig);
  String apacheDecoded = StringEscapeUtils.unescapeHtml(orig);
  System.out.format("ORIGINAL:(%s)\n", orig);
  System.out.format("htmlparser:(%s)\n", htmlparserDecoded);
  System.out.format("apache:(%s)\n", apacheDecoded);
}

origin: org.htmlparser/htmlparser

/**
 * Appends the text to the output.
 * @param string The text node.
 */
public void visitStringNode (Text string)
{
  if (!mIsScript && !mIsStyle)
  {
    String text = string.getText ();
    if (!mIsPre)
    {
      text = Translate.decode (text);
      if (getReplaceNonBreakingSpaces ())
        text = text.replace ('\u00a0', ' ');
      if (getCollapse ())
        collapse (mBuffer, text);
      else
        mBuffer.append (text);
    }
    else
      mBuffer.append (text);
  }
}
origin: com.bbossgroups/bboss-htmlparser

/**
 * Appends the text to the output.
 * @param string The text node.
 */
public void visitStringNode (Text string)
{
  if (!mIsScript && !mIsStyle)
  {
    String text = string.getText ();
    if (!mIsPre)
    {
      text = Translate.decode (text);
      if (getReplaceNonBreakingSpaces ())
        text = text.replace ('\u00a0', ' ');
      if (getCollapse ())
        collapse (mBuffer, text);
      else
        mBuffer.append (text);
    }
    else
      mBuffer.append (text);
  }
}
origin: org.opencms/opencms-solr

private void appendText(String text) {
    text = Translate.decode(text);
    text = collapse(text);
origin: org.opencms/opencms-core

text = Translate.decode(text);
text = collapse(text);
origin: com.bbossgroups.pdp/pdp-cms

private void appendText(String text) {
    text = Translate.decode(text);
    text = collapse(text);
origin: com.bbossgroups/bboss-htmlparser

return (Translate.decode (ret));
org.htmlparser.utilTranslatedecode

Javadoc

Decode a string containing references. Change all numeric character reference and character entity references to unicode characters.

Popular methods of Translate

  • encode
    Encode a string to use references. Change all characters that are not ISO-8859-1 to their numeric ch
  • lookup
    Binary search for a reference.

Popular in Java

  • Making http post requests using okhttp
  • setContentView (Activity)
  • setRequestProperty (URLConnection)
    Sets the general request property. If a property with the key already exists, overwrite its value wi
  • getApplicationContext (Context)
  • Pointer (com.sun.jna)
    An abstraction for a native pointer data type. A Pointer instance represents, on the Java side, a na
  • MessageDigest (java.security)
    Uses a one-way hash function to turn an arbitrary number of bytes into a fixed-length byte sequence.
  • NoSuchElementException (java.util)
    Thrown when trying to retrieve an element past the end of an Enumeration or Iterator.
  • TimeUnit (java.util.concurrent)
    A TimeUnit represents time durations at a given unit of granularity and provides utility methods to
  • ServletException (javax.servlet)
    Defines a general exception a servlet can throw when it encounters difficulty.
  • JTextField (javax.swing)
Codota Logo
  • Products

    Search for Java codeSearch for JavaScript codeEnterprise
  • IDE Plugins

    IntelliJ IDEAWebStormAndroid StudioEclipseVisual Studio CodePyCharmSublime TextPhpStormVimAtomGoLandRubyMineEmacsJupyter
  • Company

    About UsContact UsCareers
  • Resources

    FAQBlogCodota Academy Plugin user guide Terms of usePrivacy policyJava Code IndexJavascript Code Index
Get Codota for your IDE now