| java.lang.Object org.openlaszlo.xml.internal.DataCommon
All known Subclasses: org.openlaszlo.xml.internal.DataCompiler,
DataCommon | abstract public class DataCommon (Code) | | Common data compiler routines between DataCompiler (XML compiler) and DataBuilder (Java API)
author: Henry Minsky version: 1.0 |
Method Summary | |
final public static void | _pushMergedStringData(String s, FlashBuffer body, DataContext dc) Push a reference to string data on stack. | final public static void | _pushMergedStringDataSymbol(String s, FlashBuffer body, DataContext dc) Push a reference to string data on stack. | final public static void | _pushStringData(String s, FlashBuffer body, DataContext dc) Push a reference to string data on stack. | final public static void | _writeOffset(int o, FlashBuffer fb) Writes a string offset from the constant pool to a flash buffer. | final public static int | addStringConstant(String s, DataContext dc) Intern a string in the constant pool. | public static int | getByteLength(String s, String encoding) | final public static int | getStringIndex(String s, DataContext dc) | final public static int | internString(String s, DataContext dc) | final public static byte[] | makeStringPool(DataContext dc) Return byte array containing the strings from the constant pool, sorted and zero terminated. | final public static int | maybeInternString(String s, DataContext dc) Intern a string in the constant pool, but only if it has been seen once before. | public static void | printProgram(Program program) For debugging, to print out a Program as hex values. | final public static void | pushMergedStringData(String s, FlashBuffer body, DataContext dc) Push a reference to string data on stack. | final public static void | pushMergedStringDataSymbol(String s, FlashBuffer body, DataContext dc) Push a reference to string data on stack. | final public static void | pushStringData(String s, FlashBuffer body, DataContext dc) Push a reference to string data on stack. | final public static void | writeFlashData(FlashBuffer body, byte[] data, int destPos) | final public static void | writeOffset(int o, FlashBuffer fb) |
BODY_NODE_INSTANTIATOR_FN | public static String BODY_NODE_INSTANTIATOR_FN(Code) | | |
NODE_INSTANTIATOR_FN | public static String NODE_INSTANTIATOR_FN(Code) | | |
RESULTSET_NODE_INSTANTIATOR_FN | public static String RESULTSET_NODE_INSTANTIATOR_FN(Code) | | |
ROOT_NODE_FINAL_FN | public static String ROOT_NODE_FINAL_FN(Code) | | |
ROOT_NODE_INSTANTIATOR_FN | public static String ROOT_NODE_INSTANTIATOR_FN(Code) | | |
TEXT_INSTANTIATOR_FN | public static String TEXT_INSTANTIATOR_FN(Code) | | |
_pushMergedStringData | final public static void _pushMergedStringData(String s, FlashBuffer body, DataContext dc)(Code) | | Push a reference to string data on stack. maybeInternString
uses a heuristic to decide whether to add the string constant
pool, so this may push a string literal or a dictionary ref.
This version of the method uses the faster _writeXXX() methods,
which do not do bounds checks on the FlashBuffer. So this should only be
used in situations where we know the FlashBuffer is already allocated with
enough space for any data we may push.
|
_pushMergedStringDataSymbol | final public static void _pushMergedStringDataSymbol(String s, FlashBuffer body, DataContext dc)(Code) | | Push a reference to string data on stack. Attempts to intern in the string pool
pool, so this may push a string literal or a dictionary ref. This routine uses the _writeXXX routines,
which bypass FlashBuffer's ensureCapacity(), so the FlashBuffer must have been allocated with enough
space for these writes, or an ArrayBoundsException may happen.
|
_pushStringData | final public static void _pushStringData(String s, FlashBuffer body, DataContext dc)(Code) | | Push a reference to string data on stack. maybeInternString
uses a heuristic to decide whether to add the string constant
pool, so this may push a string literal or a dictionary ref.
This version of the method uses the faster _writeXXX() methods,
which do not do bounds checks on the FlashBuffer. So this should only be
used in situations where we know the FlashBuffer is already allocated with
enough space for any data we may push.
|
_writeOffset | final public static void _writeOffset(int o, FlashBuffer fb)(Code) | | Writes a string offset from the constant pool to a flash buffer. This uses _writeXXX
which bypasses the FlashBuffer ensureCapacity() check (for speed) so you must make sure
the FlashBuffer is large enough to write these bytes.
Parameters: o - dictionary string index to write to flash buffer |
addStringConstant | final public static int addStringConstant(String s, DataContext dc)(Code) | | Intern a string in the constant pool.
Parameters: s - the string Parameters: dc - offset into string pool |
getStringIndex | final public static int getStringIndex(String s, DataContext dc)(Code) | | the index of the string in the constant pool. |
internString | final public static int internString(String s, DataContext dc)(Code) | | Intern a string in the constant pool
Parameters: s - the string Parameters: dc - the offset into string pool, or -1 if the string pool is full |
makeStringPool | final public static byte[] makeStringPool(DataContext dc)(Code) | | Return byte array containing the strings from the constant pool, sorted and zero terminated.
|
maybeInternString | final public static int maybeInternString(String s, DataContext dc)(Code) | | Intern a string in the constant pool, but only if it has been seen once before.
Parameters: s - the string Parameters: dc - the offset into string pool, or -1 if we decided not to intern it yet |
printProgram | public static void printProgram(Program program)(Code) | | For debugging, to print out a Program as hex values.
|
pushMergedStringData | final public static void pushMergedStringData(String s, FlashBuffer body, DataContext dc)(Code) | | Push a reference to string data on stack. maybeInternString
uses a heuristic to decide whether to add the string constant
pool, so this may push a string literal or a dictionary ref.
This method is used when composing the arguments for a PUSH
merges several args on the stack with a single PUSH
instruction, and writes out only the data or constant-pool
index reference, as opposed to the pushStringData() method
which also writes out the PUSH instruction itsef.
|
pushMergedStringDataSymbol | final public static void pushMergedStringDataSymbol(String s, FlashBuffer body, DataContext dc)(Code) | | Push a reference to string data on stack. Always attempts to intern in the string
pool, so this may push a string literal or a dictionary ref.
This method is designed to be called when pushing references to strings
which we are pretty sure will occur again, such as tag names or attribute names.
We try to put them into the string pool immediately, as opposed to using the
heuristic of waiting until the string is seen again before interning it.
|
pushStringData | final public static void pushStringData(String s, FlashBuffer body, DataContext dc)(Code) | | Push a reference to string data on stack. maybeInternString
uses a heuristic to decide whether to add the string constant
pool, so this may push a string literal or a dictionary ref.
|
writeFlashData | final public static void writeFlashData(FlashBuffer body, byte[] data, int destPos)(Code) | | Copy data from a a byte array into a FlashBuffer
|
writeOffset | final public static void writeOffset(int o, FlashBuffer fb)(Code) | | Writes a string offset from the constant pool to a flash buffer
Parameters: o - dictionary string index to write to flash buffer |
|
|