Examples of SchemaProperty


Examples of org.apache.xmlbeans.SchemaProperty

        for (int i = 0; i < props.length; i++)
        {
            SchemaPropertyImpl sImpl = (SchemaPropertyImpl)props[i];

            SchemaProperty baseProp =
               (sImpl.isAttribute() ?
                    baseType.getAttributeProperty(sImpl.getName()) :
                    baseType.getElementProperty(sImpl.getName()));

            if ((baseProp != null) != doInherited)
                continue;

            QName propQName = sImpl.getName();

            String theName;

            if (baseProp == null)
                theName = pickJavaPropertyName(usedNames, propQName.getLocalPart(),
                    state.getJavaname(propQName, sImpl.isAttribute() ? BindingConfig.QNAME_ACCESSOR_ATTRIBUTE :
                    BindingConfig.QNAME_ACCESSOR_ELEMENT));
            else
                theName = baseProp.getJavaPropertyName();

            sImpl.setJavaPropertyName(theName);

            boolean isArray = (sImpl.getMaxOccurs() == null ||
                sImpl.getMaxOccurs().compareTo(BigInteger.ONE) > 0);
            boolean isSingleton = !isArray && (sImpl.getMaxOccurs().signum() > 0);
            boolean isOption = isSingleton && (sImpl.getMinOccurs().signum() == 0);
            SchemaType javaBasedOnType = sImpl.getType();

            if (baseProp != null)
            {
                if (baseProp.extendsJavaArray())
                {
                    isSingleton = false;
                    isOption = false;
                    isArray = true;
                }
                if (baseProp.extendsJavaSingleton())
                {
                    isSingleton = true;
                }
                if (baseProp.extendsJavaOption())
                {
                    isOption = true;
                }
                javaBasedOnType = baseProp.javaBasedOnType();
            }

            sImpl.setExtendsJava(javaBasedOnType.getRef(), isSingleton, isOption, isArray);
        }
View Full Code Here

Examples of org.apache.xmlbeans.SchemaProperty

    static boolean isPropertyModelOrderInsensitive(SchemaProperty[] properties)
    {
        for (int i = 0; i < properties.length; i++)
        {
            SchemaProperty prop = properties[i];
            if (prop.hasNillable() == SchemaProperty.VARIABLE)
                return false;
            if (prop.hasDefault() == SchemaProperty.VARIABLE)
                return false;
            if (prop.hasFixed() == SchemaProperty.VARIABLE)
                return false;
            if (prop.hasDefault() != SchemaProperty.NEVER &&
                prop.getDefaultText() == null)
                return false;
        }
        return true;
    }
View Full Code Here

Examples of org.apache.xmlbeans.SchemaProperty

                // indentDBG();
                Map childModel = buildContentPropertyModelByQName(children[i], owner);
                // outdentDBG();
                for (Iterator j = childModel.values().iterator(); j.hasNext(); )
                {
                    SchemaProperty iProp = (SchemaProperty)j.next();
                    SchemaPropertyImpl oProp = (SchemaPropertyImpl)model.get(iProp.getName());
                    if (oProp == null)
                    {
                        if (!asSequence)
                            ((SchemaPropertyImpl)iProp).setMinOccurs(BigInteger.ZERO);
                        model.put(iProp.getName(), iProp);
                        continue;
                    }
                    // consistency verified in an earlier step
                    assert(oProp.getType().equals(iProp.getType()));

                    mergeProperties(oProp, iProp, asSequence);
                }
            }

            // finally deal with minOccurs, maxOccurs over whole group
            BigInteger min = part.getMinOccurs();
            BigInteger max = part.getMaxOccurs();

            for (Iterator j = model.values().iterator(); j.hasNext(); )
            {
                SchemaProperty oProp = (SchemaProperty)j.next();
                BigInteger minOccurs = oProp.getMinOccurs();
                BigInteger maxOccurs = oProp.getMaxOccurs();

                minOccurs = minOccurs.multiply(min);
                if (max != null && max.equals(BigInteger.ZERO))
                    maxOccurs = BigInteger.ZERO;
                else if (maxOccurs != null && !maxOccurs.equals(BigInteger.ZERO))
View Full Code Here

Examples of org.apache.xmlbeans.SchemaProperty

    static Map buildElementPropertyModel(SchemaLocalElement epart, SchemaType owner)
    {
        Map result = new HashMap(1);

        SchemaProperty sProp = buildUseProperty(epart, owner);
        result.put(sProp.getName(), sProp);
        return result;
    }
View Full Code Here

Examples of org.apache.xmlbeans.SchemaProperty

                            SchemaGlobalElement xmlbeansElement = sts.findElement(message.getElementQName());
                            SchemaType sType = xmlbeansElement.getType();

                            SchemaProperty[] elementProperties = sType.getElementProperties();
                            for (int i = 0; i < elementProperties.length; i++) {
                                SchemaProperty elementProperty = elementProperties[i];

                                QName partQName = WSDLUtil.getPartQName(op.getName().getLocalPart(),
                                        WSDLConstants.INPUT_PART_QNAME_SUFFIX,
                                        elementProperty.getName().getLocalPart());

                                //this type is based on a primitive type- use the
                                //primitive type name in this case
                                String fullJaveName = elementProperty.getType().getFullJavaName();
                                if (elementProperty.extendsJavaArray()) {
                                    fullJaveName = fullJaveName.concat("[]");
                                }
                                mapper.addTypeMappingName(partQName, fullJaveName);
                                SchemaType primitiveType = elementProperty.getType().getPrimitiveType();


                                if (primitiveType != null) {
                                    mapper.addTypeMappingStatus(partQName, Boolean.TRUE);
                                }
                                if (elementProperty.extendsJavaArray()){
                                    mapper.addTypeMappingStatus(partQName,Constants.ARRAY_TYPE);
                                }
                            }
                        }
                    }
