Examples of convertToLexicalValue()


Examples of com.sun.msv.datatype.xsd.DataTypeWithFacet.convertToLexicalValue()

            } else if (dtf instanceof TotalDigitsFacet) {
                param("totalDigits", Long.toString(((TotalDigitsFacet)dtf).precision));
            } else if (dtf instanceof FractionDigitsFacet) {
                param("fractionDigits", Long.toString(((FractionDigitsFacet)dtf).scale));
            } else if (dtf instanceof RangeFacet) {
                param(dtf.facetName, dtf.convertToLexicalValue(((RangeFacet)dtf).limitValue, null));
                // we don't need to pass SerializationContext because it is only
                // for QName.
            } else if (dtf instanceof WhiteSpaceFacet) {
                ; // do nothing.
            } else
View Full Code Here

Examples of com.sun.msv.datatype.xsd.DataTypeWithFacet.convertToLexicalValue()

            } else if (dtf instanceof TotalDigitsFacet) {
                param("totalDigits", Long.toString(((TotalDigitsFacet)dtf).precision));
            } else if (dtf instanceof FractionDigitsFacet) {
                param("fractionDigits", Long.toString(((FractionDigitsFacet)dtf).scale));
            } else if (dtf instanceof RangeFacet) {
                param(dtf.facetName, dtf.convertToLexicalValue(((RangeFacet)dtf).limitValue, null));
                // we don't need to pass SerializationContext because it is only
                // for QName.
            } else if (dtf instanceof WhiteSpaceFacet) {
                ; // do nothing.
            } else
View Full Code Here

Examples of com.sun.msv.datatype.xsd.XSDatatype.convertToLexicalValue()

 
  public void onValue( ValueExp exp ) {
    String text;
    if( exp.dt instanceof XSDatatype ) {
      XSDatatype xsd = (XSDatatype)exp.dt;
      text = xsd.convertToLexicalValue(exp.value,getContext());
    } else {
      text = exp.value.toString();
      if(!exp.dt.sameValue( exp.value, exp.dt.createValue(text,getContext()) ) )
        throw new Error("unable to produce a value for the datatype:"+exp.name);
    }
View Full Code Here

Examples of com.sun.msv.datatype.xsd.XSDatatype.convertToLexicalValue()

                        values[i],DummyContextProvider.theInstance);
                   
                    try {
                        if(o!=null) {
                            // should be able to convert it back.
                            String s = typeObj.convertToLexicalValue(o,DummyContextProvider.theInstance);
                            // try round trip conversion.
                            Object o2 = typeObj.createValue(s,DummyContextProvider.theInstance);
                            if( o2==null || !o.equals(o2) )
                                roundTripError = true;
                        }
View Full Code Here

Examples of com.sun.msv.datatype.xsd.XSDatatypeImpl.convertToLexicalValue()

      EnumerationFacet e = (EnumerationFacet)dti.getFacetObject( XSDatatype.FACET_ENUMERATION );
      if(e!=null) {
        Object[] items = e.values.toArray();
        for( int i=0; i<10; i++ ) {
          try {
            return dti.convertToLexicalValue(items[random.nextInt(items.length)],context);
          } catch( Exception x ) { ; }
        }
      }
     
      XSDatatype baseType = dti.getConcreteType();
View Full Code Here

Examples of com.sun.msv.datatype.xsd.XSDatatypeImpl.convertToLexicalValue()

        if (exp.dt instanceof XSDatatypeImpl) {
            XSDatatypeImpl base = (XSDatatypeImpl)exp.dt;

            final Vector ns = new Vector();

            String lex = base.convertToLexicalValue(exp.value, new SerializationContext() {
                public String getNamespacePrefix(String namespaceURI) {
                    int cnt = ns.size() / 2;
                    ns.add("xmlns:ns" + cnt);
                    ns.add(namespaceURI);
                    return "ns" + cnt;
View Full Code Here

Examples of com.sun.msv.datatype.xsd.XSDatatypeImpl.convertToLexicalValue()

        if (exp.dt instanceof XSDatatypeImpl) {
            XSDatatypeImpl base = (XSDatatypeImpl)exp.dt;

            final Vector ns = new Vector();

            String lex = base.convertToLexicalValue(exp.value, new SerializationContext() {
                public String getNamespacePrefix(String namespaceURI) {
                    int cnt = ns.size() / 2;
                    ns.add("xmlns:ns" + cnt);
                    ns.add(namespaceURI);
                    return "ns" + cnt;
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.