com.sun.tools.internal.xjc.reader.xmlschema.bindinfo.BISchemaBinding Java Examples

The following examples show how to use com.sun.tools.internal.xjc.reader.xmlschema.bindinfo.BISchemaBinding. 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: BGMBuilder.java    From TencentKona-8 with GNU General Public License v2.0 6 votes vote down vote up
/** Reports an error if there are more than one jaxb:schemaBindings customization. */
private void checkMultipleSchemaBindings( XSSchema schema ) {
    ArrayList<Locator> locations = new ArrayList<Locator>();

    BindInfo bi = getBindInfo(schema);
    for( BIDeclaration bid : bi ) {
        if( bid.getName()==BISchemaBinding.NAME )
            locations.add( bid.getLocation() );
    }
    if(locations.size()<=1)    return; // OK

    // error
    getErrorReporter().error( locations.get(0),
        Messages.ERR_MULTIPLE_SCHEMA_BINDINGS,
        schema.getTargetNamespace() );
    for( int i=1; i<locations.size(); i++ )
        getErrorReporter().error( (Locator)locations.get(i),
            Messages.ERR_MULTIPLE_SCHEMA_BINDINGS_LOCATION);
}
 
Example #2
Source File: BGMBuilder.java    From openjdk-jdk8u-backup with GNU General Public License v2.0 6 votes vote down vote up
/** Reports an error if there are more than one jaxb:schemaBindings customization. */
private void checkMultipleSchemaBindings( XSSchema schema ) {
    ArrayList<Locator> locations = new ArrayList<Locator>();

    BindInfo bi = getBindInfo(schema);
    for( BIDeclaration bid : bi ) {
        if( bid.getName()==BISchemaBinding.NAME )
            locations.add( bid.getLocation() );
    }
    if(locations.size()<=1)    return; // OK

    // error
    getErrorReporter().error( locations.get(0),
        Messages.ERR_MULTIPLE_SCHEMA_BINDINGS,
        schema.getTargetNamespace() );
    for( int i=1; i<locations.size(); i++ )
        getErrorReporter().error( (Locator)locations.get(i),
            Messages.ERR_MULTIPLE_SCHEMA_BINDINGS_LOCATION);
}
 
Example #3
Source File: BGMBuilder.java    From openjdk-8 with GNU General Public License v2.0 6 votes vote down vote up
/** Reports an error if there are more than one jaxb:schemaBindings customization. */
private void checkMultipleSchemaBindings( XSSchema schema ) {
    ArrayList<Locator> locations = new ArrayList<Locator>();

    BindInfo bi = getBindInfo(schema);
    for( BIDeclaration bid : bi ) {
        if( bid.getName()==BISchemaBinding.NAME )
            locations.add( bid.getLocation() );
    }
    if(locations.size()<=1)    return; // OK

    // error
    getErrorReporter().error( locations.get(0),
        Messages.ERR_MULTIPLE_SCHEMA_BINDINGS,
        schema.getTargetNamespace() );
    for( int i=1; i<locations.size(); i++ )
        getErrorReporter().error( (Locator)locations.get(i),
            Messages.ERR_MULTIPLE_SCHEMA_BINDINGS_LOCATION);
}
 
Example #4
Source File: BGMBuilder.java    From openjdk-jdk9 with GNU General Public License v2.0 6 votes vote down vote up
/** Reports an error if there are more than one jaxb:schemaBindings customization. */
private void checkMultipleSchemaBindings( XSSchema schema ) {
    ArrayList<Locator> locations = new ArrayList<Locator>();

    BindInfo bi = getBindInfo(schema);
    for( BIDeclaration bid : bi ) {
        if( bid.getName()==BISchemaBinding.NAME )
            locations.add( bid.getLocation() );
    }
    if(locations.size()<=1)    return; // OK

    // error
    getErrorReporter().error( locations.get(0),
        Messages.ERR_MULTIPLE_SCHEMA_BINDINGS,
        schema.getTargetNamespace() );
    for( int i=1; i<locations.size(); i++ )
        getErrorReporter().error( (Locator)locations.get(i),
            Messages.ERR_MULTIPLE_SCHEMA_BINDINGS_LOCATION);
}
 
