1 57 58 package org.enhydra.apache.xerces.validators.common; 59 60 import org.enhydra.apache.xerces.utils.QName; 61 import org.enhydra.apache.xerces.validators.datatype.DatatypeValidator; 62 63 66 public class XMLAttributeDecl { 67 68 72 74 public static final int TYPE_CDATA = 0; 75 public static final int TYPE_ENTITY = 1; 76 public static final int TYPE_ENUMERATION = 2; 77 public static final int TYPE_ID = 3; 78 public static final int TYPE_IDREF = 4; 79 public static final int TYPE_NMTOKEN = 5; 80 public static final int TYPE_NOTATION = 6; 81 82 84 public static final int TYPE_SIMPLE = 7; 85 86 public static final int TYPE_ANY_ANY = 8; 87 public static final int TYPE_ANY_OTHER = 9; 88 public static final int TYPE_ANY_LIST = 11; 91 92 public static final int DEFAULT_TYPE_IMPLIED = 1; 94 public static final int DEFAULT_TYPE_REQUIRED = 2; 95 public static final int DEFAULT_TYPE_PROHIBITED = 4; 96 public static final int DEFAULT_TYPE_DEFAULT = 8; 97 public static final int DEFAULT_TYPE_FIXED = 16; 98 public static final int DEFAULT_TYPE_REQUIRED_AND_FIXED = DEFAULT_TYPE_REQUIRED | DEFAULT_TYPE_FIXED; 99 100 public static final int USE_TYPE_OPTIONAL = DEFAULT_TYPE_IMPLIED; 102 public static final int USE_TYPE_REQUIRED = DEFAULT_TYPE_REQUIRED; 103 public static final int USE_TYPE_PROHIBITED = DEFAULT_TYPE_PROHIBITED; 104 public static final int VALUE_CONSTRAINT_DEFAULT = DEFAULT_TYPE_DEFAULT; 106 public static final int VALUE_CONSTRAINT_FIXED = DEFAULT_TYPE_FIXED; 107 108 public static final int PROCESSCONTENTS_STRICT = 1024; 110 public static final int PROCESSCONTENTS_LAX = 2048; 111 public static final int PROCESSCONTENTS_SKIP = 4096; 112 113 114 118 120 public QName name = new QName(); 121 122 124 public DatatypeValidator datatypeValidator; 125 126 128 public int type; 129 130 public boolean list; 131 132 public int enumeration; 134 135 public int defaultType; 139 140 public String defaultValue; 141 142 146 public XMLAttributeDecl() { 147 clear(); 148 } 149 150 public XMLAttributeDecl(XMLAttributeDecl attributeDecl) { 151 setValues(attributeDecl); 152 } 153 154 158 public void clear() { 159 name.clear(); 160 datatypeValidator = null; 161 type = -1; 162 list = false; 163 enumeration = -1; 164 defaultType = DEFAULT_TYPE_IMPLIED; 165 defaultValue = null; 166 } 167 168 public void setValues(XMLAttributeDecl attributeDecl) { 169 name.setValues(attributeDecl.name); 170 datatypeValidator = attributeDecl.datatypeValidator; 171 type = attributeDecl.type; 172 list = attributeDecl.list; 173 enumeration = attributeDecl.enumeration; 174 defaultType = attributeDecl.defaultType; 175 defaultValue = attributeDecl.defaultValue; 176 } 177 178 182 public int hashCode() { 183 return super.hashCode(); 185 } 186 187 public boolean equals(Object object) { 188 return super.equals(object); 190 } 191 192 } | Popular Tags |