Java Code Examples for com.sun.xml.xsom.XSSchema#iterateAttributeDecls()

The following examples show how to use com.sun.xml.xsom.XSSchema#iterateAttributeDecls() . 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: SchemaSetImpl.java    From jolie with GNU Lesser General Public License v2.1 5 votes vote down vote up
public Iterator<XSAttributeDecl> iterateAttributeDecls() {
    return new Iterators.Map<XSAttributeDecl,XSSchema>(iterateSchema()) {
        protected Iterator<XSAttributeDecl> apply(XSSchema u) {
            return u.iterateAttributeDecls();
        }
    };
}
 
Example 2
Source File: SchemaWriter.java    From citygml4j with Apache License 2.0 5 votes vote down vote up
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 3
Source File: SchemaWriter.java    From jolie with GNU Lesser General Public License v2.1 4 votes vote down vote up
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}\">",
            new Object[]{
                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 4
Source File: JumbuneSchemaWriter.java    From jumbune with GNU Lesser General Public License v3.0 4 votes vote down vote up
public void schema( XSSchema s) {
	
	if(this.elementsMap.size() != 0){

	StringBuffer sb = new StringBuffer();
     
     for(String prefix : uriMapping.keySet()){
    	 
    	 String uri = uriMapping.get(prefix);
    	 if(Const.schemaNamespace.equalsIgnoreCase(uri)) rootPrefix = prefix+":";
    	 sb.append("xmlns:"+prefix+"=\""+uri+"\" " );
    	 
     }
     
     if(!s.getTargetNamespace().isEmpty()){
    	 println(MessageFormat.format("<schema {0} targetNamespace=\"{1}\">",sb.toString(),s.getTargetNamespace()));
     }else{
    	 println(MessageFormat.format("<schema {0} >",sb.toString()));
     }
     
      indent++;

      Iterator<XSAttGroupDecl> itrAGD = s.iterateAttGroupDecls();
      while (itrAGD.hasNext()) {
    	  attGroupDecl(itrAGD.next());
      }

      Iterator<XSAttributeDecl> itrAD = s.iterateAttributeDecls();
      while(itrAD.hasNext()) {
    	  attributeDecl(itrAD.next());
      }

      Iterator<XSComplexType> itrCT = s.iterateComplexTypes();
      while(itrCT.hasNext()) {
    	  complexType(itrCT.next());
      }
      
      Iterator<XSElementDecl> itrED = s.iterateElementDecls();
      while(itrED.hasNext()) {
    	  elementDecl(itrED.next());
      } 
      
      Iterator<XSModelGroupDecl> itrMGD = s.iterateModelGroupDecls();
      while(itrMGD.hasNext()) {
    	  modelGroupDecl(itrMGD.next()); 
      }

      Iterator<XSSimpleType> itrST = s.iterateSimpleTypes();
      while(itrST.hasNext()) {
    	  simpleType(itrST.next());
      }

      indent--;
      println("</schema>");
	}
	//}

   
}