1 package com.thaiopensource.validate; 2 3 import com.thaiopensource.util.PropertyId; 4 import com.thaiopensource.util.PropertyMap; 5 import com.thaiopensource.util.PropertyMapBuilder; 6 import com.thaiopensource.xml.sax.XMLReaderCreator; 7 import org.xml.sax.ErrorHandler ; 8 import org.xml.sax.EntityResolver ; 9 10 20 public class ValidateProperty { 21 27 public static final ErrorHandlerPropertyId ERROR_HANDLER = new ErrorHandlerPropertyId("ERROR_HANDLER"); 28 29 35 public static final EntityResolverPropertyId ENTITY_RESOLVER = new EntityResolverPropertyId("ENTITY_RESOLVER"); 36 37 42 public static final XMLReaderCreatorPropertyId XML_READER_CREATOR 43 = new XMLReaderCreatorPropertyId("XML_READER_CREATOR"); 44 45 private ValidateProperty() { } 46 47 53 public static class ErrorHandlerPropertyId extends PropertyId { 54 public ErrorHandlerPropertyId(String name) { 55 super(name, ErrorHandler .class); 56 } 57 58 67 public ErrorHandler get(PropertyMap properties) { 68 return (ErrorHandler )properties.get(this); 69 } 70 71 83 public ErrorHandler put(PropertyMapBuilder builder, ErrorHandler value) { 84 return (ErrorHandler )builder.put(this, value); 85 } 86 } 87 88 94 public static class EntityResolverPropertyId extends PropertyId { 95 public EntityResolverPropertyId(String name) { 96 super(name, EntityResolver .class); 97 } 98 99 108 public EntityResolver get(PropertyMap properties) { 109 return (EntityResolver )properties.get(this); 110 } 111 112 124 public EntityResolver put(PropertyMapBuilder builder, EntityResolver value) { 125 return (EntityResolver )builder.put(this, value); 126 } 127 } 128 129 135 public static class XMLReaderCreatorPropertyId extends PropertyId { 136 public XMLReaderCreatorPropertyId(String name) { 137 super(name, XMLReaderCreator.class); 138 } 139 140 149 public XMLReaderCreator get(PropertyMap properties) { 150 return (XMLReaderCreator)properties.get(this); 151 } 152 153 165 public XMLReaderCreator put(PropertyMapBuilder builder, XMLReaderCreator value) { 166 return (XMLReaderCreator)builder.put(this, value); 167 } 168 } 169 } 170 | Popular Tags |