Package org.apache.xmlbeans

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


        if (_propertyModelByAttributeName != null)
            results.addAll(_propertyModelByAttributeName.values());

        for (Iterator it = results.iterator() ; it.hasNext() ; )
        {
            SchemaProperty prop = (SchemaProperty)it.next();
            SchemaProperty baseProp = prop.isAttribute() ?
                baseType.getAttributeProperty(prop.getName()) :
                baseType.getElementProperty(prop.getName());


            // Remove the derived property from the results if it is
            // A) present in the base type and
            // B) all the details are the same (cardinality, nillability)

            if (baseProp != null)
            {
                if ( eq(prop.getMinOccurs(), baseProp.getMinOccurs()) &&
                     eq(prop.getMaxOccurs(), baseProp.getMaxOccurs()) &&
                     prop.hasNillable() == baseProp.hasNillable())
                {
                    it.remove();
                }

            }
View Full Code Here

        {
            _validSubstitutions = new LinkedHashSet();
            Collection eltProps = _propertyModelByElementName.values();
            for (Iterator it = eltProps.iterator() ; it.hasNext() ; )
            {
                SchemaProperty prop = (SchemaProperty)it.next();
                QName[] names = prop.acceptedNames();
                for (int i = 0 ; i < names.length ; i++)
                {
                    if (! _propertyModelByElementName.containsKey(names[i]))
                        _validSubstitutions.add(names[i]);
                }
View Full Code Here

    {
        if (isSimpleType() || !containsElements() || isNoType())
            return BuiltinSchemaTypeSystem.ST_NO_TYPE;

        SchemaType type;
        SchemaProperty prop = (SchemaProperty)_propertyModelByElementName.get(eltName);
        if (prop != null)
        {
            type = prop.getType();
        }
        else
        {
            if (!_typedWildcardElements.contains(eltName) || wildcardTypeLoader == null)
                return BuiltinSchemaTypeSystem.ST_NO_TYPE;
View Full Code Here

            return BuiltinSchemaTypeSystem.ST_NO_TYPE;

        if (isURType())
            return BuiltinSchemaTypeSystem.ST_ANY_SIMPLE;

        SchemaProperty prop = (SchemaProperty)_propertyModelByAttributeName.get(attrName);
        if (prop != null)
            return prop.getType();

        if (!_typedWildcardAttributes.contains(attrName) || wildcardTypeLoader == null)
            return BuiltinSchemaTypeSystem.ST_NO_TYPE;

        SchemaGlobalAttribute attr = wildcardTypeLoader.findAttribute(attrName);
View Full Code Here

    }

    public XmlObject createElementType(QName eltName, QName xsiType, SchemaTypeLoader wildcardTypeLoader)
    {
        SchemaType type = null;
        SchemaProperty prop = null;
        if (isSimpleType() || !containsElements() || isNoType())
        {
            type = BuiltinSchemaTypeSystem.ST_NO_TYPE;
        }
        else
        {
            prop = (SchemaProperty)_propertyModelByElementName.get(eltName);
            if (prop != null)
            {
                type = prop.getType();
            }
            else if (!_typedWildcardElements.contains(eltName) &&
                     !_validSubstitutions.contains(eltName))
            {
                type = BuiltinSchemaTypeSystem.ST_NO_TYPE;
View Full Code Here

    }

    public XmlObject createAttributeType(QName attrName, SchemaTypeLoader wildcardTypeLoader)
    {
        SchemaTypeImpl type = null;
        SchemaProperty prop = null;
        if (isSimpleType() || isNoType())
        {
            type = BuiltinSchemaTypeSystem.ST_NO_TYPE;
        }
        else if (isURType())
        {
            type = BuiltinSchemaTypeSystem.ST_ANY_SIMPLE;
        }
        else
        {
            prop = (SchemaProperty)_propertyModelByAttributeName.get(attrName);
            if (prop != null)
            {
                type = (SchemaTypeImpl)prop.getType();
            }
            else if (!_typedWildcardAttributes.contains(attrName))
            {
                type = BuiltinSchemaTypeSystem.ST_NO_TYPE;
            }
View Full Code Here

    }

    SchemaProperty[] attrProps = stype.getAttributeProperties();
    for( int i = 0; i < attrProps.length; i++ )
    {
      SchemaProperty attr = attrProps[i];
      if( attr.getMinOccurs().intValue() == 0 && ignoreOptional )
        continue;

      if( attr.getName().equals( new QName( "http://www.w3.org/2005/05/xmlmime", "contentType" ) ) )
      {
        xmlc.insertAttributeWithValue( attr.getName(), "application/?" );
        continue;
      }

      if( _soapEnc )
      {
        if( SKIPPED_SOAP_ATTRS.contains( attr.getName() ) )
          continue;
        if( ENC_ARRAYTYPE.equals( attr.getName() ) )
        {
          SOAPArrayType arrayType = ( ( SchemaWSDLArrayType )stype.getAttributeModel().getAttribute(
              attr.getName() ) ).getWSDLArrayType();
          if( arrayType != null )
            xmlc.insertAttributeWithValue( attr.getName(),
                formatQName( xmlc, arrayType.getQName() ) + arrayType.soap11DimensionString() );
          continue;
        }
      }

      String value = null;
      if( multiValues != null )
      {
        String[] values = multiValues.get( attr.getName() );
        if( values != null )
          value = StringUtils.join( values, "," );
      }
      if( value == null )
        value = attr.getDefaultText();
      if( value == null )
        value = sampleDataForSimpleType( attr.getType() );

      xmlc.insertAttributeWithValue( attr.getName(), value );
    }
  }
View Full Code Here

      {
        SchemaType parentSchemaType = getParent().getSchemaType();
        if( parentSchemaType != null )
        {
          positionCursor( cursor );
          SchemaProperty attributeProperty = parentSchemaType.getAttributeProperty( cursor.getName() );
          if( attributeProperty != null )
          {
            schemaType = attributeProperty.getType();
            documentation = SchemaUtils.getDocumentation( schemaType );

            // SchemaAnnotation annotation = schemaType.getAnnotation();
            // if( annotation != null )
            // {
View Full Code Here

        ArrayList optionalNames = new ArrayList();

        for (int ii = 0; ii < eltProperties.length; ii++)
        {
            //Get the element from the schema
            SchemaProperty sProp = eltProperties[ii];

            // test if the element is valid
            if (state.test(sProp.getName()))
            {
                if (0 == BigInteger.ZERO.compareTo(sProp.getMinOccurs()))
                    optionalNames.add(sProp.getName());
                else
                    expectedNames.add(sProp.getName());
            }
        }

        List names = (expectedNames.size() > 0 ? expectedNames : optionalNames);
View Full Code Here

TOP

Related Classes of org.apache.xmlbeans.SchemaProperty

Copyright © 2018 www.massapicom. 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.