Source Code Cross Referenced for ElemDesc.java in  » XML » xalan » org » apache » xml » utils » Java Source Code / Java DocumentationJava Source Code and Java Documentation

Java Source Code / Java Documentation
1. 6.0 JDK Core
2. 6.0 JDK Modules
3. 6.0 JDK Modules com.sun
4. 6.0 JDK Modules com.sun.java
5. 6.0 JDK Modules sun
6. 6.0 JDK Platform
7. Ajax
8. Apache Harmony Java SE
9. Aspect oriented
10. Authentication Authorization
11. Blogger System
12. Build
13. Byte Code
14. Cache
15. Chart
16. Chat
17. Code Analyzer
18. Collaboration
19. Content Management System
20. Database Client
21. Database DBMS
22. Database JDBC Connection Pool
23. Database ORM
24. Development
25. EJB Server geronimo
26. EJB Server GlassFish
27. EJB Server JBoss 4.2.1
28. EJB Server resin 3.1.5
29. ERP CRM Financial
30. ESB
31. Forum
32. GIS
33. Graphic Library
34. Groupware
35. HTML Parser
36. IDE
37. IDE Eclipse
38. IDE Netbeans
39. Installer
40. Internationalization Localization
41. Inversion of Control
42. Issue Tracking
43. J2EE
44. JBoss
45. JMS
46. JMX
47. Library
48. Mail Clients
49. Net
50. Parser
51. PDF
52. Portal
53. Profiler
54. Project Management
55. Report
56. RSS RDF
57. Rule Engine
58. Science
59. Scripting
60. Search Engine
61. Security
62. Sevlet Container
63. Source Control
64. Swing Library
65. Template Engine
66. Test Coverage
67. Testing
68. UML
69. Web Crawler
70. Web Framework
71. Web Mail
72. Web Server
73. Web Services
74. Web Services apache cxf 2.0.1
75. Web Services AXIS2
76. Wiki Engine
77. Workflow Engines
78. XML
79. XML UI
Java
Java Tutorial
Java Open Source
Jar File Download
Java Articles
Java Products
Java by API
Photoshop Tutorials
Maya Tutorials
Flash Tutorials
3ds-Max Tutorials
Illustrator Tutorials
GIMP Tutorials
C# / C Sharp
C# / CSharp Tutorial
C# / CSharp Open Source
ASP.Net
ASP.NET Tutorial
JavaScript DHTML
JavaScript Tutorial
JavaScript Reference
HTML / CSS
HTML CSS Reference
C / ANSI-C
C Tutorial
C++
C++ Tutorial
Ruby
PHP
Python
Python Tutorial
Python Open Source
SQL Server / T-SQL
SQL Server / T-SQL Tutorial
Oracle PL / SQL
Oracle PL/SQL Tutorial
PostgreSQL
SQL / MySQL
MySQL Tutorial
VB.Net
VB.Net Tutorial
Flash / Flex / ActionScript
VBA / Excel / Access / Word
XML
XML Tutorial
Microsoft Office PowerPoint 2007 Tutorial
Microsoft Office Excel 2007 Tutorial
Microsoft Office Word 2007 Tutorial
Java Source Code / Java Documentation » XML » xalan » org.apache.xml.utils 
Source Cross Referenced  Class Diagram Java Document (Java Doc) 


