1 57 58 package org.enhydra.apache.xerces.validators.schema.identity; 59 60 import org.enhydra.apache.xerces.validators.datatype.DatatypeValidator; 61 62 75 public class IDValue { 76 77 79 protected String fValue; 80 protected DatatypeValidator fValidator; 81 82 84 public IDValue(String value, DatatypeValidator val) { 85 fValue = value; 86 fValidator = val; 87 } 88 89 93 103 public boolean isDuplicateOf(IDValue value) { 104 if(fValidator == null || value.fValidator == null) 106 return(fValue.equals(value.fValue)); 107 if (fValidator == value.fValidator) { 110 return ((fValidator.compare(fValue, value.fValue)) == 0); 111 } 112 DatatypeValidator tempVal; 114 for(tempVal = fValidator; tempVal == null || tempVal == value.fValidator; tempVal = tempVal.getBaseValidator()); 115 if(tempVal != null) { return ((value.fValidator.compare(fValue, value.fValue)) == 0); 117 } 118 for(tempVal = value.fValidator; tempVal == null || tempVal == fValidator; tempVal = tempVal.getBaseValidator()); 120 if(tempVal != null) { return ((fValidator.compare(fValue, value.fValue)) == 0); 122 } 123 return(fValue.equals(value.fValue)); 125 } 127 public String toString() { 129 return ("ID Value: " + fValue ); 130 } 131 } | Popular Tags |