Example #5
Source File: BGMBuilder.java    From jdk8u60 with GNU General Public License v2.0 6 votes vote down vote up
/** Reports an error if there are more than one jaxb:schemaBindings customization. */
private void checkMultipleSchemaBindings( XSSchema schema ) {
    ArrayList<Locator> locations = new ArrayList<Locator>();

    BindInfo bi = getBindInfo(schema);
    for( BIDeclaration bid : bi ) {
        if( bid.getName()==BISchemaBinding.NAME )
            locations.add( bid.getLocation() );
    }
    if(locations.size()<=1)    return; // OK

    // error
    getErrorReporter().error( locations.get(0),
        Messages.ERR_MULTIPLE_SCHEMA_BINDINGS,
        schema.getTargetNamespace() );
    for( int i=1; i<locations.size(); i++ )
        getErrorReporter().error( (Locator)locations.get(i),
            Messages.ERR_MULTIPLE_SCHEMA_BINDINGS_LOCATION);
}
 
Example #6
Source File: BGMBuilder.java    From openjdk-8-source with GNU General Public License v2.0 6 votes vote down vote up
/** Reports an error if there are more than one jaxb:schemaBindings customization. */
private void checkMultipleSchemaBindings( XSSchema schema ) {
    ArrayList<Locator> locations = new ArrayList<Locator>();

    BindInfo bi = getBindInfo(schema);
    for( BIDeclaration bid : bi ) {
        if( bid.getName()==BISchemaBinding.NAME )
            locations.add( bid.getLocation() );
    }
    if(locations.size()<=1)    return; // OK

    // error
    getErrorReporter().error( locations.get(0),
        Messages.ERR_MULTIPLE_SCHEMA_BINDINGS,
        schema.getTargetNamespace() );
    for( int i=1; i<locations.size(); i++ )
        getErrorReporter().error( (Locator)locations.get(i),
            Messages.ERR_MULTIPLE_SCHEMA_BINDINGS_LOCATION);
}
 
Example #7
Source File: BGMBuilder.java    From hottub with GNU General Public License v2.0 6 votes vote down vote up
/** Reports an error if there are more than one jaxb:schemaBindings customization. */
private void checkMultipleSchemaBindings( XSSchema schema ) {
    ArrayList<Locator> locations = new ArrayList<Locator>();

    BindInfo bi = getBindInfo(schema);
    for( BIDeclaration bid : bi ) {
        if( bid.getName()==BISchemaBinding.NAME )
            locations.add( bid.getLocation() );
    }
    if(locations.size()<=1)    return; // OK

    // error
    getErrorReporter().error( locations.get(0),
        Messages.ERR_MULTIPLE_SCHEMA_BINDINGS,
        schema.getTargetNamespace() );
    for( int i=1; i<locations.size(); i++ )
        getErrorReporter().error( (Locator)locations.get(i),
            Messages.ERR_MULTIPLE_SCHEMA_BINDINGS_LOCATION);
}
 
Example #8
Source File: BGMBuilder.java    From openjdk-jdk8u with GNU General Public License v2.0 6 votes vote down vote up
/** Reports an error if there are more than one jaxb:schemaBindings customization. */
private void checkMultipleSchemaBindings( XSSchema schema ) {
    ArrayList<Locator> locations = new ArrayList<Locator>();

    BindInfo bi = getBindInfo(schema);
    for( BIDeclaration bid : bi ) {
        if( bid.getName()==BISchemaBinding.NAME )
            locations.add( bid.getLocation() );
    }
    if(locations.size()<=1)    return; // OK

    // error
    getErrorReporter().error( locations.get(0),
        Messages.ERR_MULTIPLE_SCHEMA_BINDINGS,
        schema.getTargetNamespace() );
    for( int i=1; i<locations.size(); i++ )
        getErrorReporter().error( (Locator)locations.get(i),
            Messages.ERR_MULTIPLE_SCHEMA_BINDINGS_LOCATION);
}
 
