congrats Icon
New! Announcing Tabnine Chat Beta
Learn More
Tabnine Logo
CharInfo
Code IndexAdd Tabnine to your IDE (free)

How to use
CharInfo
in
org.apache.xml.serializer

Best Java code snippets using org.apache.xml.serializer.CharInfo (Showing top 20 results out of 315)

origin: robovm/robovm

      public Object run() {
        return new CharInfo(entitiesFileName, 
         method, internal);}
});            
origin: robovm/robovm

/**
 * Creates a new empty set of integers (characters)
 * @param max the maximum integer to be in the set.
 */
private int[] createEmptySetOfIntegers(int max) {
  firstWordNotUsed = 0; // an optimization 
  int[] arr = new int[arrayIndex(max - 1) + 1];
    return arr;
}
origin: robovm/robovm

/**
 * A base constructor just to explicitly create the fields,
 * with the exception of m_charToString which is handled
 * by the constructor that delegates base construction to this one.
 * <p>
 * m_charToString is not created here only for performance reasons,
 * to avoid creating a Hashtable that will be replaced when
 * making a mutable copy, {@link #mutableCopyOf(CharInfo)}. 
 *
 */
private CharInfo() 
{
  this.array_of_bits = createEmptySetOfIntegers(65535);
  this.firstWordNotUsed = 0;
  this.shouldMapAttrChar_ASCII = new boolean[ASCII_MAX];
  this.shouldMapTextChar_ASCII = new boolean[ASCII_MAX];
  this.m_charKey = new CharKey();
  
  // Not set here, but in a constructor that uses this one
  // this.m_charToString =  new Hashtable();  
  
  this.onlyQuotAmpLtGt = true;
  
  return;
}

origin: robovm/robovm

/**
 * Call this method to register a char to String mapping, for example
 * to map '<' to "&lt;".
 * @param outputString The String to map to.
 * @param inputChar The char to map from.
 * @return true if the mapping is not one of:
 * <ul>
 * <li> '<' to "&lt;"
 * <li> '>' to "&gt;"
 * <li> '&' to "&amp;"
 * <li> '"' to "&quot;"
 * </ul>
 */
boolean defineChar2StringMapping(String outputString, char inputChar) 
{
  CharKey character = new CharKey(inputChar);
  m_charToString.put(character, outputString);
  set(inputChar);  // mark the character has having a mapping to a String
  
  boolean extraMapping = extraEntity(outputString, inputChar);
  return extraMapping;
    
}
origin: robovm/robovm

if ((fromTextNode && m_charInfo.shouldMapTextChar(ch)) || (!fromTextNode && m_charInfo.shouldMapAttrChar(ch)))
  String outputStringForChar = m_charInfo.getOutputStringForChar(ch);
origin: robovm/robovm

  return mutableCopyOf(charInfo);
  charInfo = getCharInfoBasedOnPrivilege(entitiesFileName, 
                method, true);
  return mutableCopyOf(charInfo);
} catch (Exception e) {}
  return getCharInfoBasedOnPrivilege(entitiesFileName, 
            method, false);
} catch (Exception e) {}
return getCharInfoBasedOnPrivilege(entitiesFileName, 
            method, false);
origin: robovm/robovm

/**
 * Tell if the character argument that is from
 * an attribute value has a mapping to a String.
 * 
 * @param value the value of a character that is in an attribute value
 * @return true if the character should have any special treatment, 
 * such as when writing out entity references.
 * @xsl.usage internal
 */
final boolean shouldMapAttrChar(int value)
{
  // for performance try the values in the boolean array first,
  // this is faster access than the BitSet for common ASCII values
  if (value < ASCII_MAX)
    return shouldMapAttrChar_ASCII[value];
  // rather than java.util.BitSet, our private
  // implementation is faster (and less general).
  return get(value);
}    
origin: robovm/robovm

