Examples of XSDTypeDefinition


Examples of org.eclipse.xsd.XSDTypeDefinition

    }
    return result;
  }
 
  protected XSDTypeDefinition getEffectiveTypeDefinition(XSDComponent xsdComponent, XSDFeature xsdFeature) {
    XSDTypeDefinition typeDef = getEcoreTypeQNameAttribute(xsdComponent, "dataType");

    String isString = getEcoreAttribute(xsdComponent, xsdFeature, "string");
    if ("true".equalsIgnoreCase(isString)) {
      typeDef =
        xsdFeature.resolveSimpleTypeDefinition(rootSchema.getSchemaForSchemaNamespace(), "string");
View Full Code Here

Examples of org.eclipse.xsd.XSDTypeDefinition

    }
    return result;
  }
 
  protected XSDTypeDefinition getEffectiveTypeDefinition(XSDComponent xsdComponent, XSDFeature xsdFeature) {
    XSDTypeDefinition typeDef = getEcoreTypeQNameAttribute(xsdComponent, "dataType");

    String isString = getEcoreAttribute(xsdComponent, xsdFeature, "string");
    if ("true".equalsIgnoreCase(isString)) {
      typeDef =
        xsdFeature.resolveSimpleTypeDefinition(rootSchema.getSchemaForSchemaNamespace(), "string");
View Full Code Here

Examples of org.eclipse.xsd.XSDTypeDefinition

        //the Value particle we must retype

        //first guess its type
        QName newTypeName = guessValueType(property.getValue());
        XSDTypeDefinition type = (newTypeName != null) ? index.getTypeDefinition(newTypeName) : null;

        if (type != null) {
            //create a new particle based on the new type
            XSDElementDeclaration value = XSDFactory.eINSTANCE.createXSDElementDeclaration();
            value.setName("Value");
View Full Code Here

Examples of org.eclipse.xsd.XSDTypeDefinition

            catch( Exception e ) {
                LOGGER.warning( "Unable to parse " + schemaFile.getAbsolutePath() + "." +
                    " Falling back on native feature type");
            }
            if ( schema != null ) {
                XSDTypeDefinition type = null;
                for ( Iterator e = schema.getElementDeclarations().iterator(); e.hasNext(); ) {
                    XSDElementDeclaration element = (XSDElementDeclaration) e.next();
                    if ( ft.getName().equals( element.getName() ) ) {
                        type = element.getTypeDefinition();
                        break;
                    }
                }
                if ( type == null ) {
                    for ( Iterator t = schema.getTypeDefinitions().iterator(); t.hasNext(); ) {
                        XSDTypeDefinition typedef = (XSDTypeDefinition) t.next();
                        if ( (ft.getName() + "_Type").equals( typedef.getName() ) ) {
                            type = typedef;
                            break;
                        }
                    }
                }
View Full Code Here

Examples of org.eclipse.xsd.XSDTypeDefinition

                        schema.resolveElementDeclaration(gmlNamespace, substitutionGroup));
                   
                    //find the type of the element
                    List<XSDComplexTypeDefinition> candidates = new ArrayList<XSDComplexTypeDefinition>();
                    for ( Iterator t = ftSchema.getTypeDefinitions().iterator(); t.hasNext(); ) {
                        XSDTypeDefinition type = (XSDTypeDefinition) t.next();
                        if ( type instanceof XSDComplexTypeDefinition ) {
                            XSDTypeDefinition base = type.getBaseType();
                            while(base != null ) {
                                if ( baseType.equals(base.getName())
                                    && gmlNamespace.equals( base.getTargetNamespace() ) ) {
                                   
                                    candidates.add( (XSDComplexTypeDefinition) type );
                                    break;
                                }  
                                if ( base.equals( base.getBaseType() ) ) {
                                    break;
                                }
                                base = base.getBaseType();
                            }
                        }
                    }
                   
                    if ( candidates.size() != 1 ) {
View Full Code Here

Examples of org.eclipse.xsd.XSDTypeDefinition

                        }
                    }
                }

                XSDTypeDefinition type = schema.resolveTypeDefinition(typeName.getNamespaceURI(),
                        typeName.getLocalPart());
                element.setTypeDefinition(type);

                XSDParticle particle = factory.createXSDParticle();
                particle.setMinOccurs(attribute.getMinOccurs());
View Full Code Here

Examples of org.eclipse.xsd.XSDTypeDefinition

        XSDFactory factory = XSDFactory.eINSTANCE;
        XSDElementDeclaration element = factory.createXSDElementDeclaration();
        element.setName(elementName);
        element.setNillable(nillable);

        XSDTypeDefinition type = schema.resolveTypeDefinition(typeNS, typeName);
        element.setTypeDefinition(type);

        XSDParticle particle = factory.createXSDParticle();
        particle.setMinOccurs(minOccurs);
        particle.setMaxOccurs(maxOccurs);
View Full Code Here

Examples of org.eclipse.xsd.XSDTypeDefinition

            if (typeName == null) {
                throw new NullPointerException("Could not find a type for property: "
                    + attribute.getName() + " of type: " + binding.getName());
            }

            XSDTypeDefinition type = index.getTypeDefinition( new QName( typeName.getNamespaceURI(), typeName.getLocalPart() ) );
            if ( type == null ) {
                throw new IllegalStateException( "Could not find type: " + typeName );
            }
            //XSDTypeDefinition type = schema.resolveTypeDefinition(typeName.getNamespaceURI(),
            //        typeName.getLocalPart());
View Full Code Here

Examples of org.eclipse.xsd.XSDTypeDefinition

                .getChildElementDeclaration(element, new QName(
                        MockData.CGF_URI,
                        "lineStringProperty"));
        assertNotNull(lineStringProperty);

        XSDTypeDefinition lineStringPropertyType = lineStringProperty.getType();
        assertEquals(GML.NAMESPACE, lineStringPropertyType.getTargetNamespace());
        assertEquals(GML.LINESTRINGPROPERTYTYPE.getLocalPart(),
                lineStringPropertyType.getName());

        XSDTypeDefinition geometryAssociationType = lineStringPropertyType
                .getBaseType();
        assertNotNull(geometryAssociationType);
        assertEquals(GML.NAMESPACE, geometryAssociationType
                .getTargetNamespace());
        assertEquals(GML.GEOMETRYASSOCIATIONTYPE.getLocalPart(),
                geometryAssociationType.getName());
    }
View Full Code Here

Examples of org.eclipse.xsd.XSDTypeDefinition

    return result;
  }

  public XSDTypeDefinition resolveTypeDefinitionURI(String uri)
  {
    XSDTypeDefinition result = null;
    int index = uri.lastIndexOf("#");
    if (index != -1)
    {
      result = resolveTypeDefinition(uri.substring(0, index), uri.substring(index + 1));
    }
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.