001:        /*
002:         * Copyright 1999-2004 The Apache Software Foundation.
003:         *
004:         * Licensed under the Apache License, Version 2.0 (the "License");
005:         * you may not use this file except in compliance with the License.
006:         * You may obtain a copy of the License at
007:         *
008:         *     http://www.apache.org/licenses/LICENSE-2.0
009:         *
010:         * Unless required by applicable law or agreed to in writing, software
011:         * distributed under the License is distributed on an "AS IS" BASIS,
012:         * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
013:         * See the License for the specific language governing permissions and
014:         * limitations under the License.
015:         */
016:        /*
017:         * $Id: ElemDesc.java,v 1.7 2004/02/17 04:21:14 minchau Exp $
018:         */
019:        package org.apache.xml.utils;
020:
021:        import java.util.Hashtable;
022:
023:        /**
024:         * This class is in support of SerializerToHTML, and acts as a sort
025:         * of element representative for HTML elements.
026:         * @xsl.usage internal
027:         */
028:        class ElemDesc {
029:
030:            /** Table of attributes for the element */
031:            Hashtable m_attrs = null;
032:
033:            /** Element's flags, describing the role this element plays during
034:             * formatting of the document. This is used as a bitvector; more than one flag
035:             * may be set at a time, bitwise-ORed together. Mnemonic and bits
036:             * have been assigned to the flag values. NOTE: Some bits are
037:             * currently assigned multiple mnemonics; it is the caller's
038:             * responsibility to disambiguate these if necessary. */
039:            int m_flags;
040:
041:            /** Defines mnemonic and bit-value for the EMPTY flag */
042:            static final int EMPTY = (1 << 1);
043:
044:            /** Defines mnemonic and bit-value for the FLOW flag  */
045:            static final int FLOW = (1 << 2);
046:
047:            /** Defines mnemonic and bit-value for the BLOCK flag          */
048:            static final int BLOCK = (1 << 3);
049:
050:            /** Defines mnemonic and bit-value for the BLOCKFORM  flag         */
051:            static final int BLOCKFORM = (1 << 4);
052:
053:            /** Defines mnemonic and bit-value for the BLOCKFORMFIELDSET flag          */
054:            static final int BLOCKFORMFIELDSET = (1 << 5);
055:
056:            /** Defines mnemonic and bit-value for the CDATA flag         */
057:            static final int CDATA = (1 << 6);
058:
059:            /** Defines mnemonic and bit-value for the PCDATA flag          */
060:            static final int PCDATA = (1 << 7);
061:
062:            /** Defines mnemonic and bit-value for the RAW flag         */
063:            static final int RAW = (1 << 8);
064:
065:            /** Defines mnemonic and bit-value for the INLINE flag          */
066:            static final int INLINE = (1 << 9);
067:
068:            /** Defines mnemonic and bit-value for the INLINEA flag          */
069:            static final int INLINEA = (1 << 10);
070:
071:            /** Defines mnemonic and bit-value for the INLINELABEL flag          */
072:            static final int INLINELABEL = (1 << 11);
073:
074:            /** Defines mnemonic and bit-value for the FONTSTYLE flag          */
075:            static final int FONTSTYLE = (1 << 12);
076:
077:            /** Defines mnemonic and bit-value for the PHRASE flag          */
078:            static final int PHRASE = (1 << 13);
079:
080:            /** Defines mnemonic and bit-value for the FORMCTRL flag         */
081:            static final int FORMCTRL = (1 << 14);
082:
083:            /** Defines mnemonic and bit-value for the SPECIAL flag         */
084:            static final int SPECIAL = (1 << 15);
085:
086:            /** Defines mnemonic and bit-value for the ASPECIAL flag         */
087:            static final int ASPECIAL = (1 << 16);
088:
089:            /** Defines mnemonic and bit-value for the HEADMISC flag         */
090:            static final int HEADMISC = (1 << 17);
091:
092:            /** Defines mnemonic and bit-value for the HEAD flag         */
093:            static final int HEAD = (1 << 18);
094:
095:            /** Defines mnemonic and bit-value for the LIST flag         */
096:            static final int LIST = (1 << 19);
097:
098:            /** Defines mnemonic and bit-value for the PREFORMATTED flag         */
099:            static final int PREFORMATTED = (1 << 20);
100:
101:            /** Defines mnemonic and bit-value for the WHITESPACESENSITIVE flag         */
102:            static final int WHITESPACESENSITIVE = (1 << 21);
103:
104:            /** Defines mnemonic and bit-value for the ATTRURL flag         */
105:            static final int ATTRURL = (1 << 1);
106:
107:            /** Defines mnemonic and bit-value for the ATTREMPTY flag         */
108:            static final int ATTREMPTY = (1 << 2);
109:
110:            /**
111:             * Construct an ElementDescription with an initial set of flags.
112:             *
113:             * @param flags Element flags
114:             * @see m_flags
115:             */
116:            ElemDesc(int flags) {
117:                m_flags = flags;
118:            }
119:
120:            /**
121:             * "is (this element described by these flags)".
122:             * 
123:             * This might more properly be called areFlagsSet(). It accepts an
124:             * integer (being used as a bitvector) and checks whether all the 
125:             * corresponding bits are set in our internal flags. Note that this
126:             * test is performed as a bitwise AND, not an equality test, so a
127:             * 0 bit in the input means "don't test", not "must be set false".
128:             *
129:             * @param flags Vector of flags to compare against this element's flags
130:             *
131:             * @return true if the flags set in the parameter are also set in the
132:             * element's stored flags.
133:             * 
134:             * @see m_flags
135:             * @see isAttrFlagSet
136:             */
137:            boolean is(int flags) {
138:                // int which = (m_flags & flags);
139:                return (m_flags & flags) != 0;
140:            }
141:
142:            /**
143:             * Set a new attribute for this element 
144:             *
145:             *
146:             * @param name Attribute name
147:             * @param flags Attibute flags
148:             */
149:            void setAttr(String name, int flags) {
150:
151:                if (null == m_attrs)
152:                    m_attrs = new Hashtable();
153:
154:                m_attrs.put(name, new Integer(flags));
155:            }
156:
157:            /**
158:             * Find out if a flag is set in a given attribute of this element 
159:             *
160:             *
161:             * @param name Attribute name
162:             * @param flags Flag to check
163:             *
164:             * @return True if the flag is set in the attribute. Returns false
165:             * if the attribute is not found 
166:             * @see m_flags
167:             */
168:            boolean isAttrFlagSet(String name, int flags) {
169:
170:                if (null != m_attrs) {
171:                    Integer _flags = (Integer) m_attrs.get(name);
172:
173:                    if (null != _flags) {
174:                        return (_flags.intValue() & flags) != 0;
175:                    }
176:                }
177:
178:                return false;
179:            }
180:        }
www.java2java.com | Contact Us
Copyright 2009 - 12 Demo Source and Support. All rights reserved.
All other trademarks are property of their respective owners.