1 16 19 package org.apache.xml.serializer; 20 21 import org.apache.xml.utils.StringToIntTable; 22 23 26 public final class ElemDesc 27 { 28 29 int m_flags; 30 31 35 StringToIntTable m_attrs = null; 36 37 38 public static final int EMPTY = (1 << 1); 39 40 41 public static final int FLOW = (1 << 2); 42 43 44 public static final int BLOCK = (1 << 3); 45 46 47 public static final int BLOCKFORM = (1 << 4); 48 49 50 public static final int BLOCKFORMFIELDSET = (1 << 5); 51 52 53 public static final int CDATA = (1 << 6); 54 55 56 public static final int PCDATA = (1 << 7); 57 58 59 public static final int RAW = (1 << 8); 60 61 62 public static final int INLINE = (1 << 9); 63 64 65 public static final int INLINEA = (1 << 10); 66 67 68 public static final int INLINELABEL = (1 << 11); 69 70 71 public static final int FONTSTYLE = (1 << 12); 72 73 74 public static final int PHRASE = (1 << 13); 75 76 77 public static final int FORMCTRL = (1 << 14); 78 79 80 public static final int SPECIAL = (1 << 15); 81 82 83 public static final int ASPECIAL = (1 << 16); 84 85 86 public static final int HEADMISC = (1 << 17); 87 88 89 public static final int HEAD = (1 << 18); 90 91 92 public static final int LIST = (1 << 19); 93 94 95 public static final int PREFORMATTED = (1 << 20); 96 97 98 public static final int WHITESPACESENSITIVE = (1 << 21); 99 100 101 public static final int HEADELEM = (1 << 22); 102 103 104 public static final int ATTRURL = (1 << 1); 105 106 107 public static final int ATTREMPTY = (1 << 2); 108 109 115 public ElemDesc(int flags) 116 { 117 m_flags = flags; 118 } 119 120 128 public boolean is(int flags) 129 { 130 131 return (m_flags & flags) != 0; 133 } 134 135 public int getFlags() { 136 return m_flags; 137 } 138 139 146 public void setAttr(String name, int flags) 147 { 148 149 if (null == m_attrs) 150 m_attrs = new StringToIntTable(); 151 152 m_attrs.put(name, flags); 153 } 154 155 163 public boolean isAttrFlagSet(String name, int flags) 164 { 165 return (null != m_attrs) 166 ? ((m_attrs.getIgnoreCase(name) & flags) != 0) 167 : false; 168 } 169 } 170 | Popular Tags |