Example #9
Source File: BGMBuilder.java    From TencentKona-8 with GNU General Public License v2.0 5 votes vote down vote up
/** Fill-in the contents of each classes. */
private void buildContents() {
    ClassSelector cs = getClassSelector();
    SimpleTypeBuilder stb = Ring.get(SimpleTypeBuilder.class);

    for( XSSchema s : Ring.get(XSSchemaSet.class).getSchemas() ) {
        BISchemaBinding sb = getBindInfo(s).get(BISchemaBinding.class);

        if(sb!=null && !sb.map) {
            sb.markAsAcknowledged();
            continue;       // no mapping for this package
        }

        getClassSelector().pushClassScope( new CClassInfoParent.Package(
            getClassSelector().getPackage(s.getTargetNamespace())) );

        checkMultipleSchemaBindings(s);
        processPackageJavadoc(s);
        populate(s.getAttGroupDecls(),s);
        populate(s.getAttributeDecls(),s);
        populate(s.getElementDecls(),s);
        populate(s.getModelGroupDecls(),s);

        // fill in typeUses
        for (XSType t : s.getTypes().values()) {
            stb.refererStack.push(t);
            model.typeUses().put( getName(t), cs.bindToType(t,s) );
            stb.refererStack.pop();
        }

        getClassSelector().popClassScope();
    }
}
 
Example #10
Source File: BGMBuilder.java    From openjdk-jdk9 with GNU General Public License v2.0 5 votes vote down vote up
/** Fill-in the contents of each classes. */
private void buildContents() {
    ClassSelector cs = getClassSelector();
    SimpleTypeBuilder stb = Ring.get(SimpleTypeBuilder.class);

    for( XSSchema s : Ring.get(XSSchemaSet.class).getSchemas() ) {
        BISchemaBinding sb = getBindInfo(s).get(BISchemaBinding.class);

        if(sb!=null && !sb.map) {
            sb.markAsAcknowledged();
            continue;       // no mapping for this package
        }

        getClassSelector().pushClassScope( new CClassInfoParent.Package(
            getClassSelector().getPackage(s.getTargetNamespace())) );

        checkMultipleSchemaBindings(s);
        processPackageJavadoc(s);
        populate(s.getAttGroupDecls(),s);
        populate(s.getAttributeDecls(),s);
        populate(s.getElementDecls(),s);
        populate(s.getModelGroupDecls(),s);

        // fill in typeUses
        for (XSType t : s.getTypes().values()) {
            stb.refererStack.push(t);
            model.typeUses().put( getName(t), cs.bindToType(t,s) );
            stb.refererStack.pop();
        }

        getClassSelector().popClassScope();
    }
}
 
Example #11
Source File: BGMBuilder.java    From openjdk-jdk9 with GNU General Public License v2.0 5 votes vote down vote up
/**
 * Generates <code>package.html</code> if the customization
 * says so.
 */
private void processPackageJavadoc( XSSchema s ) {
    // look for the schema-wide customization
    BISchemaBinding cust = getBindInfo(s).get(BISchemaBinding.class);
    if(cust==null)      return; // not present

    cust.markAsAcknowledged();
    if( cust.getJavadoc()==null )   return;     // no javadoc customization

    // produce a HTML file
    JTextFile html = new JTextFile("package.html");
    html.setContents(cust.getJavadoc());
    getClassSelector().getPackage(s.getTargetNamespace()).addResourceFile(html);
}
 
Example #12
Source File: BGMBuilder.java    From openjdk-jdk9 with GNU General Public License v2.0 5 votes vote down vote up
/**
 * Derives a name from a schema component.
 *
 * This method handles prefix/suffix modification and
 * XML-to-Java name conversion.
 *
 * @param name
 *      The base name. This should be things like element names
 *      or type names.
 * @param comp
 *      The component from which the base name was taken.
 *      Used to determine how names are modified.
 */
public String deriveName( String name, XSComponent comp ) {
    XSSchema owner = comp.getOwnerSchema();

    name = getNameConverter().toClassName(name);

    if( owner!=null ) {
        BISchemaBinding sb = getBindInfo(owner).get(BISchemaBinding.class);

        if(sb!=null)    name = sb.mangleClassName(name,comp);
    }

    return name;
}
 
