Java Code Examples for com.sun.xml.internal.xsom.XSComponent#visit()

The following examples show how to use com.sun.xml.internal.xsom.XSComponent#visit() . 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 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 3
Source File: BGMBuilder.java    From openjdk-8-source with GNU General Public License v2.0 5 votes vote down vote up
/**
 * If the component maps to a property, forwards to purple, otherwise to green.
 *
 * If the component is mapped to a type, this method needs to return true.
 * See the chart at the class javadoc.
 */
public void ying( XSComponent sc, @Nullable XSComponent referer ) {
    if(sc.apply(toPurple)==true || getClassSelector().bindToType(sc,referer)!=null)
        sc.visit(purple);
    else
        sc.visit(green);
}
 
Example 4
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 5
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());
}
 
Example 6
Source File: BGMBuilder.java    From openjdk-8 with GNU General Public License v2.0 5 votes vote down vote up
/**
 * If the component maps to a property, forwards to purple, otherwise to green.
 *
 * If the component is mapped to a type, this method needs to return true.
 * See the chart at the class javadoc.
 */
public void ying( XSComponent sc, @Nullable XSComponent referer ) {
    if(sc.apply(toPurple)==true || getClassSelector().bindToType(sc,referer)!=null)
        sc.visit(purple);
    else
        sc.visit(green);
}
 
Example 7
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 8
Source File: BGMBuilder.java    From openjdk-jdk9 with GNU General Public License v2.0 5 votes vote down vote up
/**
 * If the component maps to a property, forwards to purple, otherwise to green.
 *
 * If the component is mapped to a type, this method needs to return true.
 * See the chart at the class javadoc.
 */
public void ying( XSComponent sc, @Nullable XSComponent referer ) {
    if(sc.apply(toPurple)==true || getClassSelector().bindToType(sc,referer)!=null)
        sc.visit(purple);
    else
        sc.visit(green);
}
 
Example 9
Source File: BGMBuilder.java    From openjdk-jdk8u-backup with GNU General Public License v2.0 5 votes vote down vote up
/**
 * If the component maps to a property, forwards to purple, otherwise to green.
 *
 * If the component is mapped to a type, this method needs to return true.
 * See the chart at the class javadoc.
 */
public void ying( XSComponent sc, @Nullable XSComponent referer ) {
    if(sc.apply(toPurple)==true || getClassSelector().bindToType(sc,referer)!=null)
        sc.visit(purple);
    else
        sc.visit(green);
}
 
Example 10
Source File: BGMBuilder.java    From openjdk-jdk8u with GNU General Public License v2.0 5 votes vote down vote up
/**
 * If the component maps to a property, forwards to purple, otherwise to green.
 *
 * If the component is mapped to a type, this method needs to return true.
 * See the chart at the class javadoc.
 */
public void ying( XSComponent sc, @Nullable XSComponent referer ) {
    if(sc.apply(toPurple)==true || getClassSelector().bindToType(sc,referer)!=null)
        sc.visit(purple);
    else
        sc.visit(green);
}
 
Example 11
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 12
Source File: BGMBuilder.java    From jdk8u60 with GNU General Public License v2.0 5 votes vote down vote up
/**
 * If the component maps to a property, forwards to purple, otherwise to green.
 *
 * If the component is mapped to a type, this method needs to return true.
 * See the chart at the class javadoc.
 */
public void ying( XSComponent sc, @Nullable XSComponent referer ) {
    if(sc.apply(toPurple)==true || getClassSelector().bindToType(sc,referer)!=null)
        sc.visit(purple);
    else
        sc.visit(green);
}
 
Example 13
Source File: BGMBuilder.java    From TencentKona-8 with GNU General Public License v2.0 5 votes vote down vote up
/**
 * If the component maps to a property, forwards to purple, otherwise to green.
 *
 * If the component is mapped to a type, this method needs to return true.
 * See the chart at the class javadoc.
 */
public void ying( XSComponent sc, @Nullable XSComponent referer ) {
    if(sc.apply(toPurple)==true || getClassSelector().bindToType(sc,referer)!=null)
        sc.visit(purple);
    else
        sc.visit(green);
}
 
Example 14
Source File: UnusedCustomizationChecker.java    From openjdk-jdk8u with GNU General Public License v2.0 4 votes vote down vote up
private void run( Map<String,? extends XSComponent> col ) {
    for( XSComponent c : col.values() )
        c.visit(this);
}
 
Example 15
Source File: UnusedCustomizationChecker.java    From openjdk-8 with GNU General Public License v2.0 4 votes vote down vote up
private void run( Map<String,? extends XSComponent> col ) {
    for( XSComponent c : col.values() )
        c.visit(this);
}
 
Example 16
Source File: UnusedCustomizationChecker.java    From openjdk-jdk8u-backup with GNU General Public License v2.0 4 votes vote down vote up
private void run( Map<String,? extends XSComponent> col ) {
    for( XSComponent c : col.values() )
        c.visit(this);
}
 
Example 17
Source File: UnusedCustomizationChecker.java    From openjdk-8-source with GNU General Public License v2.0 4 votes vote down vote up
private void run( Map<String,? extends XSComponent> col ) {
    for( XSComponent c : col.values() )
        c.visit(this);
}
 
Example 18
Source File: UnusedCustomizationChecker.java    From jdk8u60 with GNU General Public License v2.0 4 votes vote down vote up
private void run( Map<String,? extends XSComponent> col ) {
    for( XSComponent c : col.values() )
        c.visit(this);
}
 
Example 19
Source File: UnusedCustomizationChecker.java    From hottub with GNU General Public License v2.0 4 votes vote down vote up
private void run( Map<String,? extends XSComponent> col ) {
    for( XSComponent c : col.values() )
        c.visit(this);
}
 
Example 20
Source File: UnusedCustomizationChecker.java    From TencentKona-8 with GNU General Public License v2.0 4 votes vote down vote up
private void run( Map<String,? extends XSComponent> col ) {
    for( XSComponent c : col.values() )
        c.visit(this);
}