/** * Call this method to register a char to String mapping, for example * to map '<' to "<". * @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 "<" * <li> '>' to ">" * <li> '&' to "&" * <li> '"' to """ * </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; }
/** * Map a character to a String. For example given * the character '>' this method would return the fully decorated * entity name "<". * Strings for entity references are loaded from a properties file, * but additional mappings defined through calls to defineChar2String() * are possible. Such entity reference mappings could be over-ridden. * * This is reusing a stored key object, in an effort to avoid * heap activity. Unfortunately, that introduces a threading risk. * Simplest fix for now is to make it a synchronized method, or to give * up the reuse; I see very little performance difference between them. * Long-term solution would be to replace the hashtable with a sparse array * keyed directly from the character's integer value; see DTM's * string pool for a related solution. * * @param value The character that should be resolved to * a String, e.g. resolve '>' to "<". * * @return The String that the character is mapped to, or null if not found. * @xsl.usage internal */ String getOutputStringForChar(char value) { // CharKey m_charKey = new CharKey(); //Alternative to synchronized m_charKey.setChar(value); return (String) m_charToString.get(m_charKey); }
/** * Map a character to a String. For example given * the character '>' this method would return the fully decorated * entity name "<". * Strings for entity references are loaded from a properties file, * but additional mappings defined through calls to defineChar2String() * are possible. Such entity reference mappings could be over-ridden. * * This is reusing a stored key object, in an effort to avoid * heap activity. Unfortunately, that introduces a threading risk. * Simplest fix for now is to make it a synchronized method, or to give * up the reuse; I see very little performance difference between them. * Long-term solution would be to replace the hashtable with a sparse array * keyed directly from the character's integer value; see DTM's * string pool for a related solution. * * @param value The character that should be resolved to * a String, e.g. resolve '>' to "<". * * @return The String that the character is mapped to, or null if not found. * @xsl.usage internal */ String getOutputStringForChar(char value) { // CharKey m_charKey = new CharKey(); //Alternative to synchronized m_charKey.setChar(value); return (String) m_charToString.get(m_charKey); }
/** * Map a character to a String. For example given * the character '>' this method would return the fully decorated * entity name "<". * Strings for entity references are loaded from a properties file, * but additional mappings defined through calls to defineChar2String() * are possible. Such entity reference mappings could be over-ridden. * * This is reusing a stored key object, in an effort to avoid * heap activity. Unfortunately, that introduces a threading risk. * Simplest fix for now is to make it a synchronized method, or to give * up the reuse; I see very little performance difference between them. * Long-term solution would be to replace the hashtable with a sparse array * keyed directly from the character's integer value; see DTM's * string pool for a related solution. * * @param value The character that should be resolved to * a String, e.g. resolve '>' to "<". * * @return The String that the character is mapped to, or null if not found. * @xsl.usage internal */ String getOutputStringForChar(char value) { // CharKey m_charKey = new CharKey(); //Alternative to synchronized m_charKey.setChar(value); return (String) m_charToString.get(m_charKey); }
/** * Map a character to a String. For example given * the character '>' this method would return the fully decorated * entity name "<". * Strings for entity references are loaded from a properties file, * but additional mappings defined through calls to defineChar2String() * are possible. Such entity reference mappings could be over-ridden. * * This is reusing a stored key object, in an effort to avoid * heap activity. Unfortunately, that introduces a threading risk. * Simplest fix for now is to make it a synchronized method, or to give * up the reuse; I see very little performance difference between them. * Long-term solution would be to replace the hashtable with a sparse array * keyed directly from the character's integer value; see DTM's * string pool for a related solution. * * @param value The character that should be resolved to * a String, e.g. resolve '>' to "<". * * @return The String that the character is mapped to, or null if not found. * @xsl.usage internal */ String getOutputStringForChar(char value) { // CharKey m_charKey = new CharKey(); //Alternative to synchronized m_charKey.setChar(value); return (String) m_charToString.get(m_charKey); }
/** * Map a character to a String. For example given * the character '>' this method would return the fully decorated * entity name "<". * Strings for entity references are loaded from a properties file, * but additional mappings defined through calls to defineChar2String() * are possible. Such entity reference mappings could be over-ridden. * * This is reusing a stored key object, in an effort to avoid * heap activity. Unfortunately, that introduces a threading risk. * Simplest fix for now is to make it a synchronized method, or to give * up the reuse; I see very little performance difference between them. * Long-term solution would be to replace the hashtable with a sparse array * keyed directly from the character's integer value; see DTM's * string pool for a related solution. * * @param value The character that should be resolved to * a String, e.g. resolve '>' to "<". * * @return The String that the character is mapped to, or null if not found. * @xsl.usage internal */ String getOutputStringForChar(char value) { // CharKey m_charKey = new CharKey(); //Alternative to synchronized m_charKey.setChar(value); return (String) m_charToString.get(m_charKey); }
/** * Map a character to a String. For example given * the character '>' this method would return the fully decorated * entity name "<". * Strings for entity references are loaded from a properties file, * but additional mappings defined through calls to defineChar2String() * are possible. Such entity reference mappings could be over-ridden. * * This is reusing a stored key object, in an effort to avoid * heap activity. Unfortunately, that introduces a threading risk. * Simplest fix for now is to make it a synchronized method, or to give * up the reuse; I see very little performance difference between them. * Long-term solution would be to replace the hashtable with a sparse array * keyed directly from the character's integer value; see DTM's * string pool for a related solution. * * @param value The character that should be resolved to * a String, e.g. resolve '>' to "<". * * @return The String that the character is mapped to, or null if not found. * @xsl.usage internal */ String getOutputStringForChar(char value) { // CharKey m_charKey = new CharKey(); //Alternative to synchronized m_charKey.setChar(value); return (String) m_charToString.get(m_charKey); }
/** * Map a character to a String. For example given * the character '>' this method would return the fully decorated * entity name "<". * Strings for entity references are loaded from a properties file, * but additional mappings defined through calls to defineChar2String() * are possible. Such entity reference mappings could be over-ridden. * * This is reusing a stored key object, in an effort to avoid * heap activity. Unfortunately, that introduces a threading risk. * Simplest fix for now is to make it a synchronized method, or to give * up the reuse; I see very little performance difference between them. * Long-term solution would be to replace the hashtable with a sparse array * keyed directly from the character's integer value; see DTM's * string pool for a related solution. * * @param value The character that should be resolved to * a String, e.g. resolve '>' to "<". * * @return The String that the character is mapped to, or null if not found. * @xsl.usage internal */ String getOutputStringForChar(char value) { // CharKey m_charKey = new CharKey(); //Alternative to synchronized m_charKey.setChar(value); return (String) m_charToString.get(m_charKey); }
/** * Map a character to a String. For example given * the character '>' this method would return the fully decorated * entity name "<". * Strings for entity references are loaded from a properties file, * but additional mappings defined through calls to defineChar2String() * are possible. Such entity reference mappings could be over-ridden. * * This is reusing a stored key object, in an effort to avoid * heap activity. Unfortunately, that introduces a threading risk. * Simplest fix for now is to make it a synchronized method, or to give * up the reuse; I see very little performance difference between them. * Long-term solution would be to replace the hashtable with a sparse array * keyed directly from the character's integer value; see DTM's * string pool for a related solution. * * @param value The character that should be resolved to * a String, e.g. resolve '>' to "<". * * @return The String that the character is mapped to, or null if not found. * @xsl.usage internal */ String getOutputStringForChar(char value) { // CharKey m_charKey = new CharKey(); //Alternative to synchronized m_charKey.setChar(value); return (String) m_charToString.get(m_charKey); }
/** * Map a character to a String. For example given * the character '>' this method would return the fully decorated * entity name "<". * Strings for entity references are loaded from a properties file, * but additional mappings defined through calls to defineChar2String() * are possible. Such entity reference mappings could be over-ridden. * * This is reusing a stored key object, in an effort to avoid * heap activity. Unfortunately, that introduces a threading risk. * Simplest fix for now is to make it a synchronized method, or to give * up the reuse; I see very little performance difference between them. * Long-term solution would be to replace the hashtable with a sparse array * keyed directly from the character's integer value; see DTM's * string pool for a related solution. * * @param value The character that should be resolved to * a String, e.g. resolve '>' to "<". * * @return The String that the character is mapped to, or null if not found. * @xsl.usage internal */ String getOutputStringForChar(char value) { // CharKey m_charKey = new CharKey(); //Alternative to synchronized m_charKey.setChar(value); return (String) m_charToString.get(m_charKey); }
/** * Map a character to a String. For example given * the character '>' this method would return the fully decorated * entity name "<". * Strings for entity references are loaded from a properties file, * but additional mappings defined through calls to defineChar2String() * are possible. Such entity reference mappings could be over-ridden. * * This is reusing a stored key object, in an effort to avoid * heap activity. Unfortunately, that introduces a threading risk. * Simplest fix for now is to make it a synchronized method, or to give * up the reuse; I see very little performance difference between them. * Long-term solution would be to replace the hashtable with a sparse array * keyed directly from the character's integer value; see DTM's * string pool for a related solution. * * @param value The character that should be resolved to * a String, e.g. resolve '>' to "<". * * @return The String that the character is mapped to, or null if not found. * @xsl.usage internal */ String getOutputStringForChar(char value) { // CharKey m_charKey = new CharKey(); //Alternative to synchronized m_charKey.setChar(value); return (String) m_charToString.get(m_charKey); }
/** * Map a character to a String. For example given * the character '>' this method would return the fully decorated * entity name "<". * Strings for entity references are loaded from a properties file, * but additional mappings defined through calls to defineChar2String() * are possible. Such entity reference mappings could be over-ridden. * * This is reusing a stored key object, in an effort to avoid * heap activity. Unfortunately, that introduces a threading risk. * Simplest fix for now is to make it a synchronized method, or to give * up the reuse; I see very little performance difference between them. * Long-term solution would be to replace the hashtable with a sparse array * keyed directly from the character's integer value; see DTM's * string pool for a related solution. * * @param value The character that should be resolved to * a String, e.g. resolve '>' to "<". * * @return The String that the character is mapped to, or null if not found. * @xsl.usage internal */ String getOutputStringForChar(char value) { // CharKey m_charKey = new CharKey(); //Alternative to synchronized m_charKey.setChar(value); return (String) m_charToString.get(m_charKey); }
/** * Map a character to a String. For example given * the character '>' this method would return the fully decorated * entity name "<". * Strings for entity references are loaded from a properties file, * but additional mappings defined through calls to defineChar2String() * are possible. Such entity reference mappings could be over-ridden. * * This is reusing a stored key object, in an effort to avoid * heap activity. Unfortunately, that introduces a threading risk. * Simplest fix for now is to make it a synchronized method, or to give * up the reuse; I see very little performance difference between them. * Long-term solution would be to replace the hashtable with a sparse array * keyed directly from the character's integer value; see DTM's * string pool for a related solution. * * @param value The character that should be resolved to * a String, e.g. resolve '>' to "<". * * @return The String that the character is mapped to, or null if not found. * @xsl.usage internal */ String getOutputStringForChar(char value) { // CharKey m_charKey = new CharKey(); //Alternative to synchronized m_charKey.setChar(value); return (String) m_charToString.get(m_charKey); }
/** * 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; }
/** * Call this method to register a char to String mapping, for example * to map '<' to "<". * @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 "<" * <li> '>' to ">" * <li> '&' to "&" * <li> '"' to """ * </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; }
/** * 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; }
/** * 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; }
/** * 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; }
/** * Call this method to register a char to String mapping, for example * to map '<' to "<". * @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 "<" * <li> '>' to ">" * <li> '&' to "&" * <li> '"' to """ * </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; }
/** * Call this method to register a char to String mapping, for example * to map '<' to "<". * @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 "<" * <li> '>' to ">" * <li> '&' to "&" * <li> '"' to """ * </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; }