Examples of AttributeDecl


Examples of org.antlr.v4.codegen.model.decl.AttributeDecl

      Collection<Attribute> decls = r.args.attributes.values();
      if ( decls.size()>0 ) {
        args = new ArrayList<AttributeDecl>();
        ruleCtx.addDecls(decls);
        for (Attribute a : decls) {
          args.add(new AttributeDecl(factory, a));
        }
        ruleCtx.ctorAttrs = args;
      }
    }
    if ( r.retvals!=null ) {
View Full Code Here

Examples of org.dom4j.dtd.AttributeDecl

   */
  public void attributeDecl(String eName, String aName, String type,
                            String valueDefault, String val) throws SAXException {
    if (internalDTDsubset) {
      if (includeInternalDTDDeclarations) {
        addDTDDeclaration(new AttributeDecl(eName, aName, type,
            valueDefault, val));
      }
    } else {
      if (includeExternalDTDDeclarations) {
        addExternalDTDDeclaration(new AttributeDecl(eName, aName, type,
            valueDefault, val));
      }
    }
  }
View Full Code Here

Examples of org.dom4j.dtd.AttributeDecl

     */
    public void attributeDecl(String eName, String aName, String type,
            String valueDefault, String val) throws SAXException {
        if (internalDTDsubset) {
            if (includeInternalDTDDeclarations) {
                addDTDDeclaration(new AttributeDecl(eName, aName, type,
                        valueDefault, val));
            }
        } else {
            if (includeExternalDTDDeclarations) {
                addExternalDTDDeclaration(new AttributeDecl(eName, aName, type,
                        valueDefault, val));
            }
        }
    }
View Full Code Here

Examples of org.dom4j.dtd.AttributeDecl

    protected List getInternalDeclarations() {
        List decls = new ArrayList();

        decls.add(new ElementDecl("greeting", "(#PCDATA)"));

        decls.add(new AttributeDecl("greeting", "foo", "ID", "#IMPLIED", null));

        decls.add(new InternalEntityDecl("%boolean", "( true | false )"));

        return decls;
    }
View Full Code Here

Examples of org.dom4j.dtd.AttributeDecl

/*     */   public void attributeDecl(String eName, String aName, String type, String valueDefault, String val)
/*     */     throws SAXException
/*     */   {
/* 504 */     if (this.internalDTDsubset) {
/* 505 */       if (this.includeInternalDTDDeclarations) {
/* 506 */         addDTDDeclaration(new AttributeDecl(eName, aName, type, valueDefault, val));
/*     */       }
/*     */
/*     */     }
/* 510 */     else if (this.includeExternalDTDDeclarations)
/* 511 */       addExternalDTDDeclaration(new AttributeDecl(eName, aName, type, valueDefault, val));
/*     */   }
View Full Code Here

Examples of org.exolab.castor.xml.schema.AttributeDecl

       // finish converting content of the element

       // start attributes convertion
       Enumeration dtdAttributes = dtdElement.getAttributes();
       Attribute dtdAttribute;
       AttributeDecl schemaAttribute;

       while (dtdAttributes.hasMoreElements()) {
          dtdAttribute = (Attribute)dtdAttributes.nextElement();
          schemaAttribute = convertAttribute(dtdAttribute, schema);
          complexType.addAttributeDecl(schemaAttribute);
View Full Code Here

Examples of org.exolab.castor.xml.schema.AttributeDecl

     */
    public static AttributeDecl convertAttribute(Attribute dtdAttribute,
                                                 Schema schema)
                                                 throws DTDException {

       AttributeDecl schemaAttribute = new AttributeDecl(schema,
                                                         dtdAttribute.getName());

       SimpleType type = null;

       if (dtdAttribute.isStringType())
       {
           type = schema.getSimpleType( schema.getBuiltInTypeName(SimpleTypesFactory.STRING_TYPE) );
       }
       else if (dtdAttribute.isIDType())
       {
           type = schema.getSimpleType( schema.getBuiltInTypeName(SimpleTypesFactory.ID_TYPE) );
       }
       else if (dtdAttribute.isIDREFType())
       {
           type = schema.getSimpleType( schema.getBuiltInTypeName(SimpleTypesFactory.IDREF_TYPE) );
       }
       else if (dtdAttribute.isIDREFSType())
       {
           type = schema.getSimpleType( schema.getBuiltInTypeName(SimpleTypesFactory.IDREFS_TYPE) );
       }
       else if (dtdAttribute.isENTITYType())
       {
           type = schema.getSimpleType( schema.getBuiltInTypeName(SimpleTypesFactory.ENTITY_TYPE) );
       }
      
       else if (dtdAttribute.isENTITIESType())
       {
           type = schema.getSimpleType( schema.getBuiltInTypeName(SimpleTypesFactory.ENTITIES_TYPE) );
       }
       else if (dtdAttribute.isNMTOKENType())
       {
           type = schema.getSimpleType( schema.getBuiltInTypeName(SimpleTypesFactory.NMTOKEN_TYPE) );
       }
       else if (dtdAttribute.isNMTOKENSType())
       {
           type = schema.getSimpleType( schema.getBuiltInTypeName(SimpleTypesFactory.NMTOKENS_TYPE) );
       }
       else if (dtdAttribute.isNOTATIONType())
       {
          type = schema.createSimpleType(null,
                            schema.getBuiltInTypeName(SimpleTypesFactory.NOTATION_TYPE),
                                                                        "restriction");
           Iterator values = dtdAttribute.getValues();
           FacetFactory facetFactory = FacetFactory.getInstance();
           while (values.hasNext()) {
            Facet facet = facetFactory.createFacet(
                       Facet.ENUMERATION, (String) values.next());
            facet.setOwningType(type);
            type.addFacet(facet);
           }

       }
       else if (dtdAttribute.isEnumerationType())
       {
          type = schema.createSimpleType(null,
                            schema.getBuiltInTypeName(SimpleTypesFactory.NMTOKEN_TYPE),
                                                                        "restriction");
          Iterator values = dtdAttribute.getValues();
          FacetFactory facetFactory = FacetFactory.getInstance();
          while (values.hasNext()) {
            Facet facet = facetFactory.createFacet(
                     Facet.ENUMERATION, (String)values.next());
            facet.setOwningType(type);
            type.addFacet(facet);
          }
       }
       else
       {
          String err = "DTD to Schema converter: DTD attribute \"" + dtdAttribute.getName();
          err += "\" has unspecified type.";
          throw new DTDException(err);
       }

       schemaAttribute.setSimpleType(type);

       if (dtdAttribute.isREQUIRED()) {

          schemaAttribute.setUse(AttributeDecl.USE_REQUIRED);

       } else if (dtdAttribute.isIMPLIED()) {

          schemaAttribute.setUse(AttributeDecl.USE_OPTIONAL);

       } else if (dtdAttribute.isFIXED()) {


       } else { // DTD attribute is of "DEFAULT" type
          schemaAttribute.setDefaultValue(dtdAttribute.getDefaultValue());
       }

       return schemaAttribute;
    } //-- convertAttribute
View Full Code Here

Examples of org.exolab.castor.xml.schema.AttributeDecl

            }
        }

        //-- attribute declarations
        else if (SchemaNames.ATTRIBUTE.equals(name)) {
            AttributeDecl attrDecl =
                ((AttributeUnmarshaller)unmarshaller).getAttribute();

            _complexType.addAttributeDecl(attrDecl);
        }
        //-- attribute groups
View Full Code Here

Examples of org.exolab.castor.xml.schema.AttributeDecl

                throw new IllegalArgumentException(e.getMessage());
            }
        }
    //-- attribute
    else if (SchemaNames.ATTRIBUTE.equals(name)) {
            AttributeDecl attrDecl =
                ((AttributeUnmarshaller)unmarshaller).getAttribute();

             /* TODO: do the validation later*/
            _complexType.addAttributeDecl(attrDecl);
        }
View Full Code Here

Examples of org.exolab.castor.xml.schema.AttributeDecl

        }
        //Note: the attributes are added to the complexType
        //since a simpleType does not contain attributes at all
        //-- attribute
    else if (SchemaNames.ATTRIBUTE.equals(name)) {
            AttributeDecl attrDecl =
                ((AttributeUnmarshaller)unmarshaller).getAttribute();

      /* TODO add the validation code later*/

      /*ComplexType baseType = (ComplexType)_complexType.getBaseType();
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.