Example #13
Source File: BGMBuilder.java    From hottub with GNU General Public License v2.0 5 votes vote down vote up
/** Fill-in the contents of each classes. */
private void buildContents() {
    ClassSelector cs = getClassSelector();
    SimpleTypeBuilder stb = Ring.get(SimpleTypeBuilder.class);

    for( XSSchema s : Ring.get(XSSchemaSet.class).getSchemas() ) {
        BISchemaBinding sb = getBindInfo(s).get(BISchemaBinding.class);

        if(sb!=null && !sb.map) {
            sb.markAsAcknowledged();
            continue;       // no mapping for this package
        }

        getClassSelector().pushClassScope( new CClassInfoParent.Package(
            getClassSelector().getPackage(s.getTargetNamespace())) );

        checkMultipleSchemaBindings(s);
        processPackageJavadoc(s);
        populate(s.getAttGroupDecls(),s);
        populate(s.getAttributeDecls(),s);
        populate(s.getElementDecls(),s);
        populate(s.getModelGroupDecls(),s);

        // fill in typeUses
        for (XSType t : s.getTypes().values()) {
            stb.refererStack.push(t);
            model.typeUses().put( getName(t), cs.bindToType(t,s) );
            stb.refererStack.pop();
        }

        getClassSelector().popClassScope();
    }
}
 
Example #14
Source File: BGMBuilder.java    From hottub with GNU General Public License v2.0 5 votes vote down vote up
/**
 * Generates <code>package.html</code> if the customization
 * says so.
 */
private void processPackageJavadoc( XSSchema s ) {
    // look for the schema-wide customization
    BISchemaBinding cust = getBindInfo(s).get(BISchemaBinding.class);
    if(cust==null)      return; // not present

    cust.markAsAcknowledged();
    if( cust.getJavadoc()==null )   return;     // no javadoc customization

    // produce a HTML file
    JTextFile html = new JTextFile("package.html");
    html.setContents(cust.getJavadoc());
    getClassSelector().getPackage(s.getTargetNamespace()).addResourceFile(html);
}
 
Example #15
Source File: BGMBuilder.java    From hottub with GNU General Public License v2.0 5 votes vote down vote up
/**
 * Derives a name from a schema component.
 *
 * This method handles prefix/suffix modification and
 * XML-to-Java name conversion.
 *
 * @param name
 *      The base name. This should be things like element names
 *      or type names.
 * @param comp
 *      The component from which the base name was taken.
 *      Used to determine how names are modified.
 */
public String deriveName( String name, XSComponent comp ) {
    XSSchema owner = comp.getOwnerSchema();

    name = getNameConverter().toClassName(name);

    if( owner!=null ) {
        BISchemaBinding sb = getBindInfo(owner).get(BISchemaBinding.class);

        if(sb!=null)    name = sb.mangleClassName(name,comp);
    }

    return name;
}
 
Example #16
Source File: BGMBuilder.java    From openjdk-8-source with GNU General Public License v2.0 5 votes vote down vote up
/** Fill-in the contents of each classes. */
private void buildContents() {
    ClassSelector cs = getClassSelector();
    SimpleTypeBuilder stb = Ring.get(SimpleTypeBuilder.class);

    for( XSSchema s : Ring.get(XSSchemaSet.class).getSchemas() ) {
        BISchemaBinding sb = getBindInfo(s).get(BISchemaBinding.class);

        if(sb!=null && !sb.map) {
            sb.markAsAcknowledged();
            continue;       // no mapping for this package
        }

        getClassSelector().pushClassScope( new CClassInfoParent.Package(
            getClassSelector().getPackage(s.getTargetNamespace())) );

        checkMultipleSchemaBindings(s);
        processPackageJavadoc(s);
        populate(s.getAttGroupDecls(),s);
        populate(s.getAttributeDecls(),s);
        populate(s.getElementDecls(),s);
        populate(s.getModelGroupDecls(),s);

        // fill in typeUses
        for (XSType t : s.getTypes().values()) {
            stb.refererStack.push(t);
            model.typeUses().put( getName(t), cs.bindToType(t,s) );
            stb.refererStack.pop();
        }

        getClassSelector().popClassScope();
    }
}
 
Example #17
Source File: BGMBuilder.java    From openjdk-8-source with GNU General Public License v2.0 5 votes vote down vote up
/**
 * Generates <code>package.html</code> if the customization
 * says so.
 */
