Java Code Examples for org.xml.sax.Locator#getSystemId()
The following examples show how to use
org.xml.sax.Locator#getSystemId() .
You can vote up the ones you like or vote down the ones you don't like,
and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source File: XmlLocationAnnotator.java From org.hl7.fhir.core with Apache License 2.0 | 6 votes |
@Override public void endElement(String uri, String localName, String qName) throws SAXException { // Mutation event fired by the adding of element end, // and so lastAddedElement will be set. super.endElement(uri, localName, qName); if (locatorStack.size() > 0) { Locator startLocator = locatorStack.pop(); XmlLocationData location = new XmlLocationData( startLocator.getSystemId(), startLocator.getLineNumber(), startLocator.getColumnNumber(), locator.getLineNumber(), locator.getColumnNumber()); Element lastAddedElement = elementStack.pop(); lastAddedElement.setUserData( XmlLocationData.LOCATION_DATA_KEY, location, dataHandler); } }
Example 2
Source File: SchemaTreeTraverser.java From TencentKona-8 with GNU General Public License v2.0 | 6 votes |
/** * Simple constructor. * * @param artifactName Artifact name. * @param locator Artifact locator. */ public SchemaTreeNode(String artifactName, Locator locator) { this.artifactName = artifactName; if (locator == null) { this.fileName = null; } else { String filename = locator.getSystemId(); filename = filename.replaceAll("\u002520", " "); // strip leading protocol if (filename.startsWith("file:/")) { filename = filename.substring(6); } this.fileName = filename; this.lineNumber = locator.getLineNumber() - 1; } }
Example 3
Source File: SchemaTreeTraverser.java From openjdk-jdk9 with GNU General Public License v2.0 | 6 votes |
/** * Simple constructor. * * @param artifactName Artifact name. * @param locator Artifact locator. */ public SchemaTreeNode(String artifactName, Locator locator) { this.artifactName = artifactName; if (locator == null) { this.fileName = null; } else { String filename = locator.getSystemId(); filename = filename.replaceAll("\u002520", " "); // strip leading protocol if (filename.startsWith("file:/")) { filename = filename.substring(6); } this.fileName = filename; this.lineNumber = locator.getLineNumber() - 1; } }
Example 4
Source File: SchemaTreeTraverser.java From openjdk-jdk8u-backup with GNU General Public License v2.0 | 6 votes |
/** * Simple constructor. * * @param artifactName Artifact name. * @param locator Artifact locator. */ public SchemaTreeNode(String artifactName, Locator locator) { this.artifactName = artifactName; if (locator == null) { this.fileName = null; } else { String filename = locator.getSystemId(); filename = filename.replaceAll("\u002520", " "); // strip leading protocol if (filename.startsWith("file:/")) { filename = filename.substring(6); } this.fileName = filename; this.lineNumber = locator.getLineNumber() - 1; } }
Example 5
Source File: SchemaTreeTraverser.java From jdk8u60 with GNU General Public License v2.0 | 6 votes |
/** * Simple constructor. * * @param artifactName Artifact name. * @param locator Artifact locator. */ public SchemaTreeNode(String artifactName, Locator locator) { this.artifactName = artifactName; if (locator == null) { this.fileName = null; } else { String filename = locator.getSystemId(); filename = filename.replaceAll("\u002520", " "); // strip leading protocol if (filename.startsWith("file:/")) { filename = filename.substring(6); } this.fileName = filename; this.lineNumber = locator.getLineNumber() - 1; } }
Example 6
Source File: ClassSelector.java From openjdk-jdk8u with GNU General Public License v2.0 | 5 votes |
/** * Copies a schema fragment into the javadoc of the generated class. */ private void addSchemaFragmentJavadoc( CClassInfo bean, XSComponent sc ) { // first, pick it up from <documentation> if any. String doc = builder.getBindInfo(sc).getDocumentation(); if(doc!=null) append(bean, doc); // then the description of where this component came from Locator loc = sc.getLocator(); String fileName = null; if(loc!=null) { fileName = loc.getPublicId(); if(fileName==null) fileName = loc.getSystemId(); } if(fileName==null) fileName=""; String lineNumber=Messages.format( Messages.JAVADOC_LINE_UNKNOWN); if(loc!=null && loc.getLineNumber()!=-1) lineNumber = String.valueOf(loc.getLineNumber()); String componentName = sc.apply( new ComponentNameFunction() ); String jdoc = Messages.format( Messages.JAVADOC_HEADING, componentName, fileName, lineNumber ); append(bean,jdoc); // then schema fragment StringWriter out = new StringWriter(); out.write("<pre>\n"); SchemaWriter sw = new SchemaWriter(new JavadocEscapeWriter(out)); sc.visit(sw); out.write("</pre>"); append(bean,out.toString()); }
Example 7
Source File: ClassSelector.java From jdk8u60 with GNU General Public License v2.0 | 5 votes |
/** * Copies a schema fragment into the javadoc of the generated class. */ private void addSchemaFragmentJavadoc( CClassInfo bean, XSComponent sc ) { // first, pick it up from <documentation> if any. String doc = builder.getBindInfo(sc).getDocumentation(); if(doc!=null) append(bean, doc); // then the description of where this component came from Locator loc = sc.getLocator(); String fileName = null; if(loc!=null) { fileName = loc.getPublicId(); if(fileName==null) fileName = loc.getSystemId(); } if(fileName==null) fileName=""; String lineNumber=Messages.format( Messages.JAVADOC_LINE_UNKNOWN); if(loc!=null && loc.getLineNumber()!=-1) lineNumber = String.valueOf(loc.getLineNumber()); String componentName = sc.apply( new ComponentNameFunction() ); String jdoc = Messages.format( Messages.JAVADOC_HEADING, componentName, fileName, lineNumber ); append(bean,jdoc); // then schema fragment StringWriter out = new StringWriter(); out.write("<pre>\n"); SchemaWriter sw = new SchemaWriter(new JavadocEscapeWriter(out)); sc.visit(sw); out.write("</pre>"); append(bean,out.toString()); }
Example 8
Source File: CollisionInfo.java From openjdk-jdk8u with GNU General Public License v2.0 | 5 votes |
private String printLocator(Locator loc) { if( loc==null ) return ""; int line = loc.getLineNumber(); String sysId = loc.getSystemId(); if(sysId==null) sysId = Messages.format(Messages.MSG_UNKNOWN_FILE); if( line!=-1 ) return Messages.format( Messages.MSG_LINE_X_OF_Y, Integer.toString(line), sysId ); else return sysId; }
Example 9
Source File: CollisionInfo.java From jdk8u60 with GNU General Public License v2.0 | 5 votes |
private String printLocator(Locator loc) { if( loc==null ) return ""; int line = loc.getLineNumber(); String sysId = loc.getSystemId(); if(sysId==null) sysId = Messages.format(Messages.MSG_UNKNOWN_FILE); if( line!=-1 ) return Messages.format( Messages.MSG_LINE_X_OF_Y, Integer.toString(line), sysId ); else return sysId; }
Example 10
Source File: CollisionInfo.java From openjdk-jdk9 with GNU General Public License v2.0 | 5 votes |
private String printLocator(Locator loc) { if( loc==null ) return ""; int line = loc.getLineNumber(); String sysId = loc.getSystemId(); if(sysId==null) sysId = Messages.format(Messages.MSG_UNKNOWN_FILE); if( line!=-1 ) return Messages.format( Messages.MSG_LINE_X_OF_Y, Integer.toString(line), sysId ); else return sysId; }
Example 11
Source File: ClassSelector.java From openjdk-jdk9 with GNU General Public License v2.0 | 5 votes |
/** * Copies a schema fragment into the javadoc of the generated class. */ private void addSchemaFragmentJavadoc( CClassInfo bean, XSComponent sc ) { // first, pick it up from <documentation> if any. String doc = builder.getBindInfo(sc).getDocumentation(); if(doc!=null) append(bean, doc); // then the description of where this component came from Locator loc = sc.getLocator(); String fileName = null; if(loc!=null) { fileName = loc.getPublicId(); if(fileName==null) fileName = loc.getSystemId(); } if(fileName==null) fileName=""; String lineNumber=Messages.format( Messages.JAVADOC_LINE_UNKNOWN); if(loc!=null && loc.getLineNumber()!=-1) lineNumber = String.valueOf(loc.getLineNumber()); String componentName = sc.apply( new ComponentNameFunction() ); String jdoc = Messages.format( Messages.JAVADOC_HEADING, componentName, fileName, lineNumber ); append(bean,jdoc); // then schema fragment StringWriter out = new StringWriter(); out.write("<pre>\n"); SchemaWriter sw = new SchemaWriter(new JavadocEscapeWriter(out)); sc.visit(sw); out.write("</pre>"); append(bean,out.toString()); }
Example 12
Source File: DOMForestScanner.java From openjdk-jdk8u with GNU General Public License v2.0 | 4 votes |
public String getSystemId() { Locator l = findLocator(); if(l!=null) return l.getSystemId(); return null; }
Example 13
Source File: DOMForestScanner.java From jdk8u60 with GNU General Public License v2.0 | 4 votes |
public String getSystemId() { Locator l = findLocator(); if(l!=null) return l.getSystemId(); return null; }
Example 14
Source File: SAX2StAXBaseWriter.java From openjdk-jdk8u-backup with GNU General Public License v2.0 | 4 votes |
private SAXLocation(Locator locator) { lineNumber = locator.getLineNumber(); columnNumber = locator.getColumnNumber(); publicId = locator.getPublicId(); systemId = locator.getSystemId(); }
Example 15
Source File: DefaultAuthenticator.java From jdk8u60 with GNU General Public License v2.0 | 4 votes |
private String getLocationString(Locator l) { return "[" + l.getSystemId() + "#" + l.getLineNumber() + "]"; }
Example 16
Source File: SAX2StAXBaseWriter.java From openjdk-jdk8u with GNU General Public License v2.0 | 4 votes |
private SAXLocation(Locator locator) { lineNumber = locator.getLineNumber(); columnNumber = locator.getColumnNumber(); publicId = locator.getPublicId(); systemId = locator.getSystemId(); }
Example 17
Source File: DefaultAuthenticator.java From TencentKona-8 with GNU General Public License v2.0 | 4 votes |
private String getLocationString(Locator l) { return "[" + l.getSystemId() + "#" + l.getLineNumber() + "]"; }
Example 18
Source File: SAX2DTM.java From TencentKona-8 with GNU General Public License v2.0 | 2 votes |
/** * Receive a Locator object for document events. * * <p>By default, do nothing. Application writers may override this * method in a subclass if they wish to store the locator for use * with other document events.</p> * * @param locator A locator for all SAX document events. * @see org.xml.sax.ContentHandler#setDocumentLocator * @see org.xml.sax.Locator */ public void setDocumentLocator(Locator locator) { m_locator = locator; m_systemId = locator.getSystemId(); }
Example 19
Source File: SAX2DTM.java From openjdk-jdk8u with GNU General Public License v2.0 | 2 votes |
/** * Receive a Locator object for document events. * * <p>By default, do nothing. Application writers may override this * method in a subclass if they wish to store the locator for use * with other document events.</p> * * @param locator A locator for all SAX document events. * @see org.xml.sax.ContentHandler#setDocumentLocator * @see org.xml.sax.Locator */ public void setDocumentLocator(Locator locator) { m_locator = locator; m_systemId = locator.getSystemId(); }
Example 20
Source File: SAX2DTM.java From JDKSourceCode1.8 with MIT License | 2 votes |
/** * Receive a Locator object for document events. * * <p>By default, do nothing. Application writers may override this * method in a subclass if they wish to store the locator for use * with other document events.</p> * * @param locator A locator for all SAX document events. * @see org.xml.sax.ContentHandler#setDocumentLocator * @see org.xml.sax.Locator */ public void setDocumentLocator(Locator locator) { m_locator = locator; m_systemId = locator.getSystemId(); }