Package org.apache.xmlbeans

Examples of org.apache.xmlbeans.XmlObject.schemaType()


            XmlObject siblingXmlObject = xCursor.getObject();
            QName siblingXmlObjectQname = getName(siblingXmlObject);

            // TODO: should this be tested against the original bean
            //if it contains the ElementProperty, then it is not an Any
            if ( siblingXmlObject.schemaType().getElementProperty( siblingXmlObjectQname ) != null )
            {
                continue;
            }

            //check to see if we have a xmlObjectList to add to for this QName
View Full Code Here


    protected static XmlObject[] convert(XmlObject[] xmlObjects, NamespaceElementConverter converter, SchemaType type) throws DeploymentException {
        //bizarre ArrayStoreException if xmlObjects is loaded by the wrong classloader
        XmlObject[] converted = new XmlObject[xmlObjects.length];
        for (int i = 0; i < xmlObjects.length; i++) {
            XmlObject xmlObject = xmlObjects[i].copy();
            if (xmlObject.schemaType() != type) {
                converter.convertElement(xmlObject);
                converted[i] = xmlObject.changeType(type);
            } else {
                converted[i] = xmlObject;
            }
View Full Code Here

        if (errors.size() != 0) {
            throw new XmlException(errors.toArray().toString());
        }

        if (DirDirectoryConfigurationDocument.type.equals(config.schemaType())) {
            validateDD(config);
            return (DirDirectoryConfigurationDocument) config;
        }

        // If we got here, we will fail due to bad XML. We are doing this get an
View Full Code Here

                convertToGeronimoSubSchemas(cursor);
                cursor.pop();
                XmlObject temp = cursor.getObject();

                XmlObject result = temp.changeType(desiredType);
                if (result == null || result.schemaType() != desiredType) {
                    result = temp.copy().changeType(desiredType);
                }
                XmlBeansUtil.validateDD(result);
                return result;
            } else {
View Full Code Here

        try {
            if (findNestedElement(cursor, desiredElement)) {
                XmlObject child = cursor.getObject();
                //The copy seems to be needed to make the type change work for some documents!
                XmlObject result = child.copy().changeType(type);
                assert result.schemaType() == type;
                return result;
            }
        } finally {
            cursor.dispose();
        }
View Full Code Here

         XmlObject siblingXmlObject      = xmlCursor.getObject(  );
         QName     siblingXmlObjectQname = getXmlObjectQname( siblingXmlObject );

         //todo should this be tested against the original bean
         //if it contains the ElementProperty, then it is not an Any
         if ( siblingXmlObject.schemaType(  ).getElementProperty( siblingXmlObjectQname ) != null )
         {
            continue;
         }

         //check to see if we have a xmlObjectList to add to for this QName
View Full Code Here

   private void validateAllNonOptionalPropertiesAreInitialized(  )
   throws Exception
   {
      XmlObject        propsXBean              = getPropertiesXmlBean(  );
      SchemaProperty[] elemProps               = propsXBean.schemaType(  ).getElementProperties(  );
      List             unsetRequiredPropQNames = new ArrayList(  );
      for ( int i = 0; i < elemProps.length; i++ )
      {
         QName propQName = elemProps[i].getName(  );
         long  minOccurs = XmlBeansUtils.getMinOccurs( propsXBean.schemaType(  ),
View Full Code Here

      SchemaProperty[] elemProps               = propsXBean.schemaType(  ).getElementProperties(  );
      List             unsetRequiredPropQNames = new ArrayList(  );
      for ( int i = 0; i < elemProps.length; i++ )
      {
         QName propQName = elemProps[i].getName(  );
         long  minOccurs = XmlBeansUtils.getMinOccurs( propsXBean.schemaType(  ),
                                                       propQName );
         if ( minOccurs > 0 )
         {
            Method getter = XmlBeansUtils.getGetter( propsXBean, propQName );
            if ( getter.invoke( propsXBean,
View Full Code Here

                convertToGeronimoSubSchemas(cursor);
                cursor.pop();
                XmlObject temp = cursor.getObject();

                XmlObject result = temp.changeType(desiredType);
                if (result == null || result.schemaType() != desiredType) {
                    result = temp.copy().changeType(desiredType);
                }
                XmlBeansUtil.validateDD(result);
                return result;
            } else {
View Full Code Here

        try {
            if (findNestedElement(cursor, desiredElement)) {
                XmlObject child = cursor.getObject();
                //The copy seems to be needed to make the type change work for some documents!
                XmlObject result = child.copy().changeType(type);
                assert result.schemaType() == type;
                return result;
            }
        } finally {
            cursor.dispose();
        }
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.