private void processPackageJavadoc( XSSchema s ) {
    // look for the schema-wide customization
    BISchemaBinding cust = getBindInfo(s).get(BISchemaBinding.class);
    if(cust==null)      return; // not present

    cust.markAsAcknowledged();
    if( cust.getJavadoc()==null )   return;     // no javadoc customization

    // produce a HTML file
    JTextFile html = new JTextFile("package.html");
    html.setContents(cust.getJavadoc());
    getClassSelector().getPackage(s.getTargetNamespace()).addResourceFile(html);
}
 
Example #18
Source File: BGMBuilder.java    From openjdk-8-source with GNU General Public License v2.0 5 votes vote down vote up
/**
 * Derives a name from a schema component.
 *
 * This method handles prefix/suffix modification and
 * XML-to-Java name conversion.
 *
 * @param name
 *      The base name. This should be things like element names
 *      or type names.
 * @param comp
 *      The component from which the base name was taken.
 *      Used to determine how names are modified.
 */
public String deriveName( String name, XSComponent comp ) {
    XSSchema owner = comp.getOwnerSchema();

    name = getNameConverter().toClassName(name);

    if( owner!=null ) {
        BISchemaBinding sb = getBindInfo(owner).get(BISchemaBinding.class);

        if(sb!=null)    name = sb.mangleClassName(name,comp);
    }

    return name;
}
 
Example #19
Source File: BGMBuilder.java    From openjdk-8 with GNU General Public License v2.0 5 votes vote down vote up
/** Fill-in the contents of each classes. */
private void buildContents() {
    ClassSelector cs = getClassSelector();
    SimpleTypeBuilder stb = Ring.get(SimpleTypeBuilder.class);

    for( XSSchema s : Ring.get(XSSchemaSet.class).getSchemas() ) {
        BISchemaBinding sb = getBindInfo(s).get(BISchemaBinding.class);

        if(sb!=null && !sb.map) {
            sb.markAsAcknowledged();
            continue;       // no mapping for this package
        }

        getClassSelector().pushClassScope( new CClassInfoParent.Package(
            getClassSelector().getPackage(s.getTargetNamespace())) );

        checkMultipleSchemaBindings(s);
        processPackageJavadoc(s);
        populate(s.getAttGroupDecls(),s);
        populate(s.getAttributeDecls(),s);
        populate(s.getElementDecls(),s);
        populate(s.getModelGroupDecls(),s);

        // fill in typeUses
        for (XSType t : s.getTypes().values()) {
            stb.refererStack.push(t);
            model.typeUses().put( getName(t), cs.bindToType(t,s) );
            stb.refererStack.pop();
        }

        getClassSelector().popClassScope();
    }
}
 
Example #20
Source File: BGMBuilder.java    From openjdk-8 with GNU General Public License v2.0 5 votes vote down vote up
/**
 * Generates <code>package.html</code> if the customization
 * says so.
 */
private void processPackageJavadoc( XSSchema s ) {
    // look for the schema-wide customization
    BISchemaBinding cust = getBindInfo(s).get(BISchemaBinding.class);
    if(cust==null)      return; // not present

    cust.markAsAcknowledged();
    if( cust.getJavadoc()==null )   return;     // no javadoc customization

    // produce a HTML file
    JTextFile html = new JTextFile("package.html");
    html.setContents(cust.getJavadoc());
    getClassSelector().getPackage(s.getTargetNamespace()).addResourceFile(html);
}
 
Example #21
Source File: BGMBuilder.java    From openjdk-8 with GNU General Public License v2.0 5 votes vote down vote up
/**
 * Derives a name from a schema component.
 *
 * This method handles prefix/suffix modification and
 * XML-to-Java name conversion.
 *
 * @param name
 *      The base name. This should be things like element names
 *      or type names.
 * @param comp
 *      The component from which the base name was taken.
 *      Used to determine how names are modified.
 */
public String deriveName( String name, XSComponent comp ) {
    XSSchema owner = comp.getOwnerSchema();

    name = getNameConverter().toClassName(name);

    if( owner!=null ) {
        BISchemaBinding sb = getBindInfo(owner).get(BISchemaBinding.class);

        if(sb!=null)    name = sb.mangleClassName(name,comp);
    }

    return name;
}
 
