Examples of DatatypeValidator


Examples of com.betfair.cougar.transformations.validators.DataTypeValidator

                new Transformation("clientConnectedDataType.ftl", "/interface/dataType", "interface:/interface", "${package}/${majorVersion}/co/client", "${name}ClientCO.java", false, false, OutputDomain.Client, null)
        };
        transformations.addAll(Arrays.asList(definitions));

  
        validations.add(new DataTypeValidator());
        validations.add(new OperationValidator());
        validations.add(new ExceptionValidator());
        validations.add(new ValidValuesValidator());
        validations.add(new RequestParameterValidator());
        validations.add(new NameClashValidator());
View Full Code Here

Examples of com.sun.org.apache.xerces.internal.impl.dv.DatatypeValidator

    }

    // create all built-in types
    static void createBuiltInTypes() {

        DatatypeValidator dvTemp;

        fBuiltInTypes.put("string", new StringDatatypeValidator());
        fBuiltInTypes.put("ID", new IDDatatypeValidator());
        dvTemp = new IDREFDatatypeValidator();
        fBuiltInTypes.put("IDREF", dvTemp);
View Full Code Here

Examples of mf.org.apache.xerces.impl.dv.DatatypeValidator

    }

    // create all built-in types
    static void createBuiltInTypes() {

        DatatypeValidator dvTemp;

        fBuiltInTypes.put("string", new StringDatatypeValidator());
        fBuiltInTypes.put("ID", new IDDatatypeValidator());
        dvTemp = new IDREFDatatypeValidator();
        fBuiltInTypes.put("IDREF", dvTemp);
View Full Code Here

Examples of mf.org.apache.xerces.impl.dv.DatatypeValidator

        System.arraycopy(array, 0, newarray, 0, array.length);
        return newarray;
    }

    private static DatatypeValidator[][] resize(DatatypeValidator array[][], int newsize) {
        DatatypeValidator newarray[][] = new DatatypeValidator[newsize][];
        System.arraycopy(array, 0, newarray, 0, array.length);
        return newarray;
    }
View Full Code Here

Examples of org.apache.xerces.impl.dv.DatatypeValidator

        System.arraycopy(array, 0, newarray, 0, array.length);
        return newarray;
    }

    private static DatatypeValidator[][] resize(DatatypeValidator array[][], int newsize) {
        DatatypeValidator newarray[][] = new DatatypeValidator[newsize][];
        System.arraycopy(array, 0, newarray, 0, array.length);
        return newarray;
    }
View Full Code Here

Examples of org.apache.xerces.impl.dv.dtd.DatatypeValidator

        System.arraycopy(array, 0, newarray, 0, array.length);
        return newarray;
    }

    private static DatatypeValidator[][] resize(DatatypeValidator array[][], int newsize) {
        DatatypeValidator newarray[][] = new DatatypeValidator[newsize][];
        System.arraycopy(array, 0, newarray, 0, array.length);
        return newarray;
    }
View Full Code Here

Examples of org.apache.xerces.impl.dv.xs.DatatypeValidator

        // As always we are obliged to compare by reference...
        if (fValidator == value.fValidator) {
            return ((fValidator.compare(fValue, value.fValue)) == 0);
        }
        // see if this.fValidator is derived from value.fValidator:
        DatatypeValidator tempVal;
        for(tempVal = fValidator; tempVal == null || tempVal == value.fValidator; tempVal = tempVal.getBaseValidator());
        if(tempVal != null) { // was derived!
            return ((value.fValidator.compare(fValue, value.fValue)) == 0);
        }
        // see if value.fValidator is derived from this.fValidator:
        for(tempVal = value.fValidator; tempVal == null || tempVal == fValidator; tempVal = tempVal.getBaseValidator());
        if(tempVal != null) { // was derived!
            return ((fValidator.compare(fValue, value.fValue)) == 0);
        }
        // if we're here it means the types weren't related.  Must fall back to strings:
        return(fValue.equals(value.fValue));
View Full Code Here