/**
 * Defines a new character reference. The reference's name and value are
 * supplied. Nothing happens if the character reference is already defined.
 * <p>Unlike internal entities, character references are a string to single
 * character mapping. They are used to map non-ASCII characters both on
 * parsing and printing, primarily for HTML documents. '&amp;lt;' is an
 * example of a character reference.</p>
 *
 * @param name The entity's name
 * @param value The entity's value
 * @return true if the mapping is not one of:
 * <ul>
 * <li> '<' to "&lt;"
 * <li> '>' to "&gt;"
 * <li> '&' to "&amp;"
 * <li> '"' to "&quot;"
 * </ul>
 */
private boolean defineEntity(String name, char value)
{
  StringBuffer sb = new StringBuffer("&");
  sb.append(name);
  sb.append(';');
  String entityString = sb.toString();
  
  boolean extra = defineChar2StringMapping(entityString, value);
  return extra;
}
origin: robovm/robovm

  (String) format.get(OutputKeys.METHOD);
m_charInfo = CharInfo.getCharInfo(entitiesFileName, method);
origin: robovm/robovm

String value = entities.getString(name);
int code = Integer.parseInt(value);
boolean extra = defineEntity(name, (char) code);
if (extra)
  noExtraEntities = false;
      boolean extra = defineEntity(name, (char) code);
      if (extra)
        noExtraEntities = false;
origin: robovm/robovm

if (escapingNotNeeded(ch) && (!m_charInfo.shouldMapAttrChar(ch)))
    String outputStringForChar = m_charInfo.getOutputStringForChar(ch);
    if (null != outputStringForChar)
origin: robovm/robovm

char ch1 = chars[i];
if (m_charInfo.shouldMapTextChar(ch1)) {
      .getOutputStringForChar(ch1);
  writer.write(outputStringForChar);
if (m_charInfo.shouldMapTextChar(ch)) {
  String outputStringForChar = m_charInfo.getOutputStringForChar(ch);
  writer.write(outputStringForChar);
  lastDirtyCharProcessed = i;
origin: MobiVM/robovm

if ((fromTextNode && m_charInfo.shouldMapTextChar(ch)) || (!fromTextNode && m_charInfo.shouldMapAttrChar(ch)))
  String outputStringForChar = m_charInfo.getOutputStringForChar(ch);
origin: ibinti/bugvm

/**
 * Call this method to register a char to String mapping, for example
 * to map '<' to "&lt;".
 * @param outputString The String to map to.
 * @param inputChar The char to map from.
 * @return true if the mapping is not one of:
 * <ul>
 * <li> '<' to "&lt;"
 * <li> '>' to "&gt;"
 * <li> '&' to "&amp;"
 * <li> '"' to "&quot;"
 * </ul>
 */
boolean defineChar2StringMapping(String outputString, char inputChar) 
{
  CharKey character = new CharKey(inputChar);
  m_charToString.put(character, outputString);
  set(inputChar);  // mark the character has having a mapping to a String
  
  boolean extraMapping = extraEntity(outputString, inputChar);
  return extraMapping;
    
}
origin: MobiVM/robovm

  return mutableCopyOf(charInfo);
  charInfo = getCharInfoBasedOnPrivilege(entitiesFileName, 
                method, true);
  return mutableCopyOf(charInfo);
} catch (Exception e) {}
  return getCharInfoBasedOnPrivilege(entitiesFileName, 
            method, false);
} catch (Exception e) {}
return getCharInfoBasedOnPrivilege(entitiesFileName, 
            method, false);
origin: robovm/robovm

/**
 * Tell if the character argument that is from a 
 * text node has a mapping to a String, for example
 * to map '<' to "&lt;".
 * 
 * @param value the value of a character that is in a text node
 * @return true if the character has a mapping to a String, 
 * such as when writing out entity references.
 * @xsl.usage internal
 */
final boolean shouldMapTextChar(int value)
{
  // for performance try the values in the boolean array first,
  // this is faster access than the BitSet for common ASCII values
  if (value < ASCII_MAX)
    return shouldMapTextChar_ASCII[value];
  // rather than java.util.BitSet, our private
  // implementation is faster (and less general).
  return get(value);
}

origin: xalan/serializer