Example #22
Source File: BGMBuilder.java    From openjdk-jdk8u with GNU General Public License v2.0 5 votes vote down vote up
/**
 * Derives a name from a schema component.
 *
 * This method handles prefix/suffix modification and
 * XML-to-Java name conversion.
 *
 * @param name
 *      The base name. This should be things like element names
 *      or type names.
 * @param comp
 *      The component from which the base name was taken.
 *      Used to determine how names are modified.
 */
public String deriveName( String name, XSComponent comp ) {
    XSSchema owner = comp.getOwnerSchema();

    name = getNameConverter().toClassName(name);

    if( owner!=null ) {
        BISchemaBinding sb = getBindInfo(owner).get(BISchemaBinding.class);

        if(sb!=null)    name = sb.mangleClassName(name,comp);
    }

    return name;
}
 
Example #23
Source File: BGMBuilder.java    From jdk8u60 with GNU General Public License v2.0 5 votes vote down vote up
/**
 * Generates <code>package.html</code> if the customization
 * says so.
 */
private void processPackageJavadoc( XSSchema s ) {
    // look for the schema-wide customization
    BISchemaBinding cust = getBindInfo(s).get(BISchemaBinding.class);
    if(cust==null)      return; // not present

    cust.markAsAcknowledged();
    if( cust.getJavadoc()==null )   return;     // no javadoc customization

    // produce a HTML file
    JTextFile html = new JTextFile("package.html");
    html.setContents(cust.getJavadoc());
    getClassSelector().getPackage(s.getTargetNamespace()).addResourceFile(html);
}
 
Example #24
Source File: BGMBuilder.java    From jdk8u60 with GNU General Public License v2.0 5 votes vote down vote up
/**
 * Derives a name from a schema component.
 *
 * This method handles prefix/suffix modification and
 * XML-to-Java name conversion.
 *
 * @param name
 *      The base name. This should be things like element names
 *      or type names.
 * @param comp
 *      The component from which the base name was taken.
 *      Used to determine how names are modified.
 */
public String deriveName( String name, XSComponent comp ) {
    XSSchema owner = comp.getOwnerSchema();

    name = getNameConverter().toClassName(name);

    if( owner!=null ) {
        BISchemaBinding sb = getBindInfo(owner).get(BISchemaBinding.class);

        if(sb!=null)    name = sb.mangleClassName(name,comp);
    }

    return name;
}
 
Example #25
Source File: BGMBuilder.java    From jdk8u60 with GNU General Public License v2.0 5 votes vote down vote up
/** Fill-in the contents of each classes. */
private void buildContents() {
    ClassSelector cs = getClassSelector();
    SimpleTypeBuilder stb = Ring.get(SimpleTypeBuilder.class);

    for( XSSchema s : Ring.get(XSSchemaSet.class).getSchemas() ) {
        BISchemaBinding sb = getBindInfo(s).get(BISchemaBinding.class);

        if(sb!=null && !sb.map) {
            sb.markAsAcknowledged();
            continue;       // no mapping for this package
        }

        getClassSelector().pushClassScope( new CClassInfoParent.Package(
            getClassSelector().getPackage(s.getTargetNamespace())) );

        checkMultipleSchemaBindings(s);
        processPackageJavadoc(s);
        populate(s.getAttGroupDecls(),s);
        populate(s.getAttributeDecls(),s);
        populate(s.getElementDecls(),s);
        populate(s.getModelGroupDecls(),s);

        // fill in typeUses
        for (XSType t : s.getTypes().values()) {
            stb.refererStack.push(t);
            model.typeUses().put( getName(t), cs.bindToType(t,s) );
            stb.refererStack.pop();
        }

        getClassSelector().popClassScope();
    }
}
 
Example #26
Source File: BGMBuilder.java    From openjdk-jdk8u-backup with GNU General Public License v2.0 5 votes vote down vote up
/**
 * Derives a name from a schema component.
 *
 * This method handles prefix/suffix modification and
 * XML-to-Java name conversion.
 *
 * @param name
 *      The base name. This should be things like element names
 *      or type names.
 * @param comp
 *      The component from which the base name was taken.
 *      Used to determine how names are modified.
 */
