com.sun.xml.internal.xsom.XSSchema Java Examples
The following examples show how to use
com.sun.xml.internal.xsom.XSSchema.
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 openjdk-8-source with GNU General Public License v2.0 | 6 votes |
/** 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-jdk9 with GNU General Public License v2.0 | 6 votes |
/** 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: SchemaSetImpl.java From hottub with GNU General Public License v2.0 | 5 votes |
public Iterator<XSIdentityConstraint> iterateIdentityConstraints() { return new Iterators.Map<XSIdentityConstraint,XSSchema>(iterateSchema()) { protected Iterator<XSIdentityConstraint> apply(XSSchema u) { return u.getIdentityConstraints().values().iterator(); } }; }
Example #4
Source File: BGMBuilder.java From openjdk-8-source with GNU General Public License v2.0 | 5 votes |
/** 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 #5
Source File: SchemaSetImpl.java From jdk8u60 with GNU General Public License v2.0 | 5 votes |
public Iterator<XSModelGroupDecl> iterateModelGroupDecls() { return new Iterators.Map<XSModelGroupDecl,XSSchema>(iterateSchema()) { protected Iterator<XSModelGroupDecl> apply(XSSchema u) { return u.iterateModelGroupDecls(); } }; }
Example #6
Source File: SchemaSetImpl.java From openjdk-8-source with GNU General Public License v2.0 | 5 votes |
public Iterator<XSNotation> iterateNotations() { return new Iterators.Map<XSNotation,XSSchema>(iterateSchema()) { protected Iterator<XSNotation> apply(XSSchema u) { return u.iterateNotations(); } }; }
Example #7
Source File: SchemaSetImpl.java From jdk8u60 with GNU General Public License v2.0 | 5 votes |
public Iterator<XSAttributeDecl> iterateAttributeDecls() { return new Iterators.Map<XSAttributeDecl,XSSchema>(iterateSchema()) { protected Iterator<XSAttributeDecl> apply(XSSchema u) { return u.iterateAttributeDecls(); } }; }
Example #8
Source File: RefererFinder.java From openjdk-jdk8u-backup with GNU General Public License v2.0 | 5 votes |
public void schemaSet(XSSchemaSet xss) { if(!visited.add(xss)) return; for (XSSchema xs : xss.getSchemas()) { schema(xs); } }
Example #9
Source File: SchemaSetImpl.java From openjdk-jdk8u with GNU General Public License v2.0 | 5 votes |
public Iterator<XSElementDecl> iterateElementDecls() { return new Iterators.Map<XSElementDecl,XSSchema>(iterateSchema()) { protected Iterator<XSElementDecl> apply(XSSchema u) { return u.iterateElementDecls(); } }; }
Example #10
Source File: Axis.java From hottub with GNU General Public License v2.0 | 5 votes |
public Iterator<XSSchema> iterator(Iterator<? extends XSComponent> contextNodes) { return new Iterators.Adapter<XSSchema,XSComponent>(contextNodes) { protected XSSchema filter(XSComponent u) { return u.getOwnerSchema(); } }; }
Example #11
Source File: Axis.java From openjdk-jdk8u-backup with GNU General Public License v2.0 | 5 votes |
public Iterator<XSSchema> iterator(Iterator<? extends XSComponent> contextNodes) { if(!contextNodes.hasNext()) return Iterators.empty(); else // this assumes that all current nodes belong to the same owner. return iterator(contextNodes.next()); }
Example #12
Source File: SchemaSetImpl.java From openjdk-jdk8u-backup with GNU General Public License v2.0 | 5 votes |
public Iterator<XSAttGroupDecl> iterateAttGroupDecls() { return new Iterators.Map<XSAttGroupDecl,XSSchema>(iterateSchema()) { protected Iterator<XSAttGroupDecl> apply(XSSchema u) { return u.iterateAttGroupDecls(); } }; }
Example #13
Source File: ComplexTypeImpl.java From openjdk-8 with GNU General Public License v2.0 | 5 votes |
public List<XSElementDecl> getElementDecls() { ArrayList declList = new ArrayList(); XSSchemaSet schemaSet = getRoot(); for (XSSchema sch : schemaSet.getSchemas()) { for (XSElementDecl decl : sch.getElementDecls().values()) { if (decl.getType().equals(this)) { declList.add(decl); } } } return declList; }
Example #14
Source File: SchemaSetImpl.java From openjdk-8 with GNU General Public License v2.0 | 5 votes |
public Iterator<XSModelGroupDecl> iterateModelGroupDecls() { return new Iterators.Map<XSModelGroupDecl,XSSchema>(iterateSchema()) { protected Iterator<XSModelGroupDecl> apply(XSSchema u) { return u.iterateModelGroupDecls(); } }; }
Example #15
Source File: RefererFinder.java From openjdk-8-source with GNU General Public License v2.0 | 5 votes |
public void schemaSet(XSSchemaSet xss) { if(!visited.add(xss)) return; for (XSSchema xs : xss.getSchemas()) { schema(xs); } }
Example #16
Source File: SchemaSetImpl.java From openjdk-jdk8u-backup with GNU General Public License v2.0 | 5 votes |
public Iterator<XSAttributeDecl> iterateAttributeDecls() { return new Iterators.Map<XSAttributeDecl,XSSchema>(iterateSchema()) { protected Iterator<XSAttributeDecl> apply(XSSchema u) { return u.iterateAttributeDecls(); } }; }
Example #17
Source File: SchemaSetImpl.java From openjdk-jdk9 with GNU General Public License v2.0 | 5 votes |
public Iterator<XSElementDecl> iterateElementDecls() { return new Iterators.Map<XSElementDecl,XSSchema>(iterateSchema()) { protected Iterator<XSElementDecl> apply(XSSchema u) { return u.iterateElementDecls(); } }; }
Example #18
Source File: Axis.java From openjdk-jdk9 with GNU General Public License v2.0 | 5 votes |
public Iterator<XSSchema> iterator(Iterator<? extends XSComponent> contextNodes) { return new Iterators.Adapter<XSSchema,XSComponent>(contextNodes) { protected XSSchema filter(XSComponent u) { return u.getOwnerSchema(); } }; }
Example #19
Source File: SchemaSetImpl.java From openjdk-8 with GNU General Public License v2.0 | 5 votes |
public Iterator<XSElementDecl> iterateElementDecls() { return new Iterators.Map<XSElementDecl,XSSchema>(iterateSchema()) { protected Iterator<XSElementDecl> apply(XSSchema u) { return u.iterateElementDecls(); } }; }
Example #20
Source File: SchemaWriter.java From openjdk-jdk9 with GNU General Public License v2.0 | 5 votes |
public void schema( XSSchema s ) { // QUICK HACK: don't print the built-in components if(s.getTargetNamespace().equals(Const.schemaNamespace)) return; println(MessageFormat.format("<schema targetNamespace=\"{0}\">", s.getTargetNamespace())); indent++; Iterator itr; itr = s.iterateAttGroupDecls(); while(itr.hasNext()) attGroupDecl( (XSAttGroupDecl)itr.next() ); itr = s.iterateAttributeDecls(); while(itr.hasNext()) attributeDecl( (XSAttributeDecl)itr.next() ); itr = s.iterateComplexTypes(); while(itr.hasNext()) complexType( (XSComplexType)itr.next() ); itr = s.iterateElementDecls(); while(itr.hasNext()) elementDecl( (XSElementDecl)itr.next() ); itr = s.iterateModelGroupDecls(); while(itr.hasNext()) modelGroupDecl( (XSModelGroupDecl)itr.next() ); itr = s.iterateSimpleTypes(); while(itr.hasNext()) simpleType( (XSSimpleType)itr.next() ); indent--; println("</schema>"); }
Example #21
Source File: SchemaSetImpl.java From openjdk-8-source with GNU General Public License v2.0 | 5 votes |
public Iterator<XSModelGroupDecl> iterateModelGroupDecls() { return new Iterators.Map<XSModelGroupDecl,XSSchema>(iterateSchema()) { protected Iterator<XSModelGroupDecl> apply(XSSchema u) { return u.iterateModelGroupDecls(); } }; }
Example #22
Source File: SchemaSetImpl.java From openjdk-8-source with GNU General Public License v2.0 | 5 votes |
public List<XSElementDecl> getElementDecls() { ArrayList declList = new ArrayList(); XSSchemaSet schemaSet = getRoot(); for (XSSchema sch : schemaSet.getSchemas()) { for (XSElementDecl decl : sch.getElementDecls().values()) { if (decl.getType().equals(this)) { declList.add(decl); } } } return declList; }
Example #23
Source File: SchemaSetImpl.java From openjdk-jdk8u-backup with GNU General Public License v2.0 | 5 votes |
public Iterator<XSModelGroupDecl> iterateModelGroupDecls() { return new Iterators.Map<XSModelGroupDecl,XSSchema>(iterateSchema()) { protected Iterator<XSModelGroupDecl> apply(XSSchema u) { return u.iterateModelGroupDecls(); } }; }
Example #24
Source File: SchemaTreeTraverser.java From hottub with GNU General Public License v2.0 | 5 votes |
public void schema(XSSchema s) { // QUICK HACK: don't print the built-in components if (s.getTargetNamespace().equals(Const.schemaNamespace)) { return; } SchemaTreeNode newNode = new SchemaTreeNode("Schema " + s.getLocator().getSystemId(), s.getLocator()); this.currNode = newNode; this.model.addSchemaNode(newNode); for (XSAttGroupDecl groupDecl : s.getAttGroupDecls().values()) { attGroupDecl(groupDecl); } for (XSAttributeDecl attrDecl : s.getAttributeDecls().values()) { attributeDecl(attrDecl); } for (XSComplexType complexType : s.getComplexTypes().values()) { complexType(complexType); } for (XSElementDecl elementDecl : s.getElementDecls().values()) { elementDecl(elementDecl); } for (XSModelGroupDecl modelGroupDecl : s.getModelGroupDecls().values()) { modelGroupDecl(modelGroupDecl); } for (XSSimpleType simpleType : s.getSimpleTypes().values()) { simpleType(simpleType); } }
Example #25
Source File: BGMBuilder.java From TencentKona-8 with GNU General Public License v2.0 | 5 votes |
/** * 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 #26
Source File: BGMBuilder.java From openjdk-jdk8u-backup with GNU General Public License v2.0 | 5 votes |
/** 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 #27
Source File: SchemaSetImpl.java From openjdk-jdk8u with GNU General Public License v2.0 | 5 votes |
public Iterator<XSAttributeDecl> iterateAttributeDecls() { return new Iterators.Map<XSAttributeDecl,XSSchema>(iterateSchema()) { protected Iterator<XSAttributeDecl> apply(XSSchema u) { return u.iterateAttributeDecls(); } }; }
Example #28
Source File: BGMBuilder.java From TencentKona-8 with GNU General Public License v2.0 | 5 votes |
/** 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 #29
Source File: Axis.java From TencentKona-8 with GNU General Public License v2.0 | 5 votes |
public Iterator<XSSchema> iterator(Iterator<? extends XSComponent> contextNodes) { return new Iterators.Adapter<XSSchema,XSComponent>(contextNodes) { protected XSSchema filter(XSComponent u) { return u.getOwnerSchema(); } }; }
Example #30
Source File: RefererFinder.java From hottub with GNU General Public License v2.0 | 5 votes |
public void schemaSet(XSSchemaSet xss) { if(!visited.add(xss)) return; for (XSSchema xs : xss.getSchemas()) { schema(xs); } }