Package org.apache.xmlbeans

Examples of org.apache.xmlbeans.SchemaProperty


      pw.print( "\t{\n" );
      pw.print( "\t\t// Make calls to register all properties that participate in property change notifications.\n" );
      pw.print( "\t\t// TODO: if any resource properties should not emit property change notifications, remove their registrations from below.\n" );
      for ( Iterator iter = propSchemaMap.keySet(  ).iterator(  ); iter.hasNext(  ); )
      {
         SchemaProperty schemaProp = (SchemaProperty) propSchemaMap.get( iter.next(  ) );
         pw.print( "\t\tregisterPropertyForChangeNotification( " + INTERFACE_NAME__PROPERTY_QNAMES + "."
                   + CodeGenUtils.toJavaConstantName( schemaProp ) + " );\n" );
      }

      pw.print( "\t}\n\n" );
View Full Code Here


      pw.print( " qname )\n" );
      pw.print( "\t{\n" );
      Set nonOptionalPropQNames = new HashSet(  );
      for ( Iterator iter = propSchemaMap.keySet(  ).iterator(  ); iter.hasNext(  ); )
      {
         SchemaProperty schemaProp = (SchemaProperty) propSchemaMap.get( iter.next(  ) );
         if ( schemaProp.getMinOccurs(  ).compareTo( BigInteger.ZERO ) != 0 )
         {
            nonOptionalPropQNames.add( schemaProp.getName(  ) );
         }
      }

      generatePropertyIfElse( pw, propSchemaMap, "remove property", nonOptionalPropQNames );
      pw.print( "\t\treturn true;\n" );
View Full Code Here

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

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

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

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

    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

     */
    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

     * same name, or at the very first slot if it is the first elt
     * with that name).
     */
    public final QNameSet get_element_ending_delimiters(QName eltname)
    {
        SchemaProperty prop = schemaType().getElementProperty(eltname);
        if (prop == null)
            return null;
        return prop.getJavaSetterDelimiter();
    }
View Full Code Here

        SchemaProperty[] eltProperties = state._type.getElementProperties();

        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()))
            {
                message = "Expected element " + QNameHelper.pretty(sProp.getName()) + " instead of " + QNameHelper.pretty(qName) + " here";
                break;
            }
        }
        return message;
    }
View Full Code Here

        String message = null;

        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()))
            {
                message = "Expected element " + QNameHelper.pretty(sProp.getName()) +
                          " at the end of the content";
                break;
            }
        }
        return message;
View Full Code Here

                // 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

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.