FileDocCategorySizeDatePackage
ElemDesc.javaAPI DocJava SE 5 API5736Fri Aug 26 14:56:04 BST 2005com.sun.org.apache.xml.internal.utils

ElemDesc

public class ElemDesc extends Object
This class is in support of SerializerToHTML, and acts as a sort of element representative for HTML elements.
xsl.usage
internal

Fields Summary
Hashtable
m_attrs
Table of attributes for the element
int
m_flags
Element's flags, describing the role this element plays during formatting of the document. This is used as a bitvector; more than one flag may be set at a time, bitwise-ORed together. Mnemonic and bits have been assigned to the flag values. NOTE: Some bits are currently assigned multiple mnemonics; it is the caller's responsibility to disambiguate these if necessary.
static final int
EMPTY
Defines mnemonic and bit-value for the EMPTY flag
static final int
FLOW
Defines mnemonic and bit-value for the FLOW flag
static final int
BLOCK
Defines mnemonic and bit-value for the BLOCK flag
static final int
BLOCKFORM
Defines mnemonic and bit-value for the BLOCKFORM flag
static final int
BLOCKFORMFIELDSET
Defines mnemonic and bit-value for the BLOCKFORMFIELDSET flag
static final int
CDATA
Defines mnemonic and bit-value for the CDATA flag
static final int
PCDATA
Defines mnemonic and bit-value for the PCDATA flag
static final int
RAW
Defines mnemonic and bit-value for the RAW flag
static final int
INLINE
Defines mnemonic and bit-value for the INLINE flag
static final int
INLINEA
Defines mnemonic and bit-value for the INLINEA flag
static final int
INLINELABEL
Defines mnemonic and bit-value for the INLINELABEL flag
static final int
FONTSTYLE
Defines mnemonic and bit-value for the FONTSTYLE flag
static final int
PHRASE
Defines mnemonic and bit-value for the PHRASE flag
static final int
FORMCTRL
Defines mnemonic and bit-value for the FORMCTRL flag
static final int
SPECIAL
Defines mnemonic and bit-value for the SPECIAL flag
static final int
ASPECIAL
Defines mnemonic and bit-value for the ASPECIAL flag
static final int
HEADMISC
Defines mnemonic and bit-value for the HEADMISC flag
static final int
HEAD
Defines mnemonic and bit-value for the HEAD flag
static final int
LIST
Defines mnemonic and bit-value for the LIST flag
static final int
PREFORMATTED
Defines mnemonic and bit-value for the PREFORMATTED flag
static final int
WHITESPACESENSITIVE
Defines mnemonic and bit-value for the WHITESPACESENSITIVE flag
static final int
ATTRURL
Defines mnemonic and bit-value for the ATTRURL flag
static final int
ATTREMPTY
Defines mnemonic and bit-value for the ATTREMPTY flag
Constructors Summary
ElemDesc(int flags)
Construct an ElementDescription with an initial set of flags.

param
flags Element flags
see
m_flags


                    
   
  
    m_flags = flags;
  
Methods Summary
booleanis(int flags)
"is (this element described by these flags)". This might more properly be called areFlagsSet(). It accepts an integer (being used as a bitvector) and checks whether all the corresponding bits are set in our internal flags. Note that this test is performed as a bitwise AND, not an equality test, so a 0 bit in the input means "don't test", not "must be set false".

param
flags Vector of flags to compare against this element's flags
return
true if the flags set in the parameter are also set in the element's stored flags.
see
m_flags
see
isAttrFlagSet

    // int which = (m_flags & flags);
    return (m_flags & flags) != 0;
  
booleanisAttrFlagSet(java.lang.String name, int flags)
Find out if a flag is set in a given attribute of this element

param
name Attribute name
param
flags Flag to check
return
True if the flag is set in the attribute. Returns false if the attribute is not found
see
m_flags


    if (null != m_attrs)
    {
      Integer _flags = (Integer) m_attrs.get(name);

      if (null != _flags)
      {
        return (_flags.intValue() & flags) != 0;
      }
    }

    return false;
  
voidsetAttr(java.lang.String name, int flags)
Set a new attribute for this element

param
name Attribute name
param
flags Attibute flags


    if (null == m_attrs)
      m_attrs = new Hashtable();

    m_attrs.put(name, new Integer(flags));