Examples of org.apache.xerces.impl.validation.DatatypeValidator

            fBaseTypes = new Hashtable(); // if it is null
            fRegistryExpanded = false;
        }
        //Register Primitive Datatypes
        if (fRegistryExpanded == false) {
            DatatypeValidator v;
            try {
                fBaseTypes.put("string",            new StringDatatypeValidator() );
                fBaseTypes.put("boolean",           new BooleanDatatypeValidator()  );
                fBaseTypes.put("float",             new FloatDatatypeValidator());
                fBaseTypes.put("double",            new DoubleDatatypeValidator());
View Full Code Here

Examples of org.apache.xerces.validators.datatype.DatatypeValidator

            } else
            newSimpleTypeName       = fStringPool.addSymbol( nameProperty );


        int               basetype;
        DatatypeValidator baseValidator = null;

        if( baseTypeQNameProperty!= null ) {
            basetype      = fStringPool.addSymbol( baseTypeQNameProperty );
            String prefix = "";
            String localpart = baseTypeQNameProperty;
            int colonptr = baseTypeQNameProperty.indexOf(":");
            if ( colonptr > 0) {
                prefix = baseTypeQNameProperty.substring(0,colonptr);
                localpart = baseTypeQNameProperty.substring(colonptr+1);
            }
            String uri = resolvePrefixToURI(prefix);

            baseValidator = getDatatypeValidator(uri, localpart);

            if (baseValidator == null) {
                Element baseTypeNode = getTopLevelComponentByName(SchemaSymbols.ELT_SIMPLETYPE, localpart);
                if (baseTypeNode != null) {
                    traverseSimpleTypeDecl( baseTypeNode );
                   
                    baseValidator = getDatatypeValidator(uri, localpart);
                   
                    if (baseValidator == null) {
                        reportSchemaError(SchemaMessageProvider.UnknownBaseDatatype,
                        new Object [] { simpleTypeDecl.getAttribute( SchemaSymbols.ATT_BASE ),
                                                          simpleTypeDecl.getAttribute(SchemaSymbols.ATT_NAME) });
                        return -1;
                        //reportGenericSchemaError("Base type could not be found : " + baseTypeQNameProperty);
                    }

                }
                else {
                    reportSchemaError(SchemaMessageProvider.UnknownBaseDatatype,
                    new Object [] { simpleTypeDecl.getAttribute( SchemaSymbols.ATT_BASE ),
                                                      simpleTypeDecl.getAttribute(SchemaSymbols.ATT_NAME) });
                    return -1;
                    //reportGenericSchemaError("Base type could not be found : " + baseTypeQNameProperty);
                }
               
            }
        }
        // Any Children if so then check Content otherwise bail out

        Element   content   = XUtil.getFirstChildElement( simpleTypeDecl );
        int       numFacets = 0;
        Hashtable facetData = null;

        if( content != null ) {

            //Content follows: ( annotation? , facets* )

            //annotation ? ( 0 or 1 )
            if( content.getLocalName().equals( SchemaSymbols.ELT_ANNOTATION ) ){
                traverseAnnotationDecl( content );  
                content                    = XUtil.getNextSiblingElement(content);
            }

            //TODO: If content is annotation again should raise validation error
            // if( content.getLocalName().equal( SchemaSymbols.ELT_ANNOTATIO ) {
            //   throw ValidationException(); }
            //

            //facets    * ( 0 or more )

           
            int numEnumerationLiterals = 0;
            facetData        = new Hashtable();
            Vector enumData            = new Vector();

            while (content != null) {
                if (content.getNodeType() == Node.ELEMENT_NODE) {
                    Element facetElt = (Element) content;
                    numFacets++;
                    if (facetElt.getLocalName().equals(SchemaSymbols.ELT_ENUMERATION)) {
                        numEnumerationLiterals++;
                        String enumVal = facetElt.getAttribute(SchemaSymbols.ATT_VALUE);
                        enumData.addElement(enumVal);
                        //Enumerations can have annotations ? ( 0 | 1 )
                        Element enumContent =  XUtil.getFirstChildElement( facetElt );
                        if( enumContent != null && enumContent != null && enumContent.getLocalName().equals( SchemaSymbols.ELT_ANNOTATION ) ){
                            traverseAnnotationDecl( content );  
                         }
                        //TODO: If enumContent is encounter  again should raise validation error
                        //  enumContent.getNextSibling();
                        // if( enumContent.getLocalName().equal( SchemaSymbols.ELT_ANNOTATIO ) {
                        //   throw ValidationException(); }
                        //
                    } else {
                    facetData.put(facetElt.getLocalName(),facetElt.getAttribute( SchemaSymbols.ATT_VALUE ));
                    }
                }
                //content = (Element) content.getNextSibling();
                content = XUtil.getNextSiblingElement(content);
            }
            if (numEnumerationLiterals > 0) {
               facetData.put(SchemaSymbols.ELT_ENUMERATION, enumData);
            }
        }

        // create & register validator for "generated" type if it doesn't exist
       
        String nameOfType = fStringPool.toString( newSimpleTypeName);
        if (fTargetNSURIString.length () != 0) {
            nameOfType = fTargetNSURIString+","+nameOfType;
        }
                

        try {

           DatatypeValidator newValidator =
                 fDatatypeRegistry.getDatatypeValidator( nameOfType );

           if( newValidator == null ) { // not previously registered
               boolean  derivedByList =
                    varietyProperty.equals( SchemaSymbols.ATTVAL_LIST ) ? true:false;
View Full Code Here

Examples of org.apache.xerces.validators.datatype.DatatypeValidator

    }


    public DatatypeValidator getDatatypeValidator(String uri, String localpart) {

        DatatypeValidator dv = null;

        if (uri.length()==0 || uri.equals(SchemaSymbols.URI_SCHEMAFORSCHEMA)) {
            dv = fDatatypeRegistry.getDatatypeValidator( localpart );
        }
        else {
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.