KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > com > thaiopensource > datatype > xsd > MaxLengthRestrictDatatype


1 package com.thaiopensource.datatype.xsd;
2
3 class MaxLengthRestrictDatatype extends ValueRestrictDatatype {
4   private final int length;
5   private final Measure measure;
6
7   MaxLengthRestrictDatatype(DatatypeBase base, int length) {
8     super(base);
9     this.measure = base.getMeasure();
10     this.length = length;
11   }
12
13   boolean satisfiesRestriction(Object JavaDoc obj) {
14     return measure.getLength(obj) <= length;
15   }
16 }
17
Popular Tags