xalan-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From mk...@apache.org
Subject cvs commit: xml-xalan/java/src/org/apache/xml/serializer ElemDesc.java
Date Wed, 25 Jun 2003 14:40:37 GMT
mkwan       2003/06/25 07:40:36

  Modified:    java/src/org/apache/xalan/xsltc/compiler
                        LiteralAttribute.java LiteralElement.java
                        Output.java Stylesheet.java Text.java
                        XslAttribute.java
               java/src/org/apache/xalan/xsltc/compiler/util
                        MethodGenerator.java
               java/src/org/apache/xml/serializer ElemDesc.java
  Log:
  Performance improvement for XSLTC
  
  Implement a compiler-assisted serialization feature.
  Generate code to make use of the new
  addUniqAttribute(String name, String value, int flags)
  interface in SerializationHandler. The compiler does
  more static analysis on attributes of literal elements
  and passes the additional information to the serializer
  via a bit-encoded flag.
  
  The additional information includes whether this attribute
  is unique, whether its value has bad characters (something
  needs to be escaped), whether it is a HTML URI or empty
  attribute. If the attribute is unique, the serializer can
  write out the attribute right away, without having to
  accumulate it in an internal table. If it also does not
  contain bad characters, then escaping is not needed.
  All these information speeds up the serializer on writing
  the attributes out.
  
  Revision  Changes    Path
  1.7       +75 -3     xml-xalan/java/src/org/apache/xalan/xsltc/compiler/LiteralAttribute.java
  
  Index: LiteralAttribute.java
  ===================================================================
  RCS file: /home/cvs/xml-xalan/java/src/org/apache/xalan/xsltc/compiler/LiteralAttribute.java,v
  retrieving revision 1.6
  retrieving revision 1.7
  diff -u -r1.6 -r1.7
  --- LiteralAttribute.java	30 Jan 2003 18:46:00 -0000	1.6
  +++ LiteralAttribute.java	25 Jun 2003 14:40:35 -0000	1.7
  @@ -73,6 +73,9 @@
   import org.apache.xalan.xsltc.compiler.util.TypeCheckError;
   import org.apache.xalan.xsltc.compiler.util.Util;
   
  +import org.apache.xml.serializer.ElemDesc;
  +import org.apache.xml.serializer.SerializationHandler;
  +
   final class LiteralAttribute extends Instruction {
   
       private final String  _name;         // Attribute name (incl. prefix)
  @@ -114,7 +117,76 @@
   	il.append(new PUSH(cpg, _name));
   	// push attribute value
   	_value.translate(classGen, methodGen);
  -	// call attribute
  -	il.append(methodGen.attribute());
  +	
  +	// Generate code that calls SerializationHandler.addUniqueAttribute()
  +	// if all attributes are unique.
  +	SyntaxTreeNode parent = getParent();
  +	if (parent instanceof LiteralElement
  +	    && ((LiteralElement)parent).allAttributesUnique()) {	    
  +	    
  +	    int flags = 0;
  +	    boolean isHTMLAttrEmpty = false;
  +	    ElemDesc elemDesc = ((LiteralElement)parent).getElemDesc();
  +	    
  +	    // Set the HTML flags
  +	    if (elemDesc != null) {
  +	    	if (elemDesc.isAttrFlagSet(_name, ElemDesc.ATTREMPTY)) {
  +	    	    flags = flags | SerializationHandler.HTML_ATTREMPTY;
  +	    	    isHTMLAttrEmpty = true;
  +	    	}
  +	    	else if (elemDesc.isAttrFlagSet(_name, ElemDesc.ATTRURL)) {
  +	    	    flags = flags | SerializationHandler.HTML_ATTRURL;
  +	    	}
  +	    }
  +	    
  +	    if (_value instanceof SimpleAttributeValue) {
  +	        String attrValue = ((SimpleAttributeValue)_value).toString();
  +	        
  +	        if (!hasBadChars(attrValue) && !isHTMLAttrEmpty) {
  +	            flags = flags | SerializationHandler.NO_BAD_CHARS;
  +	        }
  +	    }
  +	        
  +	    il.append(new PUSH(cpg, flags));
  +	    il.append(methodGen.uniqueAttribute());
  +	}
  +	else {
  +	    // call attribute
  +	    il.append(methodGen.attribute());
  +	}
  +    }
  +    
  +    /**
  +     * Return true if at least one character in the String is considered to
  +     * be a "bad" character. A bad character is one whose code is:
  +     * less than 32 (a space),
  +     * or greater than 126,
  +     * or it is one of '<', '>', '&' or '\"'. 
  +     * This helps the serializer to decide whether the String needs to be escaped.
  +     */
  +    private boolean hasBadChars(String value) {
  +    	char[] chars = value.toCharArray();
  +    	int size = chars.length;
  +    	for (int i = 0; i < size; i++) {
  +    	    char ch = chars[i];
  +    	    if (ch < 32 || 126 < ch || ch == '<' || ch == '>' || ch == '&'
|| ch == '\"')
  +                return true;    	        
  +    	}
  +    	return false;
  +    }
  +    
  +    /**
  +     * Return the name of the attribute
  +     */
  +    public String getName() {
  +        return _name;
  +    }
  +    
  +    /**
  +     * Return the value of the attribute
  +     */
  +    public AttributeValue getValue() {
  +        return _value;
       }
  +    
   }
  
  
  
  1.21      +154 -3    xml-xalan/java/src/org/apache/xalan/xsltc/compiler/LiteralElement.java
  
  Index: LiteralElement.java
  ===================================================================
  RCS file: /home/cvs/xml-xalan/java/src/org/apache/xalan/xsltc/compiler/LiteralElement.java,v
  retrieving revision 1.20
  retrieving revision 1.21
  diff -u -r1.20 -r1.21
  --- LiteralElement.java	30 Jan 2003 18:46:00 -0000	1.20
  +++ LiteralElement.java	25 Jun 2003 14:40:35 -0000	1.21
  @@ -77,13 +77,21 @@
   import org.apache.xalan.xsltc.compiler.util.TypeCheckError;
   import org.apache.xalan.xsltc.compiler.util.Util;
   
  +import org.apache.xml.serializer.ElemDesc;
  +import org.apache.xml.serializer.ToHTMLStream;
  +
   final class LiteralElement extends Instruction {
   
       private String _name;
       private LiteralElement _literalElemParent;
       private Vector _attributeElements = null;
       private Hashtable _accessedPrefixes = null;
  -
  +    
  +    // True if all attributes of this LRE are unique, i.e. they all have
  +    // different names. This flag is set to false if some attribute
  +    // names are not known at compile time.
  +    private boolean _allAttributesUnique = false;
  +        
       private final static String XMLNS_STRING = "xmlns";
   
       /**
  @@ -358,8 +366,12 @@
   	final ConstantPoolGen cpg = classGen.getConstantPool();
   	final InstructionList il = methodGen.getInstructionList();
   
  +        // Check whether all attributes are unique.
  +        _allAttributesUnique = checkAttributesUnique();
  +
   	// Compile code to emit element start tag
   	il.append(methodGen.loadHandler());
  +	
   	il.append(new PUSH(cpg, _name));
   	il.append(DUP2); 		// duplicate these 2 args for endElement
   	il.append(methodGen.startElement());
  @@ -425,4 +437,143 @@
   	// Compile code to emit element end tag
   	il.append(methodGen.endElement());
       }
  -}
  +
  +    /**
  +     * Return true if the output method is html.
  +     */
  +    private boolean isHTMLOutput() {
  +        return getStylesheet().getOutputMethod() == Stylesheet.HTML_OUTPUT;
  +    }
  +    
  +    /**
  +     * Return the ElemDesc object for an HTML element.
  +     * Return null if the output method is not HTML or this is not a 
  +     * valid HTML element.
  +     */
  +    public ElemDesc getElemDesc() {
  +    	if (isHTMLOutput()) {
  +    	    return ToHTMLStream.getElemDesc(_name);
  +    	}
  +    	else
  +    	    return null;
  +    }
  +    
  +    /**
  +     * Return true if all attributes of this LRE have unique names.
  +     */
  +    public boolean allAttributesUnique() {
  +    	return _allAttributesUnique;
  +    }
  +    
  +    /**
  +     * Check whether all attributes are unique.
  +     */
  +    private boolean checkAttributesUnique() {
  +    	 boolean hasHiddenXslAttribute = hasXslAttributeChildren(this, true);
  +    	 if (hasHiddenXslAttribute)
  +    	     return false;
  +    	 
  +    	 if (_attributeElements != null) {
  +    	     int numAttrs = _attributeElements.size();
  +    	     Hashtable attrsTable = null;
  +    	     for (int i = 0; i < numAttrs; i++) {
  +    	         SyntaxTreeNode node = (SyntaxTreeNode)_attributeElements.elementAt(i);
  +    	         
  +    	         if (node instanceof UseAttributeSets) {
  +    	             return false;
  +    	         }
  +    	         else if (node instanceof XslAttribute) {   	             
  +    	             if (attrsTable == null) {
  +    	             	attrsTable = new Hashtable();
  +    	                 for (int k = 0; k < i; k++) {
  +    	                     SyntaxTreeNode n = (SyntaxTreeNode)_attributeElements.elementAt(k);
  +    	                     if (n instanceof LiteralAttribute) {
  +    	                         LiteralAttribute literalAttr = (LiteralAttribute)n;
  +    	                         attrsTable.put(literalAttr.getName(), literalAttr);
  +    	                     }
  +    	                 }
  +    	             }
  +    	             
  +    	             XslAttribute xslAttr = (XslAttribute)node;
  +    	             AttributeValue attrName = xslAttr.getName();
  +    	             if (attrName instanceof AttributeValueTemplate) {
  +    	                 return false;
  +    	             }
  +    	             else if (attrName instanceof SimpleAttributeValue) {
  +    	                 SimpleAttributeValue simpleAttr = (SimpleAttributeValue)attrName;
  +    	                 String name = simpleAttr.toString();
  +    	                 if (name != null && attrsTable.get(name) != null)
  +    	                     return false;
  +    	                 else if (name != null) {
  +    	                     attrsTable.put(name, xslAttr);
  +    	                 }    	                 
  +    	             }
  +    	         }
  +    	     }
  +    	 }
  +    	 return true;
  +    }
  +    
  +    /**
  +     * Return true if the given SyntaxTreeNode may contains <xsl:attribute>s in it.
The flag
  +     * ignoreXslAttribute indicates if the direct <xsl:attribute> children of this
node 
  +     * are included.
  +     */
  +    private boolean hasXslAttributeChildren(SyntaxTreeNode node, boolean ignoreXslAttribute)
{
  +    	Vector contents = node.getContents();
  +    	int size = contents.size();
  +    	for (int i = 0; i < size; i++) {
  +    	    SyntaxTreeNode child = (SyntaxTreeNode)contents.elementAt(i);
  +    	    if (child instanceof Text) {
  +    	    	Text text = (Text)child;
  +    	    	if (text.isIgnore())
  +    	    	    continue;
  +    	    	else
  +    	    	    return false;
  +    	    }
  +   	    else if (hasOutputEffect(child))
  +    	        return false;
  +    	    else if (child instanceof XslAttribute) {
  +    	    	if (ignoreXslAttribute)
  +    	    	    continue;
  +    	    	else
  +    	    	    return true;
  +    	    } 	         
  +    	    else if (child instanceof CallTemplate
  +    	        || child instanceof ApplyTemplates)
  +    	        return true;
  +    	    else if ((child instanceof If
  +    	               || child instanceof ForEach)
  +    	             && hasXslAttributeChildren(child, false)) {
  +     	    	return true;
  +    	    }
  +    	    else if (child instanceof Choose) {
  +    	    	Vector chooseContents = child.getContents();
  +    	    	int num = chooseContents.size();
  +    	    	for (int k = 0; k < num; k++) {
  +    	    	    SyntaxTreeNode chooseChild = (SyntaxTreeNode)chooseContents.elementAt(k);
  +    	    	    if (chooseChild instanceof When || chooseChild instanceof Otherwise) {
  +    	    	    	if (hasXslAttributeChildren(chooseChild, false))
  +    	    	    	    return true;
  +    	    	    }
  +    	    	}
  +    	    }
  +    	}
  +    	return false;
  +    }
  +    
  +    /**
  +     * Return true if this node can output something to the result tree.
  +     */
  +    private boolean hasOutputEffect(SyntaxTreeNode node) {
  +        return (node instanceof LiteralElement)
  +            || (node instanceof ValueOf)
  +            || (node instanceof Copy)
  +            || (node instanceof CopyOf)
  +            || (node instanceof XslElement)
  +            || (node instanceof Comment)
  +            || (node instanceof Number)
  +            || (node instanceof ProcessingInstruction);
  +    }
  +
  +}  
  
  
  
  1.23      +5 -1      xml-xalan/java/src/org/apache/xalan/xsltc/compiler/Output.java
  
  Index: Output.java
  ===================================================================
  RCS file: /home/cvs/xml-xalan/java/src/org/apache/xalan/xsltc/compiler/Output.java,v
  retrieving revision 1.22
  retrieving revision 1.23
  diff -u -r1.22 -r1.23
  --- Output.java	1 Apr 2003 21:09:00 -0000	1.22
  +++ Output.java	25 Jun 2003 14:40:35 -0000	1.23
  @@ -132,6 +132,10 @@
   	return _cdata;
       }
   
  +    public String getOutputMethod() {
  +    	return _method;
  +    }
  +    
       public void mergeCdata(String cdata) {
   	_cdataToMerge = cdata;
       }
  
  
  
  1.49      +42 -4     xml-xalan/java/src/org/apache/xalan/xsltc/compiler/Stylesheet.java
  
  Index: Stylesheet.java
  ===================================================================
  RCS file: /home/cvs/xml-xalan/java/src/org/apache/xalan/xsltc/compiler/Stylesheet.java,v
  retrieving revision 1.48
  retrieving revision 1.49
  diff -u -r1.48 -r1.49
  --- Stylesheet.java	8 Apr 2003 19:28:46 -0000	1.48
  +++ Stylesheet.java	25 Jun 2003 14:40:35 -0000	1.49
  @@ -140,7 +140,41 @@
       
       private boolean _hasIdCall = false;
   
  +    private Output  _lastOutputElement = null;
       private Properties _outputProperties = null;
  +    
  +    // Output method constants
  +    public static final int UNKNOWN_OUTPUT = 0;
  +    public static final int XML_OUTPUT = 1;
  +    public static final int HTML_OUTPUT = 2;
  +    public static final int TEXT_OUTPUT = 3;
  +    
  +    private int _outputMethod = UNKNOWN_OUTPUT;
  +    
  +    /**
  +     * Return the output method
  +     */
  +    public int getOutputMethod() {
  +    	return _outputMethod;
  +    }
  +    
  +    /**
  +     * Check and set the output method
  +     */
  +    private void checkOutputMethod() {
  +	if (_lastOutputElement != null) {
  +	    String method = _lastOutputElement.getOutputMethod();
  +	    if (method != null) {
  +	        if (method.equals("xml"))
  +	            _outputMethod = XML_OUTPUT;
  +	        else if (method.equals("html"))
  +	            _outputMethod = HTML_OUTPUT;
  +	        else if (method.equals("text"))
  +	            _outputMethod = TEXT_OUTPUT;
  +	    }
  +	}
  +    }
  +    
   
       public void setForwardReference() {
   	_forwardReference = true;
  @@ -181,6 +215,10 @@
   	return _outputProperties;
       }
   
  +    public Output getLastOutputElement() {
  +    	return _lastOutputElement;
  +    }
  +    
       public void setMultiDocument(boolean flag) {	
   	_multiDocument = flag;
       }
  @@ -513,7 +551,6 @@
        * Translate the stylesheet into JVM bytecodes. 
        */
       public void translate() {
  -	Output lastOutputElement = null;
   	_className = getXSLTC().getClassName();
   
   	// Define a new class by extending TRANSLET_CLASS
  @@ -548,7 +585,7 @@
   	    else if (element instanceof Output) {
   		// save the element for later to pass to compileConstructor 
   		Output output = (Output)element;
  -		if (output.enabled()) lastOutputElement = output;
  +		if (output.enabled()) _lastOutputElement = output;
   	    }
   	    else {
   		// Global variables and parameters are handled elsewhere.
  @@ -557,9 +594,10 @@
   	    }
   	}
   
  +	checkOutputMethod();
   	processModes();
   	compileModes(classGen);
  -	compileConstructor(classGen, lastOutputElement);
  +	compileConstructor(classGen, _lastOutputElement);
   
   	if (!getParser().errorsFound()) {
   	    getXSLTC().dumpClass(classGen.getJavaClass());
  
  
  
  1.15      +5 -1      xml-xalan/java/src/org/apache/xalan/xsltc/compiler/Text.java
  
  Index: Text.java
  ===================================================================
  RCS file: /home/cvs/xml-xalan/java/src/org/apache/xalan/xsltc/compiler/Text.java,v
  retrieving revision 1.14
  retrieving revision 1.15
  diff -u -r1.14 -r1.15
  --- Text.java	30 Jan 2003 18:46:02 -0000	1.14
  +++ Text.java	25 Jun 2003 14:40:35 -0000	1.15
  @@ -153,6 +153,10 @@
   	_ignore = true;
       }
   
  +    public boolean isIgnore() {
  +    	return _ignore;
  +    }
  +    
       public boolean isTextElement() {
   	return _textElement;
       }
  
  
  
  1.22      +28 -3     xml-xalan/java/src/org/apache/xalan/xsltc/compiler/XslAttribute.java
  
  Index: XslAttribute.java
  ===================================================================
  RCS file: /home/cvs/xml-xalan/java/src/org/apache/xalan/xsltc/compiler/XslAttribute.java,v
  retrieving revision 1.21
  retrieving revision 1.22
  diff -u -r1.21 -r1.22
  --- XslAttribute.java	25 Mar 2003 16:13:11 -0000	1.21
  +++ XslAttribute.java	25 Jun 2003 14:40:35 -0000	1.22
  @@ -79,6 +79,9 @@
   import org.apache.xalan.xsltc.compiler.util.TypeCheckError;
   import org.apache.xalan.xsltc.compiler.util.Util;
   
  +import org.apache.xml.serializer.ElemDesc;
  +import org.apache.xml.serializer.SerializationHandler;
  +
   final class XslAttribute extends Instruction {
   
       private String _prefix;
  @@ -256,9 +259,31 @@
   							 "()" + STRING_SIG)));
   	}
   
  -	// call "attribute"
  -	il.append(methodGen.attribute());
  +	SyntaxTreeNode parent = getParent();
  +	if (parent instanceof LiteralElement
  +	    && ((LiteralElement)parent).allAttributesUnique()) {
  +            int flags = 0;
  +	    ElemDesc elemDesc = ((LiteralElement)parent).getElemDesc();
  +	    
  +	    // Set the HTML flags
  +	    if (elemDesc != null && _name instanceof SimpleAttributeValue) {
  +	    	String attrName = ((SimpleAttributeValue)_name).toString();
  +	    	if (elemDesc.isAttrFlagSet(attrName, ElemDesc.ATTREMPTY)) {
  +	    	    flags = flags | SerializationHandler.HTML_ATTREMPTY;
  +	    	}
  +	    	else if (elemDesc.isAttrFlagSet(attrName, ElemDesc.ATTRURL)) {
  +	    	    flags = flags | SerializationHandler.HTML_ATTRURL;
  +	    	}
  +	    }
  +	    il.append(new PUSH(cpg, flags));
  +	    il.append(methodGen.uniqueAttribute());    
  +	}
  +	else {
  +	    // call "attribute"
  +	    il.append(methodGen.attribute());
  +	}
   	// Restore old handler base from stack
   	il.append(methodGen.storeHandler());
       }
  +
   }
  
  
  
  1.13      +15 -1     xml-xalan/java/src/org/apache/xalan/xsltc/compiler/util/MethodGenerator.java
  
  Index: MethodGenerator.java
  ===================================================================
  RCS file: /home/cvs/xml-xalan/java/src/org/apache/xalan/xsltc/compiler/util/MethodGenerator.java,v
  retrieving revision 1.12
  retrieving revision 1.13
  diff -u -r1.12 -r1.13
  --- MethodGenerator.java	1 Apr 2003 21:12:39 -0000	1.12
  +++ MethodGenerator.java	25 Jun 2003 14:40:36 -0000	1.13
  @@ -106,6 +106,7 @@
       private final Instruction _startDocument;
       private final Instruction _endDocument;
       private final Instruction _attribute;
  +    private final Instruction _uniqueAttribute;
       private final Instruction _namespace;
   
       private final Instruction _setStartNode;
  @@ -151,6 +152,15 @@
   				      + ")V");
   	_attribute = new INVOKEINTERFACE(attribute, 3);
   
  +	final int uniqueAttribute =
  +	    cpg.addInterfaceMethodref(TRANSLET_OUTPUT_INTERFACE,
  +				      "addUniqueAttribute", 
  +				      "("
  +				      + STRING_SIG
  +				      + STRING_SIG
  +				      + "I)V");
  +	_uniqueAttribute = new INVOKEINTERFACE(uniqueAttribute, 4);
  +
   	final int namespace =
   	    cpg.addInterfaceMethodref(TRANSLET_OUTPUT_INTERFACE,
   				      "namespaceAfterStartElement", 
  @@ -276,6 +286,10 @@
   
       public final Instruction attribute() {
   	return _attribute;
  +    }
  +
  +    public final Instruction uniqueAttribute() {
  +    	return _uniqueAttribute;
       }
   
       public final Instruction namespace() {
  
  
  
  1.2       +29 -29    xml-xalan/java/src/org/apache/xml/serializer/ElemDesc.java
  
  Index: ElemDesc.java
  ===================================================================
  RCS file: /home/cvs/xml-xalan/java/src/org/apache/xml/serializer/ElemDesc.java,v
  retrieving revision 1.1
  retrieving revision 1.2
  diff -u -r1.1 -r1.2
  --- ElemDesc.java	1 Apr 2003 19:24:54 -0000	1.1
  +++ ElemDesc.java	25 Jun 2003 14:40:36 -0000	1.2
  @@ -61,7 +61,7 @@
   /**
    * This class has a series of flags (bit values) that describe an HTML element
    */
  -class ElemDesc
  +public class ElemDesc
   {
       /** Bit flags to tell about this element type. */
       int m_flags;
  @@ -73,76 +73,76 @@
       StringToIntTable m_attrs = null;
   
       /** Bit position if this element type is empty. */
  -    static final int EMPTY = (1 << 1);
  +    public static final int EMPTY = (1 << 1);
   
       /** Bit position if this element type is a flow. */
  -    static final int FLOW = (1 << 2);
  +    public static final int FLOW = (1 << 2);
   
       /** Bit position if this element type is a block. */
  -    static final int BLOCK = (1 << 3);
  +    public static final int BLOCK = (1 << 3);
   
       /** Bit position if this element type is a block form. */
  -    static final int BLOCKFORM = (1 << 4);
  +    public static final int BLOCKFORM = (1 << 4);
   
       /** Bit position if this element type is a block form field set (?? -sb). */
  -    static final int BLOCKFORMFIELDSET = (1 << 5);
  +    public static final int BLOCKFORMFIELDSET = (1 << 5);
   
       /** Bit position if this element type is CDATA. */
  -    static final int CDATA = (1 << 6);
  +    public static final int CDATA = (1 << 6);
   
       /** Bit position if this element type is PCDATA. */
  -    static final int PCDATA = (1 << 7);
  +    public static final int PCDATA = (1 << 7);
   
       /** Bit position if this element type is should be raw characters. */
  -    static final int RAW = (1 << 8);
  +    public static final int RAW = (1 << 8);
   
       /** Bit position if this element type should be inlined. */
  -    static final int INLINE = (1 << 9);
  +    public static final int INLINE = (1 << 9);
   
       /** Bit position if this element type is INLINEA (?? -sb). */
  -    static final int INLINEA = (1 << 10);
  +    public static final int INLINEA = (1 << 10);
   
       /** Bit position if this element type is an inline label. */
  -    static final int INLINELABEL = (1 << 11);
  +    public static final int INLINELABEL = (1 << 11);
   
       /** Bit position if this element type is a font style. */
  -    static final int FONTSTYLE = (1 << 12);
  +    public static final int FONTSTYLE = (1 << 12);
   
       /** Bit position if this element type is a phrase. */
  -    static final int PHRASE = (1 << 13);
  +    public static final int PHRASE = (1 << 13);
   
       /** Bit position if this element type is a form control. */
  -    static final int FORMCTRL = (1 << 14);
  +    public static final int FORMCTRL = (1 << 14);
   
       /** Bit position if this element type is ???. */
  -    static final int SPECIAL = (1 << 15);
  +    public static final int SPECIAL = (1 << 15);
   
       /** Bit position if this element type is ???. */
  -    static final int ASPECIAL = (1 << 16);
  +    public static final int ASPECIAL = (1 << 16);
   
       /** Bit position if this element type is an odd header element. */
  -    static final int HEADMISC = (1 << 17);
  +    public static final int HEADMISC = (1 << 17);
   
       /** Bit position if this element type is a head element (i.e. H1, H2, etc.) */
  -    static final int HEAD = (1 << 18);
  +    public static final int HEAD = (1 << 18);
   
       /** Bit position if this element type is a list. */
  -    static final int LIST = (1 << 19);
  +    public static final int LIST = (1 << 19);
   
       /** Bit position if this element type is a preformatted type. */
  -    static final int PREFORMATTED = (1 << 20);
  +    public static final int PREFORMATTED = (1 << 20);
   
       /** Bit position if this element type is whitespace sensitive. */
  -    static final int WHITESPACESENSITIVE = (1 << 21);
  +    public static final int WHITESPACESENSITIVE = (1 << 21);
   
       /** Bit position if this element type is a header element (i.e. HEAD). */
  -    static final int HEADELEM = (1 << 22);
  +    public static final int HEADELEM = (1 << 22);
   
       /** Bit position if this attribute type is a URL. */
  -    static final int ATTRURL = (1 << 1);
  +    public static final int ATTRURL = (1 << 1);
   
       /** Bit position if this attribute type is an empty type. */
  -    static final int ATTREMPTY = (1 << 2);
  +    public static final int ATTREMPTY = (1 << 2);
   
       /**
        * Construct an ElemDesc from a set of bit flags.
  @@ -150,7 +150,7 @@
        *
        * @param flags Bit flags that describe the basic properties of this element type.
        */
  -    ElemDesc(int flags)
  +    public ElemDesc(int flags)
       {
           m_flags = flags;
       }
  @@ -163,7 +163,7 @@
        *
        * @return true if any of the flag bits are true.
        */
  -    boolean is(int flags)
  +    public boolean is(int flags)
       {
   
           // int which = (m_flags & flags);
  @@ -177,7 +177,7 @@
        * @param name non-null name of attribute, in upper case.
        * @param flags flag bits.
        */
  -    void setAttr(String name, int flags)
  +    public void setAttr(String name, int flags)
       {
   
           if (null == m_attrs)
  @@ -194,7 +194,7 @@
        *
        * @return true if any of the flags are set for the named attribute.
        */
  -    boolean isAttrFlagSet(String name, int flags)
  +    public boolean isAttrFlagSet(String name, int flags)
       {
           return (null != m_attrs)
               ? ((m_attrs.getIgnoreCase(name) & flags) != 0)
  
  
  

---------------------------------------------------------------------
To unsubscribe, e-mail: xalan-cvs-unsubscribe@xml.apache.org
For additional commands, e-mail: xalan-cvs-help@xml.apache.org


Mime
View raw message