/** * Construct an adapter connecting the <code>DTMWSFilter</code> interface * to the <code>StripFilter</code> interface. * * @param translet A translet that also implements the StripFilter * interface. * * @see org.apache.xml.dtm.DTMWSFilter * @see org.apache.xalan.xsltc.StripFilter */ public DOMWSFilter(AbstractTranslet translet) { m_translet = translet; m_mappings = new Hashtable(); if (translet instanceof StripFilter) { m_filter = (StripFilter) translet; } }
/** * Allocate memory for the AttributeList * %OPT% Use on-demand allocation for the internal vectors. The memory * is only allocated when there is an attribute. This reduces the cost * of creating many small RTFs. */ private void alloc() { _attributes = new Hashtable(); _names = new Vector(); _values = new Vector(); _qnames = new Vector(); _uris = new Vector(); }
public void addAuxiliaryClass(Class auxClass) { if (_auxClasses == null) _auxClasses = new Hashtable(); _auxClasses.put(auxClass.getName(), auxClass); }
_document = node.getOwnerDocument(); _node2Ids = new Hashtable();
/** * Adds a DecimalFormat object to the _formatSymbols hashtable. * The entry is created with the input DecimalFormatSymbols. */ public void addDecimalFormat(String name, DecimalFormatSymbols symbols) { // Instanciate hashtable for formatting symbols if needed if (_formatSymbols == null) _formatSymbols = new Hashtable(); // The name cannot be null - use empty string instead if (name == null) name = EMPTYSTRING; // Construct a DecimalFormat object containing the symbols we got final DecimalFormat df = new DecimalFormat(); if (symbols != null) { df.setDecimalFormatSymbols(symbols); } _formatSymbols.put(name, df); }
/** * %HZ% Need Javadoc */ public Hashtable getElementsWithIDs() { if (m_idAttributes == null) { return null; } // Convert a java.util.Hashtable to an xsltc.runtime.Hashtable Iterator idEntries = m_idAttributes.entrySet().iterator(); if (!idEntries.hasNext()) { return null; } Hashtable idAttrsTable = new Hashtable(); while (idEntries.hasNext()) { Map.Entry entry = (Map.Entry) idEntries.next(); idAttrsTable.put(entry.getKey(), entry.getValue()); } return idAttrsTable; }
/** * Create an empty KeyIndex in the DOM case * @param name is the name of the index (the key or ##id) * @param dom is the DOM */ public void buildKeyIndex(String name, DOM dom) { if (_keyIndexes == null) _keyIndexes = new Hashtable(); KeyIndex index = (KeyIndex)_keyIndexes.get(name); if (index == null) { _keyIndexes.put(name, index = new KeyIndex(_indexSize)); } index.setDom(dom); }
/** * Adds a value to a key/id index * @param name is the name of the index (the key or ##id) * @param node is the node handle of the node to insert * @param value is the value that will look up the node in the given index */ public void buildKeyIndex(String name, int node, Object value) { if (_keyIndexes == null) _keyIndexes = new Hashtable(); KeyIndex index = (KeyIndex)_keyIndexes.get(name); if (index == null) { _keyIndexes.put(name, index = new KeyIndex(_indexSize)); } index.add(value, node, _currentRootForKeys); }
/** * Implements JAXP's Transformer.setParameter() * Add a parameter for the transformation. The parameter is simply passed * on to the translet - no validation is performed - so any unused * parameters are quitely ignored by the translet. * * @param name The name of the parameter * @param value The value to assign to the parameter */ public void setParameter(String name, Object value) { if (value == null) { ErrorMsg err = new ErrorMsg(ErrorMsg.JAXP_INVALID_SET_PARAM_VALUE, name); throw new IllegalArgumentException(err.toString()); } if (_isIdentity) { if (_parameters == null) { _parameters = new Hashtable(); } _parameters.put(name, value); } else { _translet.addParameter(name, value); } }
/** * Adds a node to the node list for a given value. Nodes will * always be added in document order. */ public void add(Object value, int node, int rootNode) { if (_currentDocumentNode != rootNode) { _currentDocumentNode = rootNode; _index = new Hashtable(); _rootToIndexMap.put(new Integer(rootNode), _index); } IntegerArray nodes = (IntegerArray) _index.get(value); if (nodes == null) { nodes = new IntegerArray(); _index.put(value, nodes); nodes.add(node); // Because nodes are added in document order, // duplicates can be eliminated easily at this stage. } else if (node != nodes.at(nodes.cardinality() - 1)) { nodes.add(node); } }
_auxClasses = new Hashtable();
/** * Return an IntegerArray for the DOM Node which has the given id. * * @param id The id * @return A IntegerArray representing the Node whose id is the given value. */ public IntegerArray getDOMNodeById(String id) { IntegerArray nodes = null; if (_enhancedDOM != null) { int ident = _enhancedDOM.getElementById(id); if (ident != DTM.NULL) { Integer root = new Integer(_enhancedDOM.getDocument()); Hashtable index = (Hashtable) _rootToIndexMap.get(root); if (index == null) { index = new Hashtable(); _rootToIndexMap.put(root, index); } else { nodes = (IntegerArray) index.get(id); } if (nodes == null) { nodes = new IntegerArray(); index.put(id, nodes); } nodes.add(_enhancedDOM.getNodeHandle(ident)); } } return nodes; }
/** * Allocate memory for the AttributeList * %OPT% Use on-demand allocation for the internal vectors. The memory * is only allocated when there is an attribute. This reduces the cost * of creating many small RTFs. */ private void alloc() { _attributes = new Hashtable(); _names = new Vector(); _values = new Vector(); _qnames = new Vector(); _uris = new Vector(); }
public void addAuxiliaryClass(Class auxClass) { if (_auxClasses == null) _auxClasses = new Hashtable(); _auxClasses.put(auxClass.getName(), auxClass); }
public void addAuxiliaryClass(Class auxClass) { if (_auxClasses == null) _auxClasses = new Hashtable(); _auxClasses.put(auxClass.getName(), auxClass); }
public void addAuxiliaryClass(Class auxClass) { if (_auxClasses == null) _auxClasses = new Hashtable(); _auxClasses.put(auxClass.getName(), auxClass); }
/** * Create an empty KeyIndex in the DOM case * @param name is the name of the index (the key or ##id) * @param dom is the DOM */ public void buildKeyIndex(String name, DOM dom) { if (_keyIndexes == null) _keyIndexes = new Hashtable(); KeyIndex index = (KeyIndex)_keyIndexes.get(name); if (index == null) { _keyIndexes.put(name, index = new KeyIndex(_indexSize)); } index.setDom(dom); }
/** * Adds a value to a key/id index * @param name is the name of the index (the key or ##id) * @param node is the node handle of the node to insert * @param value is the value that will look up the node in the given index */ public void buildKeyIndex(String name, int node, Object value) { if (_keyIndexes == null) _keyIndexes = new Hashtable(); KeyIndex index = (KeyIndex)_keyIndexes.get(name); if (index == null) { _keyIndexes.put(name, index = new KeyIndex(_indexSize)); } index.add(value, node, _currentRootForKeys); }
/** * Create an empty KeyIndex in the DOM case * @param name is the name of the index (the key or ##id) * @param dom is the DOM */ public void buildKeyIndex(String name, DOM dom) { if (_keyIndexes == null) _keyIndexes = new Hashtable(); KeyIndex index = (KeyIndex)_keyIndexes.get(name); if (index == null) { _keyIndexes.put(name, index = new KeyIndex(_indexSize)); } index.setDom(dom); }
/** * Create an empty KeyIndex in the DOM case * @param name is the name of the index (the key or ##id) * @param dom is the DOM */ public void buildKeyIndex(String name, DOM dom) { if (_keyIndexes == null) _keyIndexes = new Hashtable(); KeyIndex index = (KeyIndex)_keyIndexes.get(name); if (index == null) { _keyIndexes.put(name, index = new KeyIndex(_indexSize)); } index.setDom(dom); }