TypeIncubator incubator = new TypeIncubator(baseType); ValidationContext context = null;
DatatypeBuilderImpl( XSDatatype baseType ) { incubator = new TypeIncubator(baseType); }
DatatypeBuilderImpl( XSDatatype baseType ) { incubator = new TypeIncubator(baseType); }
DatatypeBuilderImpl( XSDatatype baseType ) { incubator = new TypeIncubator(baseType); }
DatatypeBuilderImpl( XSDatatype baseType ) { incubator = new TypeIncubator(baseType); }
DatatypeBuilderImpl( XSDatatype baseType ) { incubator = new TypeIncubator(baseType); }
public XSDatatype render( XSDatatypeExp.RenderingContext context ) throws DatatypeException { TypeIncubator ti = new TypeIncubator( baseType.getType(context) ); Iterator itr = facets.iterator(); for( int i=0; i<facetSize; i++ ) { Facet f = (Facet)itr.next(); ti.addFacet( f.name, f.value, f.fixed, f.context ); } return ti.derive(nsUri,localName); } });
public XSDatatype render( XSDatatypeExp.RenderingContext context ) throws DatatypeException { TypeIncubator ti = new TypeIncubator( baseType.getType(context) ); Iterator<Facet> itr = facets.iterator(); for( int i=0; i<facetSize; i++ ) { Facet f = itr.next(); ti.addFacet( f.name, f.value, f.fixed, f.context ); } return ti.derive(nsUri,localName); } });
public XSDatatype render( XSDatatypeExp.RenderingContext context ) throws DatatypeException { TypeIncubator ti = new TypeIncubator( baseType.getType(context) ); Iterator itr = facets.iterator(); for( int i=0; i<facetSize; i++ ) { Facet f = (Facet)itr.next(); ti.addFacet( f.name, f.value, f.fixed, f.context ); } return ti.derive(nsUri,localName); } });
public XSDatatype render( XSDatatypeExp.RenderingContext context ) throws DatatypeException { TypeIncubator ti = new TypeIncubator( baseType.getType(context) ); Iterator itr = facets.iterator(); for( int i=0; i<facetSize; i++ ) { Facet f = (Facet)itr.next(); ti.addFacet( f.name, f.value, f.fixed, f.context ); } return ti.derive(nsUri,localName); } });
public void addParameter( String name, String value, ValidationContext context ) throws DatatypeException { if( name.equals(XSDatatype.FACET_ENUMERATION) ) // the enumeration facet is not allowed for RELAX NG. throw new DatatypeException( XSDatatypeImpl.localize(XSDatatypeImpl.ERR_NOT_APPLICABLE_FACET, name) ); incubator.addFacet( name, value, false, context ); if( name.equals(XSDatatype.FACET_PATTERN) ) // if the pattern facet is specified, we have to // derive a new type so that multiple pattern facets can // work as ANDing. incubator = new TypeIncubator(incubator.derive(null,null)); }
public void addParameter( String name, String value, ValidationContext context ) throws DatatypeException { if( name.equals(XSDatatype.FACET_ENUMERATION) ) // the enumeration facet is not allowed for RELAX NG. throw new DatatypeException( XSDatatypeImpl.localize(XSDatatypeImpl.ERR_NOT_APPLICABLE_FACET, name) ); incubator.addFacet( name, value, false, context ); if( name.equals(XSDatatype.FACET_PATTERN) ) // if the pattern facet is specified, we have to // derive a new type so that multiple pattern facets can // work as ANDing. incubator = new TypeIncubator(incubator.derive(null,null)); }
public void addParameter( String name, String value, ValidationContext context ) throws DatatypeException { if( name.equals(XSDatatype.FACET_ENUMERATION) ) // the enumeration facet is not allowed for RELAX NG. throw new DatatypeException( XSDatatypeImpl.localize(XSDatatypeImpl.ERR_NOT_APPLICABLE_FACET, name) ); incubator.addFacet( name, value, false, context ); if( name.equals(XSDatatype.FACET_PATTERN) ) // if the pattern facet is specified, we have to // derive a new type so that multiple pattern facets can // work as ANDing. incubator = new TypeIncubator(incubator.derive(null,null)); }
public void addParameter( String name, String value, ValidationContext context ) throws DatatypeException { if( name.equals(XSDatatype.FACET_ENUMERATION) ) // the enumeration facet is not allowed for RELAX NG. throw new DatatypeException( XSDatatypeImpl.localize(XSDatatypeImpl.ERR_NOT_APPLICABLE_FACET, name) ); incubator.addFacet( name, value, false, context ); if( name.equals(XSDatatype.FACET_PATTERN) ) // if the pattern facet is specified, we have to // derive a new type so that multiple pattern facets can // work as ANDing. incubator = new TypeIncubator(incubator.derive(null,null)); }
public void addParameter( String name, String value, ValidationContext context ) throws DatatypeException { if( name.equals(XSDatatype.FACET_ENUMERATION) ) // the enumeration facet is not allowed for RELAX NG. throw new DatatypeException( XSDatatypeImpl.localize(XSDatatypeImpl.ERR_NOT_APPLICABLE_FACET, name) ); incubator.addFacet( name, value, false, context ); if( name.equals(XSDatatype.FACET_PATTERN) ) // if the pattern facet is specified, we have to // derive a new type so that multiple pattern facets can // work as ANDing. incubator = new TypeIncubator(incubator.derive(null,null)); }
private static XSDatatypeImpl createBuiltinList( String name, XSDatatypeImpl item ) throws DatatypeException { TypeIncubator ti = new TypeIncubator(new ListType(null,null,item)); ti.addFacet("minLength","1",false,null); // wrap it by a proxy object so that // these objects will work as singleton. return new Proxy(XSDatatype.XMLSCHEMA_NSURI,name,ti.derive(null,null)) { private Object readResolve() { try { return DatatypeFactory.getTypeByName(getName()); } catch( DatatypeException e ) { e.printStackTrace(); throw new InternalError(e.getMessage()); } } }; }
private static XSDatatypeImpl createBuiltinList( String name, XSDatatypeImpl item ) throws DatatypeException { TypeIncubator ti = new TypeIncubator(new ListType(null,null,item)); ti.addFacet("minLength","1",false,null); // wrap it by a proxy object so that // these objects will work as singleton. return new Proxy(XSDatatype.XMLSCHEMA_NSURI,name,ti.derive(null,null)) { private Object readResolve() { try { return DatatypeFactory.getTypeByName(getName()); } catch( DatatypeException e ) { e.printStackTrace(); throw new InternalError(e.getMessage()); } } }; }
private static XSDatatypeImpl createBuiltinList( String name, XSDatatypeImpl item ) throws DatatypeException { TypeIncubator ti = new TypeIncubator(new ListType(null,null,item)); ti.addFacet("minLength","1",false,null); // wrap it by a proxy object so that // these objects will work as singleton. return new Proxy(XSDatatype.XMLSCHEMA_NSURI,name,ti.derive(null,null)) { private Object readResolve() { try { return DatatypeFactory.getTypeByName(getName()); } catch( DatatypeException e ) { e.printStackTrace(); throw new InternalError(e.getMessage()); } } }; }
public void testSingletonness2() throws Exception { // built-in types use their names to keep singleton-ness. // make sure that it won't be deceived by datatypes // whose name is accidentally the same as the built-in type. TypeIncubator ti = new TypeIncubator(StringType.theInstance); ti.addFacet("maxLength","120",false,null); XSDatatype pseudoString = ti.derive("","string"); assertTrue( freezeDry(pseudoString)!=StringType.theInstance ); } }
public void testDerivationByRestriction() throws DatatypeException { TypeIncubator inc = new TypeIncubator( new FinalComponent( StringType.theInstance, XSDatatype.DERIVATION_BY_RESTRICTION ) ); try { inc.derive("test","test"); fail("should throw Exception here"); } catch( DatatypeException bte ) {;} }