Package org.apache.xerces.validators.datatype

Examples of org.apache.xerces.validators.datatype.DatatypeValidator.validate()


            if (attType == XMLAttributeDecl.TYPE_SIMPLE && attDefaultValue != -1) {
                try {
                    if (dv != null)
                        //REVISIT
                        dv.validate(fStringPool.toString(attDefaultValue), null);
                    else
                        reportSchemaError(SchemaMessageProvider.NoValidatorFor,
                                          new Object [] { datatype });
                } catch (InvalidDatatypeValueException idve) {
                    reportSchemaError(SchemaMessageProvider.IncorrectDefaultType,
View Full Code Here


                                                      String  value       = unTrimValue.trim();
                                                      if (attDecl.type == XMLAttributeDecl.TYPE_ID ) {
                                                         this.fStoreIDRef.setDatatypeObject( fValID.validate( value, null ) );
                                                      }
                                                      if (attDecl.type == XMLAttributeDecl.TYPE_IDREF ) {
                                                         attDV.validate(value, this.fStoreIDRef );
                                                      } else
                                                         attDV.validate(unTrimValue, null );
                                                   } catch (InvalidDatatypeValueException idve) {
                                                      fErrorReporter.reportError(fErrorReporter.getLocator(),
                                                                                 SchemaMessageProvider.SCHEMA_DOMAIN,
View Full Code Here

                                                         this.fStoreIDRef.setDatatypeObject( fValID.validate( value, null ) );
                                                      }
                                                      if (attDecl.type == XMLAttributeDecl.TYPE_IDREF ) {
                                                         attDV.validate(value, this.fStoreIDRef );
                                                      } else
                                                         attDV.validate(unTrimValue, null );
                                                   } catch (InvalidDatatypeValueException idve) {
                                                      fErrorReporter.reportError(fErrorReporter.getLocator(),
                                                                                 SchemaMessageProvider.SCHEMA_DOMAIN,
                                                                                 SchemaMessageProvider.DatatypeError,
                                                                                 SchemaMessageProvider.MSG_NONE,
View Full Code Here

               if (dv == null) {
                  System.out.println("Internal Error: this element have a simpletype "+
                                     "but no datatypevalidator was found, element "+fTempElementDecl.name
                                     +",locapart: "+fStringPool.toString(fTempElementDecl.name.localpart));
               } else {
                  dv.validate(fDatatypeBuffer.toString(), null);
               }

            } catch (InvalidDatatypeValueException idve) {
               fErrorReporter.reportError(fErrorReporter.getLocator(),
                                          SchemaMessageProvider.SCHEMA_DOMAIN,
View Full Code Here

            if (attType == XMLAttributeDecl.TYPE_SIMPLE && attDefaultValue != -1) {
                try {
                    if (dv != null)
                        //REVISIT
                        dv.validate(fStringPool.toString(attDefaultValue), null);
                    else
                        reportSchemaError(SchemaMessageProvider.NoValidatorFor,
                                          new Object [] { datatype });
                } catch (InvalidDatatypeValueException idve) {
                    reportSchemaError(SchemaMessageProvider.IncorrectDefaultType,
View Full Code Here

        if (attType == XMLAttributeDecl.TYPE_SIMPLE && attValueConstraint != -1) {
            try {
                if (dv != null) {
                    if(defaultStr.length() > 0) {
                    //REVISIT
                        dv.validate(defaultStr, null);
                    }
                    else {
                        dv.validate(fixedStr, null);
                    }
                }
View Full Code Here

                    if(defaultStr.length() > 0) {
                    //REVISIT
                        dv.validate(defaultStr, null);
                    }
                    else {
                        dv.validate(fixedStr, null);
                    }
                }
                else if (!referredTo)
                    reportSchemaError(SchemaMessageProvider.NoValidatorFor,
                            new Object [] { datatypeStr });
View Full Code Here

                                                } else {
                                                   try {
                                                      String  unTrimValue = fStringPool.toString(attrList.getAttValue(index));
                                                      String  value       = unTrimValue.trim();
                                                      if (attDV instanceof IDDatatypeValidator) {
                                                         this.fStoreIDRef.setDatatypeObject( attDV.validate( value, null ) );
                                                      }
                                                      if (attDV instanceof IDREFDatatypeValidator) {
                                                         attDV.validate(value, null );
                                                      }
                                                       else {
View Full Code Here

                                                      String  value       = unTrimValue.trim();
                                                      if (attDV instanceof IDDatatypeValidator) {
                                                         this.fStoreIDRef.setDatatypeObject( attDV.validate( value, null ) );
                                                      }
                                                      if (attDV instanceof IDREFDatatypeValidator) {
                                                         attDV.validate(value, null );
                                                      }
                                                       else {
                                                              fWhiteSpace = attDV.getWSFacet();
                                                              if (fWhiteSpace == DatatypeValidator.REPLACE) { //CDATA
                                                                  attDV.validate(unTrimValue, null );
View Full Code Here

                                                         attDV.validate(value, null );
                                                      }
                                                       else {
                                                              fWhiteSpace = attDV.getWSFacet();
                                                              if (fWhiteSpace == DatatypeValidator.REPLACE) { //CDATA
                                                                  attDV.validate(unTrimValue, null );
                                                              }
                                                              else { // normalize
                                                                  int normalizedValue = fStringPool.addString(value);
                                                                  attrList.setAttValue(index,normalizedValue );
                                                                  if (attDV instanceof NOTATIONDatatypeValidator
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.