/**
 * Defines a new character reference. The reference's name and value are
 * supplied. Nothing happens if the character reference is already defined.
 * <p>Unlike internal entities, character references are a string to single
 * character mapping. They are used to map non-ASCII characters both on
 * parsing and printing, primarily for HTML documents. '&amp;lt;' is an
 * example of a character reference.</p>
 *
 * @param name The entity's name
 * @param value The entity's value
 * @return true if the mapping is not one of:
 * <ul>
 * <li> '<' to "&lt;"
 * <li> '>' to "&gt;"
 * <li> '&' to "&amp;"
 * <li> '"' to "&quot;"
 * </ul>
 */
private boolean defineEntity(String name, char value)
{
  StringBuffer sb = new StringBuffer("&");
  sb.append(name);
  sb.append(';');
  String entityString = sb.toString();
  
  boolean extra = defineChar2StringMapping(entityString, value);
  return extra;
}
origin: MobiVM/robovm

  (String) format.get(OutputKeys.METHOD);
m_charInfo = CharInfo.getCharInfo(entitiesFileName, method);
origin: ibinti/bugvm

String value = entities.getString(name);
int code = Integer.parseInt(value);
boolean extra = defineEntity(name, (char) code);
if (extra)
  noExtraEntities = false;
      boolean extra = defineEntity(name, (char) code);
      if (extra)
        noExtraEntities = false;
origin: ibinti/bugvm

if ((fromTextNode && m_charInfo.shouldMapTextChar(ch)) || (!fromTextNode && m_charInfo.shouldMapAttrChar(ch)))
  String outputStringForChar = m_charInfo.getOutputStringForChar(ch);
org.apache.xml.serializerCharInfo

Javadoc

This class provides services that tell if a character should have special treatement, such as entity reference substitution or normalization of a newline character. It also provides character to entity reference lookup. DEVELOPERS: See Known Issue in the constructor.

Most used methods

  • <init>
  • arrayIndex
    Returns the array element holding the bit value for the given integer
  • createEmptySetOfIntegers
    Creates a new empty set of integers (characters)
  • defineChar2StringMapping
    Call this method to register a char to String mapping, for example to map '
  • defineEntity
    Defines a new character reference. The reference's name and value are supplied. Nothing happens if t
  • extraEntity
    This method returns true if there are some non-standard mappings to entities other than quot, amp, l
  • get
    Return true if the integer (character)is in the set of integers. This implementation uses an array o
  • getCharInfo
    Factory that reads in a resource file that describes the mapping of characters to entity references.
  • getCharInfoBasedOnPrivilege
  • getOutputStringForChar
    Map a character to a String. For example given the character '>' this method would return the fully
  • mutableCopyOf
    Create a mutable copy of the cached one.
  • set
    Adds the integer (character) to the set of integers.
  • mutableCopyOf,
  • set,
  • setASCIIattrDirty,
  • setASCIItextDirty,
  • shouldMapAttrChar,
  • shouldMapTextChar

Popular in Java

  • Start an intent from android
  • compareTo (BigDecimal)
  • startActivity (Activity)
  • getApplicationContext (Context)
  • FileInputStream (java.io)
    An input stream that reads bytes from a file. File file = ...finally if (in != null) in.clos
  • Arrays (java.util)
    This class contains various methods for manipulating arrays (such as sorting and searching). This cl
  • TimeZone (java.util)
    TimeZone represents a time zone offset, and also figures out daylight savings. Typically, you get a
  • TreeMap (java.util)
    Walk the nodes of the tree left-to-right or right-to-left. Note that in descending iterations, next
  • ExecutorService (java.util.concurrent)
    An Executor that provides methods to manage termination and methods that can produce a Future for tr
  • Annotation (javassist.bytecode.annotation)
    The annotation structure.An instance of this class is returned bygetAnnotations() in AnnotationsAttr
  • Top PhpStorm plugins
Tabnine Logo
  • Products

    Search for Java codeSearch for JavaScript code
  • IDE Plugins

    IntelliJ IDEAWebStormVisual StudioAndroid StudioEclipseVisual Studio CodePyCharmSublime TextPhpStormVimGoLandRubyMineEmacsJupyter NotebookJupyter LabRiderDataGripAppCode
  • Company

    About UsContact UsCareers
  • Resources

    FAQBlogTabnine AcademyTerms of usePrivacy policyJava Code IndexJavascript Code Index
Get Tabnine for your IDE now