public ConcreteType getConcreteType() { return baseType.getConcreteType(); }
public ConcreteType getConcreteType() { return baseType.getConcreteType(); }
public ConcreteType getConcreteType() { return baseType.getConcreteType(); }
public ConcreteType getConcreteType() { return baseType.getConcreteType(); }
public ConcreteType getConcreteType() { return baseType.getConcreteType(); }
protected String generateList(XSDatatypeImpl dti, ContextProviderImpl context) { try { ListType base = (ListType)dti.getConcreteType(); LengthFacet lf = (LengthFacet)dti.getFacetObject(XSDatatype.FACET_LENGTH); int n; // compute # of items into this value. if(lf!=null) { n = lf.length; } else { MaxLengthFacet xlf = (MaxLengthFacet)dti.getFacetObject(XSDatatype.FACET_MAXLENGTH); int max = (xlf!=null)?xlf.maxLength:16; MinLengthFacet nlf = (MinLengthFacet)dti.getFacetObject(XSDatatype.FACET_MINLENGTH); int min = (nlf!=null)?nlf.minLength:0; n = random.nextInt(max-min)+min; } String s=""; for( int i=0; i<n; i++ ) s += " " + generate(base.itemType,context) + " "; return s; } catch( GenerationException ge ) { return null; } }
XSDatatype baseType = dti.getConcreteType();
ns.add(dt.getConcreteType().getName());
ns.add(dt.getConcreteType().getName());
ns.add(dt.getConcreteType().getName());
ns.add(dt.getConcreteType().getName());
/** constructor for WhiteSpaceFacet */ DataTypeWithFacet( String nsUri, String typeName, XSDatatypeImpl baseType, String facetName, boolean _isFixed, WhiteSpaceProcessor whiteSpace ) throws DatatypeException { super(nsUri,typeName, whiteSpace); this.baseType = baseType; this.facetName = facetName; this.isFacetFixed = _isFixed; this.concreteType = baseType.getConcreteType(); needValueCheckFlag = baseType.needValueCheck(); int r = baseType.isFacetApplicable(facetName); switch(r) { case APPLICABLE: return; // this facet is applicable to this type. no problem. case NOT_ALLOWED: throw new DatatypeException( localize(ERR_NOT_APPLICABLE_FACET, facetName) ); case FIXED: throw new DatatypeException( localize(ERR_OVERRIDING_FIXED_FACET, facetName) ); } }
/** constructor for WhiteSpaceFacet */ DataTypeWithFacet( String nsUri, String typeName, XSDatatypeImpl baseType, String facetName, boolean _isFixed, WhiteSpaceProcessor whiteSpace ) throws DatatypeException { super(nsUri,typeName, whiteSpace); this.baseType = baseType; this.facetName = facetName; this.isFacetFixed = _isFixed; this.concreteType = baseType.getConcreteType(); needValueCheckFlag = baseType.needValueCheck(); int r = baseType.isFacetApplicable(facetName); switch(r) { case APPLICABLE: return; // this facet is applicable to this type. no problem. case NOT_ALLOWED: throw new DatatypeException( localize(ERR_NOT_APPLICABLE_FACET, facetName) ); case FIXED: throw new DatatypeException( localize(ERR_OVERRIDING_FIXED_FACET, facetName) ); } }
/** constructor for WhiteSpaceFacet */ DataTypeWithFacet( String nsUri, String typeName, XSDatatypeImpl baseType, String facetName, boolean _isFixed, WhiteSpaceProcessor whiteSpace ) throws DatatypeException { super(nsUri,typeName, whiteSpace); this.baseType = baseType; this.facetName = facetName; this.isFacetFixed = _isFixed; this.concreteType = baseType.getConcreteType(); needValueCheckFlag = baseType.needValueCheck(); int r = baseType.isFacetApplicable(facetName); switch(r) { case APPLICABLE: return; // this facet is applicable to this type. no problem. case NOT_ALLOWED: throw new DatatypeException( localize(ERR_NOT_APPLICABLE_FACET, facetName) ); case FIXED: throw new DatatypeException( localize(ERR_OVERRIDING_FIXED_FACET, facetName) ); } }
/** constructor for WhiteSpaceFacet */ DataTypeWithFacet( String nsUri, String typeName, XSDatatypeImpl baseType, String facetName, boolean _isFixed, WhiteSpaceProcessor whiteSpace ) throws DatatypeException { super(nsUri,typeName, whiteSpace); this.baseType = baseType; this.facetName = facetName; this.isFacetFixed = _isFixed; this.concreteType = baseType.getConcreteType(); needValueCheckFlag = baseType.needValueCheck(); int r = baseType.isFacetApplicable(facetName); switch(r) { case APPLICABLE: return; // this facet is applicable to this type. no problem. case NOT_ALLOWED: throw new DatatypeException( localize(ERR_NOT_APPLICABLE_FACET, facetName) ); case FIXED: throw new DatatypeException( localize(ERR_OVERRIDING_FIXED_FACET, facetName) ); } }
/** constructor for WhiteSpaceFacet */ DataTypeWithFacet( String nsUri, String typeName, XSDatatypeImpl baseType, String facetName, boolean _isFixed, WhiteSpaceProcessor whiteSpace ) throws DatatypeException { super(nsUri,typeName, whiteSpace); this.baseType = baseType; this.facetName = facetName; this.isFacetFixed = _isFixed; this.concreteType = baseType.getConcreteType(); needValueCheckFlag = baseType.needValueCheck(); int r = baseType.isFacetApplicable(facetName); switch(r) { case APPLICABLE: return; // this facet is applicable to this type. no problem. case NOT_ALLOWED: throw new DatatypeException( localize(ERR_NOT_APPLICABLE_FACET, facetName) ); case FIXED: throw new DatatypeException( localize(ERR_OVERRIDING_FIXED_FACET, facetName) ); } }
/** * serializes a list type. * this method is called by serializeDataType method. */ protected void serializeListType(XSDatatypeImpl dt) { ListType base = (ListType)dt.getConcreteType(); if (dt.getFacetObject(XSDatatype.FACET_LENGTH) != null) { // with the length facet. int len = ((LengthFacet)dt.getFacetObject(XSDatatype.FACET_LENGTH)).length; writer.start("list"); for (int i = 0; i < len; i++) serializeDataType(base.itemType); writer.end("list"); return; } if (dt.getFacetObject(XSDatatype.FACET_MAXLENGTH) != null) throw new UnsupportedOperationException("warning: maxLength facet to list type is not properly converted."); MinLengthFacet minLength = (MinLengthFacet)dt.getFacetObject(XSDatatype.FACET_MINLENGTH); writer.start("list"); if (minLength != null) { // list n times for (int i = 0; i < minLength.minLength; i++) serializeDataType(base.itemType); } writer.start("zeroOrMore"); serializeDataType(base.itemType); writer.end("zeroOrMore"); writer.end("list"); }
/** * serializes a list type. * this method is called by serializeDataType method. */ protected void serializeListType(XSDatatypeImpl dt) { ListType base = (ListType)dt.getConcreteType(); if (dt.getFacetObject(XSDatatype.FACET_LENGTH) != null) { // with the length facet. int len = ((LengthFacet)dt.getFacetObject(XSDatatype.FACET_LENGTH)).length; writer.start("list"); for (int i = 0; i < len; i++) serializeDataType(base.itemType); writer.end("list"); return; } if (dt.getFacetObject(XSDatatype.FACET_MAXLENGTH) != null) throw new UnsupportedOperationException("warning: maxLength facet to list type is not properly converted."); MinLengthFacet minLength = (MinLengthFacet)dt.getFacetObject(XSDatatype.FACET_MINLENGTH); writer.start("list"); if (minLength != null) { // list n times for (int i = 0; i < minLength.minLength; i++) serializeDataType(base.itemType); } writer.start("zeroOrMore"); serializeDataType(base.itemType); writer.end("zeroOrMore"); writer.end("list"); }
/** * serializes a list type. * this method is called by serializeDataType method. */ protected void serializeListType(XSDatatypeImpl dt) { ListType base = (ListType)dt.getConcreteType(); if (dt.getFacetObject(XSDatatype.FACET_LENGTH) != null) { // with the length facet. int len = ((LengthFacet)dt.getFacetObject(XSDatatype.FACET_LENGTH)).length; writer.start("list"); for (int i = 0; i < len; i++) serializeDataType(base.itemType); writer.end("list"); return; } if (dt.getFacetObject(XSDatatype.FACET_MAXLENGTH) != null) throw new UnsupportedOperationException("warning: maxLength facet to list type is not properly converted."); MinLengthFacet minLength = (MinLengthFacet)dt.getFacetObject(XSDatatype.FACET_MINLENGTH); writer.start("list"); if (minLength != null) { // list n times for (int i = 0; i < minLength.minLength; i++) serializeDataType(base.itemType); } writer.start("zeroOrMore"); serializeDataType(base.itemType); writer.end("zeroOrMore"); writer.end("list"); }
/** * serializes a list type. * this method is called by serializeDataType method. */ protected void serializeListType(XSDatatypeImpl dt) { ListType base = (ListType)dt.getConcreteType(); if (dt.getFacetObject(XSDatatype.FACET_LENGTH) != null) { // with the length facet. int len = ((LengthFacet)dt.getFacetObject(XSDatatype.FACET_LENGTH)).length; writer.start("list"); for (int i = 0; i < len; i++) serializeDataType(base.itemType); writer.end("list"); return; } if (dt.getFacetObject(XSDatatype.FACET_MAXLENGTH) != null) throw new UnsupportedOperationException("warning: maxLength facet to list type is not properly converted."); MinLengthFacet minLength = (MinLengthFacet)dt.getFacetObject(XSDatatype.FACET_MINLENGTH); writer.start("list"); if (minLength != null) { // list n times for (int i = 0; i < minLength.minLength; i++) serializeDataType(base.itemType); } writer.start("zeroOrMore"); serializeDataType(base.itemType); writer.end("zeroOrMore"); writer.end("list"); }