public void addAuxiliaryClass(Class auxClass) { if (_auxClasses == null) _auxClasses = new Hashtable(); _auxClasses.put(auxClass.getName(), auxClass); }
/** * 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; }
private void definePrefixAndUri(String prefix, String uri) throws SAXException { // Check if the URI already exists before pushing on stack Integer eType = new Integer(getIdForNamespace(uri)); if ((Integer)_nsIndex.get(eType) == null) { _nsIndex.put(eType, new Integer(_uriCount++)); } }
/** * SAX2: Receive notification of the beginning of a document. */ public void startDocument() throws SAXException { super.startDocument(); _nsIndex.put(new Integer(0), new Integer(_uriCount++)); definePrefixAndUri(XML_PREFIX, XML_URI); }
/** * Specialized interface used by DOM2SAX. This one has an extra Node * parameter to build the Node -> id map. */ public void startElement(String uri, String localName, String qname, Attributes attributes, Node node) throws SAXException { this.startElement(uri, localName, qname, attributes); if (m_buildIdIndex) { _node2Ids.put(node, new Integer(m_parents.peek())); } }
/** * Adds an attribute to the list */ public void add(String qname, String value) { // Initialize the internal vectors at the first usage. if (_attributes == null) alloc(); // Stuff the QName into the names vector & hashtable Integer obj = (Integer)_attributes.get(qname); if (obj == null) { _attributes.put(qname, obj = new Integer(_length++)); _qnames.addElement(qname); _values.addElement(value); int col = qname.lastIndexOf(':'); if (col > -1) { _uris.addElement(qname.substring(0,col)); _names.addElement(qname.substring(col+1)); } else { _uris.addElement(EMPTYSTRING); _names.addElement(qname); } } else { final int index = obj.intValue(); _values.set(index, value); } }
return put(key, value);
/** * 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 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); } }
/** * 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); } }
/** * 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; }
_auxClasses.put(_class[i].getName(), _class[i]);
m_translet.getUrisArray(), m_translet.getTypesArray()); m_mappings.put(dtm, mapping); m_currentDTM = dtm; m_currentMapping = mapping;
_documents.put(uri, new Integer(domNo));
private void definePrefixAndUri(String prefix, String uri) throws SAXException { // Check if the URI already exists before pushing on stack Integer eType = new Integer(getIdForNamespace(uri)); if ((Integer)_nsIndex.get(eType) == null) { _nsIndex.put(eType, new Integer(_uriCount++)); } }
/** * SAX2: Receive notification of the beginning of a document. */ public void startDocument() throws SAXException { super.startDocument(); _nsIndex.put(new Integer(0), new Integer(_uriCount++)); definePrefixAndUri(XML_PREFIX, XML_URI); }
/** * 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); }