1 16 19 package org.apache.xml.utils; 20 21 import java.util.Hashtable ; 22 23 28 class ElemDesc 29 { 30 31 32 Hashtable m_attrs = null; 33 34 40 int m_flags; 41 42 43 static final int EMPTY = (1 << 1); 44 45 46 static final int FLOW = (1 << 2); 47 48 49 static final int BLOCK = (1 << 3); 50 51 52 static final int BLOCKFORM = (1 << 4); 53 54 55 static final int BLOCKFORMFIELDSET = (1 << 5); 56 57 58 static final int CDATA = (1 << 6); 59 60 61 static final int PCDATA = (1 << 7); 62 63 64 static final int RAW = (1 << 8); 65 66 67 static final int INLINE = (1 << 9); 68 69 70 static final int INLINEA = (1 << 10); 71 72 73 static final int INLINELABEL = (1 << 11); 74 75 76 static final int FONTSTYLE = (1 << 12); 77 78 79 static final int PHRASE = (1 << 13); 80 81 82 static final int FORMCTRL = (1 << 14); 83 84 85 static final int SPECIAL = (1 << 15); 86 87 88 static final int ASPECIAL = (1 << 16); 89 90 91 static final int HEADMISC = (1 << 17); 92 93 94 static final int HEAD = (1 << 18); 95 96 97 static final int LIST = (1 << 19); 98 99 100 static final int PREFORMATTED = (1 << 20); 101 102 103 static final int WHITESPACESENSITIVE = (1 << 21); 104 105 106 static final int ATTRURL = (1 << 1); 107 108 109 static final int ATTREMPTY = (1 << 2); 110 111 117 ElemDesc(int flags) 118 { 119 m_flags = flags; 120 } 121 122 139 boolean is(int flags) 140 { 141 return (m_flags & flags) != 0; 143 } 144 145 152 void setAttr(String name, int flags) 153 { 154 155 if (null == m_attrs) 156 m_attrs = new Hashtable (); 157 158 m_attrs.put(name, new Integer (flags)); 159 } 160 161 172 boolean isAttrFlagSet(String name, int flags) 173 { 174 175 if (null != m_attrs) 176 { 177 Integer _flags = (Integer ) m_attrs.get(name); 178 179 if (null != _flags) 180 { 181 return (_flags.intValue() & flags) != 0; 182 } 183 } 184 185 return false; 186 } 187 } 188 | Popular Tags |