public String deriveName( String name, XSComponent comp ) {
    XSSchema owner = comp.getOwnerSchema();

    name = getNameConverter().toClassName(name);

    if( owner!=null ) {
        BISchemaBinding sb = getBindInfo(owner).get(BISchemaBinding.class);

        if(sb!=null)    name = sb.mangleClassName(name,comp);
    }

    return name;
}
 
Example #27
Source File: BGMBuilder.java    From openjdk-jdk8u with GNU General Public License v2.0 5 votes vote down vote up
/** Fill-in the contents of each classes. */
private void buildContents() {
    ClassSelector cs = getClassSelector();
    SimpleTypeBuilder stb = Ring.get(SimpleTypeBuilder.class);

    for( XSSchema s : Ring.get(XSSchemaSet.class).getSchemas() ) {
        BISchemaBinding sb = getBindInfo(s).get(BISchemaBinding.class);

        if(sb!=null && !sb.map) {
            sb.markAsAcknowledged();
            continue;       // no mapping for this package
        }

        getClassSelector().pushClassScope( new CClassInfoParent.Package(
            getClassSelector().getPackage(s.getTargetNamespace())) );

        checkMultipleSchemaBindings(s);
        processPackageJavadoc(s);
        populate(s.getAttGroupDecls(),s);
        populate(s.getAttributeDecls(),s);
        populate(s.getElementDecls(),s);
        populate(s.getModelGroupDecls(),s);

        // fill in typeUses
        for (XSType t : s.getTypes().values()) {
            stb.refererStack.push(t);
            model.typeUses().put( getName(t), cs.bindToType(t,s) );
            stb.refererStack.pop();
        }

        getClassSelector().popClassScope();
    }
}
 
Example #28
Source File: BGMBuilder.java    From openjdk-jdk8u with GNU General Public License v2.0 5 votes vote down vote up
/**
 * Generates <code>package.html</code> if the customization
 * says so.
 */
private void processPackageJavadoc( XSSchema s ) {
    // look for the schema-wide customization
    BISchemaBinding cust = getBindInfo(s).get(BISchemaBinding.class);
    if(cust==null)      return; // not present

    cust.markAsAcknowledged();
    if( cust.getJavadoc()==null )   return;     // no javadoc customization

    // produce a HTML file
    JTextFile html = new JTextFile("package.html");
    html.setContents(cust.getJavadoc());
    getClassSelector().getPackage(s.getTargetNamespace()).addResourceFile(html);
}
 
Example #29
Source File: BGMBuilder.java    From TencentKona-8 with GNU General Public License v2.0 5 votes vote down vote up
/**
 * Derives a name from a schema component.
 *
 * This method handles prefix/suffix modification and
 * XML-to-Java name conversion.
 *
 * @param name
 *      The base name. This should be things like element names
 *      or type names.
 * @param comp
 *      The component from which the base name was taken.
 *      Used to determine how names are modified.
 */
public String deriveName( String name, XSComponent comp ) {
    XSSchema owner = comp.getOwnerSchema();

    name = getNameConverter().toClassName(name);

    if( owner!=null ) {
        BISchemaBinding sb = getBindInfo(owner).get(BISchemaBinding.class);

        if(sb!=null)    name = sb.mangleClassName(name,comp);
    }

    return name;
}
 
Example #30
Source File: BGMBuilder.java    From TencentKona-8 with GNU General Public License v2.0 5 votes vote down vote up
/**
 * Generates <code>package.html</code> if the customization
 * says so.
 */
private void processPackageJavadoc( XSSchema s ) {
    // look for the schema-wide customization
    BISchemaBinding cust = getBindInfo(s).get(BISchemaBinding.class);
    if(cust==null)      return; // not present

    cust.markAsAcknowledged();
    if( cust.getJavadoc()==null )   return;     // no javadoc customization

    // produce a HTML file
    JTextFile html = new JTextFile("package.html");
    html.setContents(cust.getJavadoc());
    getClassSelector().getPackage(s.getTargetNamespace()).addResourceFile(html);
}