com.sun.codemodel.internal.util.JavadocEscapeWriter Java Examples

The following examples show how to use com.sun.codemodel.internal.util.JavadocEscapeWriter. 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 TencentKona-8 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 jdk8u60 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: 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 #5
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 #6
Source File: ClassSelector.java    From hottub 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 #7
Source File: ClassSelector.java    From openjdk-8-source 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 #8
Source File: ClassSelector.java    From openjdk-8 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());
}