Java Code Examples for org.xml.sax.Locator#getPublicId()

The following examples show how to use org.xml.sax.Locator#getPublicId() . 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: ClassSelector.java    From openjdk-jdk9 with GNU General Public License v2.0 5 votes vote down vote up
/**
 * 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 2
Source File: ClassSelector.java    From openjdk-jdk8u-backup with GNU General Public License v2.0 5 votes vote down vote up
/**
 * 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 3
Source File: ClassSelector.java    From openjdk-jdk8u with GNU General Public License v2.0 5 votes vote down vote up
/**
 * 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 4
Source File: DOMForestScanner.java    From openjdk-jdk8u with GNU General Public License v2.0 4 votes vote down vote up
public String getPublicId() {
    Locator l = findLocator();
    if(l!=null)     return l.getPublicId();
    return          null;
}
 
Example 5
Source File: SAX2StAXBaseWriter.java    From Bytecoder with Apache License 2.0 4 votes vote down vote up
private SAXLocation(Locator locator) {
        lineNumber = locator.getLineNumber();
        columnNumber = locator.getColumnNumber();
        publicId = locator.getPublicId();
        systemId = locator.getSystemId();
}
 
Example 6
Source File: SAX2StAXBaseWriter.java    From openjdk-jdk8u-backup with GNU General Public License v2.0 4 votes vote down vote up
private SAXLocation(Locator locator) {
        lineNumber = locator.getLineNumber();
        columnNumber = locator.getColumnNumber();
        publicId = locator.getPublicId();
        systemId = locator.getSystemId();
}
 
Example 7
Source File: DOMForestScanner.java    From openjdk-jdk8u-backup with GNU General Public License v2.0 4 votes vote down vote up
public String getPublicId() {
    Locator l = findLocator();
    if(l!=null)     return l.getPublicId();
    return          null;
}
 
Example 8
Source File: SAX2StAXBaseWriter.java    From openjdk-jdk9 with GNU General Public License v2.0 4 votes vote down vote up
private SAXLocation(Locator locator) {
        lineNumber = locator.getLineNumber();
        columnNumber = locator.getColumnNumber();
        publicId = locator.getPublicId();
        systemId = locator.getSystemId();
}
 
Example 9
Source File: SAX2StAXBaseWriter.java    From openjdk-jdk8u with GNU General Public License v2.0 4 votes vote down vote up
private SAXLocation(Locator locator) {
        lineNumber = locator.getLineNumber();
        columnNumber = locator.getColumnNumber();
        publicId = locator.getPublicId();
        systemId = locator.getSystemId();
}
 
Example 10
Source File: DOMForestScanner.java    From openjdk-jdk8u with GNU General Public License v2.0 4 votes vote down vote up
public String getPublicId() {
    Locator l = findLocator();
    if(l!=null)     return l.getPublicId();
    return          null;
}
 
Example 11
Source File: SAX2StAXBaseWriter.java    From jdk1.8-source-analysis with Apache License 2.0 4 votes vote down vote up
private SAXLocation(Locator locator) {
        lineNumber = locator.getLineNumber();
        columnNumber = locator.getColumnNumber();
        publicId = locator.getPublicId();
        systemId = locator.getSystemId();
}
 
Example 12
Source File: SAX2StAXBaseWriter.java    From JDKSourceCode1.8 with MIT License 4 votes vote down vote up
private SAXLocation(Locator locator) {
        lineNumber = locator.getLineNumber();
        columnNumber = locator.getColumnNumber();
        publicId = locator.getPublicId();
        systemId = locator.getSystemId();
}
 
Example 13
Source File: SAX2StAXBaseWriter.java    From jdk8u60 with GNU General Public License v2.0 4 votes vote down vote up
private SAXLocation(Locator locator) {
        lineNumber = locator.getLineNumber();
        columnNumber = locator.getColumnNumber();
        publicId = locator.getPublicId();
        systemId = locator.getSystemId();
}
 
Example 14
Source File: DOMForestScanner.java    From jdk8u60 with GNU General Public License v2.0 4 votes vote down vote up
public String getPublicId() {
    Locator l = findLocator();
    if(l!=null)     return l.getPublicId();
    return          null;
}
 
Example 15
Source File: DOMForestScanner.java    From openjdk-jdk9 with GNU General Public License v2.0 4 votes vote down vote up
public String getPublicId() {
    Locator l = findLocator();
    if(l!=null)     return l.getPublicId();
    return          null;
}
 
Example 16
Source File: DOMForestScanner.java    From jdk8u60 with GNU General Public License v2.0 4 votes vote down vote up
public String getPublicId() {
    Locator l = findLocator();
    if(l!=null)     return l.getPublicId();
    return          null;
}
 
Example 17
Source File: SAX2StAXBaseWriter.java    From TencentKona-8 with GNU General Public License v2.0 4 votes vote down vote up
private SAXLocation(Locator locator) {
        lineNumber = locator.getLineNumber();
        columnNumber = locator.getColumnNumber();
        publicId = locator.getPublicId();
        systemId = locator.getSystemId();
}
 
Example 18
Source File: DOMForestScanner.java    From TencentKona-8 with GNU General Public License v2.0 4 votes vote down vote up
public String getPublicId() {
    Locator l = findLocator();
    if(l!=null)     return l.getPublicId();
    return          null;
}
 
Example 19
Source File: DOMForestScanner.java    From openjdk-jdk9 with GNU General Public License v2.0 4 votes vote down vote up
public String getPublicId() {
    Locator l = findLocator();
    if(l!=null)     return l.getPublicId();
    return          null;
}
 
Example 20
Source File: DOMForestScanner.java    From TencentKona-8 with GNU General Public License v2.0 4 votes vote down vote up
public String getPublicId() {
    Locator l = findLocator();
    if(l!=null)     return l.getPublicId();
    return          null;
}