Examples of XSDatatypeImpl


Examples of com.sun.msv.datatype.xsd.XSDatatypeImpl

   
    // getting desparate...
   
    if( dt instanceof XSDatatypeImpl ) {
      // if it contains EnumerationFacet, we can try that.
      XSDatatypeImpl dti = (XSDatatypeImpl)dt;
      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();
     
      if( baseType instanceof ListType )
        return generateList(dti,context);
      if( baseType instanceof UnionType )
        return generateUnion((UnionType)baseType,context);
View Full Code Here

Examples of com.sun.msv.datatype.xsd.XSDatatypeImpl

            exp.visit(this);
    }
   
    public void onValue( ValueExp exp ) {
        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;
                }
            });

            if (base != TokenType.theInstance) {
                // if the type is token, we don't need @type.
                ns.add("type");
                ns.add(base.getName());
            }

            writer.start("value", (String[])ns.toArray(new String[0]));
            writer.characters(lex);
            writer.end("value");
View Full Code Here

Examples of com.sun.msv.datatype.xsd.XSDatatypeImpl

       
    public void onData(DataExp exp) {
        Datatype dt = exp.dt;

        if (dt instanceof XSDatatypeImpl) {
            XSDatatypeImpl dti = (XSDatatypeImpl)dt;

            if (isPredefinedType(dt)) {
                // it's a pre-defined types.
                writer.element("data", new String[] { "type", dti.getName()});
            } else {
                serializeDataType(dti);
            }
            return;
        }
View Full Code Here

Examples of com.sun.msv.datatype.xsd.XSDatatypeImpl

            for( int i=0; i<lst.size(); i++ )
            {
                Element item = (Element)lst.get(i);
               
                // perform test as a single type
                XSDatatypeImpl t = (XSDatatypeImpl)DatatypeFactory.getTypeByName(item.getAttributeValue("for"));
                if(t==null)
                {
                    System.out.println(item.getAttributeValue("for") + " is undefined type");
                }
                testDataType(
View Full Code Here

Examples of com.sun.msv.datatype.xsd.XSDatatypeImpl

            exp.visit(this);
    }
   
    public void onValue( ValueExp exp ) {
        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;
                }
            });

            if (base != TokenType.theInstance) {
                // if the type is token, we don't need @type.
                ns.add("type");
                ns.add(base.getName());
            }

            writer.start("value", (String[])ns.toArray(new String[0]));
            writer.characters(lex);
            writer.end("value");
View Full Code Here

Examples of com.sun.msv.datatype.xsd.XSDatatypeImpl

       
    public void onData(DataExp exp) {
        Datatype dt = exp.dt;

        if (dt instanceof XSDatatypeImpl) {
            XSDatatypeImpl dti = (XSDatatypeImpl)dt;

            if (isPredefinedType(dt)) {
                // it's a pre-defined types.
                writer.element("data", new String[] { "type", dti.getName()});
            } else {
                serializeDataType(dti);
            }
            return;
        }
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.