/** * Returns the line in the source code of the specified element or * -1 if not found. * * @param e the element * @return -1 the document has been removed from the cache or has not * been loaded by this document loader. */ public int getLineNumber(Element e) { String uri = ((SVGDocument)e.getOwnerDocument()).getURL(); DocumentState state; synchronized (cacheMap) { state = (DocumentState)cacheMap.get(uri); } if (state == null) { return -1; } else { return state.desc.getLocationLine(e); } }
public void cleared() { removeEntry(this); } }
/** * <b>SAX</b>: Implements {@link * org.xml.sax.ContentHandler#startDocument()}. */ public void startDocument() throws SAXException { preInfo = new LinkedList(); namespaces = new HashTableStack(); namespaces.put("xml", XMLSupport.XML_NAMESPACE_URI); namespaces.put("xmlns", XMLSupport.XMLNS_NAMESPACE_URI); namespaces.put("", null); inDTD = false; inCDATA = false; inProlog = true; currentNode = null; document = null; doctype = null; isStandalone = false; xmlVersion = XMLConstants.XML_VERSION_10; stringBuffer.setLength(0); stringContent = false; if (createDocumentDescriptor) { documentDescriptor = new DocumentDescriptor(); } else { documentDescriptor = null; } }
/** * Sets the location in the source file of the end element. */ public void setLocation(Element elt, int line, int col) { synchronized (this) { int hash = elt.hashCode() & 0x7FFFFFFF; int index = hash % table.length; for (Entry e = table[index]; e != null; e = e.next) { if (e.hash != hash) continue; Object o = e.get(); if (o == elt) e.locationLine = line; } // The key is not in the hash table int len = table.length; if (count++ >= (len - ( len >> 2 ))) { // more than 75% loaded: grow rehash(); index = hash % table.length; } Entry e = new Entry(hash, elt, line, col, table[index]); table[index] = e; } }
documentDescriptor.setLocation(e, locator.getLineNumber(), locator.getColumnNumber());
/** * <b>SAX</b>: Implements {@link * org.xml.sax.ContentHandler#startDocument()}. */ public void startDocument() throws SAXException { preInfo = new LinkedList(); namespaces = new HashTableStack(); namespaces.put("xml", XMLSupport.XML_NAMESPACE_URI); namespaces.put("xmlns", XMLSupport.XMLNS_NAMESPACE_URI); namespaces.put("", null); inDTD = false; inCDATA = false; inProlog = true; currentNode = null; document = null; doctype = null; isStandalone = false; xmlVersion = XMLConstants.XML_VERSION_10; stringBuffer.setLength(0); stringContent = false; if (createDocumentDescriptor) { documentDescriptor = new DocumentDescriptor(); } else { documentDescriptor = null; } }
/** * Sets the location in the source file of the end element. */ public void setLocation(Element elt, int line, int col) { synchronized (this) { int hash = elt.hashCode() & 0x7FFFFFFF; int index = hash % table.length; for (Entry e = table[index]; e != null; e = e.next) { if (e.hash != hash) continue; Object o = e.get(); if (o == elt) e.locationLine = line; } // The key is not in the hash table int len = table.length; if (count++ >= (len - ( len >> 2 ))) { // more than 75% loaded: grow rehash(); index = hash % table.length; } Entry e = new Entry(hash, elt, line, col, table[index]); table[index] = e; } }
documentDescriptor.setLocation(e, locator.getLineNumber(), locator.getColumnNumber());
public void cleared() { removeEntry(this); } }
/** * Returns the line in the source code of the specified element or * -1 if not found. * * @param e the element * @return -1 the document has been removed from the cache or has not * been loaded by this document loader. */ public int getLineNumber(Element e) { String uri = ((SVGDocument)e.getOwnerDocument()).getURL(); DocumentState state; synchronized (cacheMap) { state = (DocumentState)cacheMap.get(uri); } if (state == null) { return -1; } else { return state.desc.getLocationLine(e); } }
/** * <b>SAX</b>: Implements {@link * org.xml.sax.ContentHandler#startDocument()}. */ public void startDocument() throws SAXException { preInfo = new LinkedList(); namespaces = new HashTableStack(); namespaces.put("xml", XMLSupport.XML_NAMESPACE_URI); namespaces.put("xmlns", XMLSupport.XMLNS_NAMESPACE_URI); namespaces.put("", null); inDTD = false; inCDATA = false; inProlog = true; currentNode = null; document = null; doctype = null; isStandalone = false; xmlVersion = XMLConstants.XML_VERSION_10; stringBuffer.setLength(0); stringContent = false; if (createDocumentDescriptor) { documentDescriptor = new DocumentDescriptor(); } else { documentDescriptor = null; } }
/** * Sets the location in the source file of the end element. */ public void setLocation(Element elt, int line, int col) { synchronized (this) { int hash = elt.hashCode() & 0x7FFFFFFF; int index = hash % table.length; for (Entry e = table[index]; e != null; e = e.next) { if (e.hash != hash) continue; Object o = e.get(); if (o == elt) e.locationLine = line; } // The key is not in the hash table int len = table.length; if (count++ >= (len - ( len >> 2 ))) { // more than 75% loaded: grow rehash(); index = hash % table.length; } Entry e = new Entry(hash, elt, line, col, table[index]); table[index] = e; } }
documentDescriptor.setLocation(e, locator.getLineNumber(), locator.getColumnNumber());
public void cleared() { removeEntry(this); } }
/** * Returns the line in the source code of the specified element or * -1 if not found. * * @param e the element * @return -1 the document has been removed from the cache or has not * been loaded by this document loader. */ public int getLineNumber(Element e) { String uri = ((SVGDocument)e.getOwnerDocument()).getURL(); DocumentState state; synchronized (cacheMap) { state = (DocumentState)cacheMap.get(uri); } if (state == null) { return -1; } else { return state.desc.getLocationLine(e); } }