Examples of ElementDecl


Examples of org.apache.axis.wsdl.symbolTable.ElementDecl

            // These signatures comply with Bean Indexed Properties which seems
            // like the reasonable approach to take for collection types.
            // (It may be more efficient to handle this with an ArrayList...but
            // for the initial support it was easier to use an actual array.)
            if (elements != null && j < elements.size()) {
                ElementDecl elem = (ElementDecl)elements.get(j);
                if (elem.getType().getQName().getLocalPart().indexOf("[") > 0) {
                    String compName = typeName.substring(0, typeName.lastIndexOf("["));
                    if (enableGetters) {
                        pw.println("    public " + compName + " " + get + capName +
                                   "(int i) {");
                        pw.println("        return " + name + "[i];");
View Full Code Here

Examples of org.apache.axis.wsdl.symbolTable.ElementDecl

          // Process the elements
          Vector elements = SchemaUtils.getContainedElementDeclarations(
                      te.getNode(), symbolTable);
          if (elements != null) {
            for (int j=0; j<elements.size(); j++) {
              ElementDecl elem = (ElementDecl)elements.get(j);
              QName typeName = elem.getType().getQName();
              ElementInfo eleinfo = null;
              if(typeName.getLocalPart().indexOf('[')>0){
                String localpart = typeName.getLocalPart().substring(0,typeName.getLocalPart().indexOf('['));
                typeName = new QName(typeName.getNamespaceURI(),localpart);
                if (CUtils.isBasicType(typeName)){
                  eleinfo = new ElementInfo(elem.getName(),createTypeInfo(typeName,targetLanguage));
                }
                else{
                  eleinfo = new ElementInfo(elem.getName(),createTypeInfo(elem.getType(),targetLanguage));
                }
              }
              else{
                eleinfo = new ElementInfo(elem.getName(),createTypeInfo(typeName,targetLanguage));               
              }
              eleinfo.setMinOccurs(elem.getMinOccrs());
              eleinfo.setMaxOccurs(elem.getMaxOccurs());
              typedata.setTypeNameForElementName(eleinfo);
            }     
          }
        }
      }
View Full Code Here

Examples of org.dom4j.dtd.ElementDecl

   * @throws SAXException The application may raise an exception.
   */
  public void elementDecl(String name, String model) throws SAXException {
    if (internalDTDsubset) {
      if (includeInternalDTDDeclarations) {
        addDTDDeclaration(new ElementDecl(name, model));
      }
    } else {
      if (includeExternalDTDDeclarations) {
        addExternalDTDDeclaration(new ElementDecl(name, model));
      }
    }
  }
View Full Code Here

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

       //-- convert General Entity declarations

       // convert Element declarations
       Enumeration dtdElements = dtd.getElements();
       Element dtdElement; // DTD Element declaration
       ElementDecl schemaElement; // Schema Element declaration

       while (dtdElements.hasMoreElements()) {
          dtdElement = (Element)dtdElements.nextElement();
          schemaElement = convertDTDElementToSchemaElement(dtdElement, schema);
          schema.addElementDecl(schemaElement);
View Full Code Here

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

       String name = dtdElement.getName();
       if (name == null || name.equals("")) {
          String err = "DTD to Schema converter: a DTD element has no name.";
          throw new DTDException(err);
       }
       ElementDecl schemaElement = new ElementDecl(schema, name);

       // start converting content of the element
       ComplexType complexType = schema.createComplexType();
       ContentType contentType = null;
       Group group = null; // auxiliary
       Iterator mixedChildrenIterator = null; // auxiliary
       String elementRef = null; // auxiliary
       ElementDecl elem = null// auxiliary

       if (dtdElement.isEmptyContent()) {

          // mixed="false"
          contentType = ContentType.elemOnly;
          //-- mixed="false"

       } else if (dtdElement.isAnyContent()) {

          // mixed="true"
          contentType = ContentType.mixed;
          //-- mixed="true"

          group = new Group();
          group.setOrder(Order.sequence);
          group.setMinOccurs(0);
          group.setMaxOccurs(-1);
          Wildcard any = new Wildcard(group);
          group.addWildcard(any);
          complexType.addGroup(group);

       } else if (dtdElement.isElemOnlyContent()) {

          // mixed="false"
          contentType = ContentType.elemOnly;
          //-- mixed="false"

          ContentParticle dtdContent = dtdElement.getContent();
          if (dtdContent == null) { // content is not specified
             String err = "DTD to Schema converter: element \"" + dtdElement.getName();
             err += "\" has no content.";
             throw new DTDException(err);
          }

          Particle content = null;
          try {
             content = convertContentParticle(dtdContent, schema);
          }
          catch (DTDException e) {
             String err = "DTD to Schema converter: content of DTD element \"" + dtdElement.getName();
             err += "\", represented by a Content Particle, is malformed.";
             throw new DTDException(err);
          }

          if (content instanceof ElementDecl) {
             group = new Group();
             group.setOrder(Order.sequence);
             group.addElementDecl((ElementDecl)content);
             complexType.addGroup(group);
          } else {
             complexType.addGroup((Group)content);
          }

       } else if (dtdElement.isMixedContent()) {

          // mixed="true"
          contentType = ContentType.mixed;
          //-- mixed="true"

          mixedChildrenIterator = dtdElement.getMixedContentChildren();
          if ((mixedChildrenIterator != null) && (mixedChildrenIterator.hasNext())) {
             group = new Group();
             group.setOrder(Order.choice);
             group.setMinOccurs(0);
             group.setMaxOccurs(-1);
             while (mixedChildrenIterator.hasNext()) {
                elementRef = (String)mixedChildrenIterator.next();
                elem = new ElementDecl(schema);
                elem.setReferenceName(elementRef);
                group.addElementDecl(elem);
             }
             complexType.addGroup(group);
          }
View Full Code Here

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

       Particle returnValue;

       if (dtdContent.isReferenceType()) {

          ElementDecl elem = new ElementDecl(schema);
          elem.setReferenceName(dtdContent.getReference());
          returnValue = elem;

       } else if (dtdContent.isSeqType() || dtdContent.isChoiceType()) {

          Group group = new Group();
View Full Code Here

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

        assertEquals(1, jdoContent.size());
        Table t = (Table) jdoContent.get(0);
        assertEquals("book", t.getName());
        assertEquals("isbn", t.getPrimaryKey().getKey(0));

        ElementDecl isbn = bookType.getElementDecl("isbn");
        annotations = isbn.getAnnotations();
        annotation = (Annotation) annotations.nextElement();
        appInfos = annotation.getAppInfo();
        appInfo = (AppInfo) appInfos.nextElement();
        jdoContent = appInfo.getJdoContent();

        assertEquals(1, jdoContent.size());
        Column c = (Column) jdoContent.get(0);
        assertEquals("isbn", c.getName());
        assertEquals("jdo:string", c.getType());

        ElementDecl title = bookType.getElementDecl("title");
        annotations = title.getAnnotations();
        annotation = (Annotation) annotations.nextElement();
        appInfos = annotation.getAppInfo();
        appInfo = (AppInfo) appInfos.nextElement();
        jdoContent = appInfo.getJdoContent();
View Full Code Here

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

        AppInfo appInfo = (AppInfo) appInfos.nextElement();
        List jdoContent = appInfo.getJdoContent();

        assertEquals(0, jdoContent.size());

        ElementDecl isbn = bookType.getElementDecl("isbn");
        annotations = isbn.getAnnotations();
        annotation = (Annotation) annotations.nextElement();
        appInfos = annotation.getAppInfo();
        appInfo = (AppInfo) appInfos.nextElement();
        jdoContent = appInfo.getJdoContent();

        assertEquals(0, jdoContent.size());

        ElementDecl title = bookType.getElementDecl("title");
        annotations = title.getAnnotations();
        annotation = (Annotation) annotations.nextElement();
        appInfos = annotation.getAppInfo();
        appInfo = (AppInfo) appInfos.nextElement();
        jdoContent = appInfo.getJdoContent();
View Full Code Here

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

        AppInfo appInfo = (AppInfo) appInfos.nextElement();
        List jdoContent = appInfo.getJdoContent();

        assertEquals(0, jdoContent.size());

        ElementDecl isbn = bookType.getElementDecl("isbn");
        annotations = isbn.getAnnotations();
        annotation = (Annotation) annotations.nextElement();
        appInfos = annotation.getAppInfo();
        appInfo = (AppInfo) appInfos.nextElement();
        jdoContent = appInfo.getJdoContent();

        assertEquals(0, jdoContent.size());

        ElementDecl title = bookType.getElementDecl("title");
        annotations = title.getAnnotations();
        annotation = (Annotation) annotations.nextElement();
        appInfos = annotation.getAppInfo();
        appInfo = (AppInfo) appInfos.nextElement();
        jdoContent = appInfo.getJdoContent();
View Full Code Here

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

        assertEquals(1, jdoContent.size());
        Table t = (Table) jdoContent.get(0);
        assertEquals("book", t.getName());
        assertEquals("isbn", t.getPrimaryKey().getKey(0));

        ElementDecl isbn = bookType.getElementDecl("isbn");
        annotations = isbn.getAnnotations();
        annotation = (Annotation) annotations.nextElement();
        appInfos = annotation.getAppInfo();
        appInfo = (AppInfo) appInfos.nextElement();
        jdoContent = appInfo.getJdoContent();

        assertEquals(1, jdoContent.size());
        Column c = (Column) jdoContent.get(0);
        assertEquals("isbn", c.getName());
        assertEquals("varchar", c.getType());

        ElementDecl title = bookType.getElementDecl("title");
        annotations = title.getAnnotations();
        annotation = (Annotation) annotations.nextElement();
        appInfos = annotation.getAppInfo();
        appInfo = (AppInfo) appInfos.nextElement();
        jdoContent = appInfo.getJdoContent();

        assertEquals(1, jdoContent.size());
        c = (Column) jdoContent.get(0);
        assertEquals("title", c.getName());
        assertEquals("varchar", c.getType());
       
        ElementDecl author = bookType.getElementDecl("author");
        annotations = author.getAnnotations();
        annotation = (Annotation) annotations.nextElement();
        appInfos = annotation.getAppInfo();
        appInfo = (AppInfo) appInfos.nextElement();
        jdoContent = appInfo.getJdoContent();
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.