package org.hccp.pdf; public class HexString implements DocumentObject { private String value; public HexString(String value) throws InvalidHexadecimalValueException { if(isValidHexadecimalValue(value)) { this.value = value; } else { throw new InvalidHexadecimalValueException("Invalid value for hexadecimal string: " + value); } } public String getValue() { StringBuffer sb = new StringBuffer(); sb.append("<"); sb.append(value); sb.append(">"); return sb.toString(); } private boolean isValidHexadecimalValue(String value) { return true; } }