View Full Code Here

Examples of org.apache.xmlbeans.SchemaProperty

                throw new DeploymentException("ConstructorParameterOrder can only be set for complex types, not " + faultTypeQName);
            }
            Map elementMap = new HashMap();
            SchemaProperty[] properties = complexType.getProperties();
            for (int i = 0; i < properties.length; i++) {
                SchemaProperty property = properties[i];
                QName elementName = property.getName();
                SchemaType elementType = property.getType();
                elementMap.put(elementName.getLocalPart(), elementType);
            }
            ArrayList parameterTypes = new ArrayList();
            ConstructorParameterOrder constructorParameterOrder = exceptionMapping.getConstructorParameterOrder();
            for (String elementName: constructorParameterOrder.getElementName()) {
View Full Code Here

Examples of org.apache.xmlbeans.SchemaProperty

    {
        assert(_isComplexContent());
        if (!_isComplexContent())
            throw new IllegalStateException();

        SchemaProperty prop = schemaType().getElementProperty(eltName);
        if (prop == null)
            return "";
        return prop.getDefaultText();
    }
View Full Code Here

Examples of org.apache.xmlbeans.SchemaProperty

    {
        assert(_isComplexType());
        if (!_isComplexType())
            throw new IllegalStateException();

        SchemaProperty prop = schemaType().getAttributeProperty(attrName);
        if (prop == null)
            return "";
        return prop.getDefaultText();
    }
View Full Code Here

Examples of org.apache.xmlbeans.SchemaProperty

    public int get_elementflags(QName eltName)
    {
        if (!_isComplexContent())
            return 0;

        SchemaProperty prop = schemaType().getElementProperty(eltName);
        if (prop == null)
            return 0;
        if (prop.hasDefault() == SchemaProperty.VARIABLE ||
            prop.hasFixed() == SchemaProperty.VARIABLE ||
            prop.hasNillable() == SchemaProperty.VARIABLE)
            return -1;
        return
            (prop.hasDefault() == SchemaProperty.NEVER ? 0 : TypeStore.HASDEFAULT) |
            (prop.hasFixed() == SchemaProperty.NEVER ? 0 : TypeStore.FIXED) |
            (prop.hasNillable() == SchemaProperty.NEVER ? 0 : TypeStore.NILLABLE);
    }
View Full Code Here

Examples of org.apache.xmlbeans.SchemaProperty

     */
    public int get_attributeflags(QName attrName)
    {
        if (!_isComplexType())
            return 0;
        SchemaProperty prop = schemaType().getAttributeProperty(attrName);
        if (prop == null)
            return 0;
        return
            (prop.hasDefault() == SchemaProperty.NEVER ? 0 : TypeStore.HASDEFAULT) |
            (prop.hasFixed() == SchemaProperty.NEVER ? 0 : TypeStore.FIXED);
        // BUGBUG: todo: hook up required?
    }
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.