Source Code Cross Referenced for AttributeList.java in  » Web-Server » Rimfaxe-Web-Server » org » xml » sax » 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 » Web Server » Rimfaxe Web Server » org.xml.sax 
Source Cross Referenced  Class Diagram Java Document (Java Doc) 


001:        // SAX Attribute List Interface.
002:        // http://www.saxproject.org
003:        // No warranty; no copyright -- use this as you will.
004:        // $Id: AttributeList.java,v 1.6 2002/02/01 20:06:19 db Exp $
005:
006:        package org.xml.sax;
007:
008:        /**
009:         * Interface for an element's attribute specifications.
010:         *
011:         * <blockquote>
012:         * <em>This module, both source code and documentation, is in the
013:         * Public Domain, and comes with <strong>NO WARRANTY</strong>.</em>
014:         * See <a href='http://www.saxproject.org'>http://www.saxproject.org</a>
015:         * for further information.
016:         * </blockquote>
017:         *
018:         * <p>This is the original SAX1 interface for reporting an element's
019:         * attributes.  Unlike the new {@link org.xml.sax.Attributes Attributes}
020:         * interface, it does not support Namespace-related information.</p>
021:         *
022:         * <p>When an attribute list is supplied as part of a
023:         * {@link org.xml.sax.DocumentHandler#startElement startElement}
024:         * event, the list will return valid results only during the
025:         * scope of the event; once the event handler returns control
026:         * to the parser, the attribute list is invalid.  To save a
027:         * persistent copy of the attribute list, use the SAX1
028:         * {@link org.xml.sax.helpers.AttributeListImpl AttributeListImpl}
029:         * helper class.</p>
030:         *
031:         * <p>An attribute list includes only attributes that have been
032:         * specified or defaulted: #IMPLIED attributes will not be included.</p>
033:         *
034:         * <p>There are two ways for the SAX application to obtain information
035:         * from the AttributeList.  First, it can iterate through the entire
036:         * list:</p>
037:         *
038:         * <pre>
039:         * public void startElement (String name, AttributeList atts) {
040:         *   for (int i = 0; i < atts.getLength(); i++) {
041:         *     String name = atts.getName(i);
042:         *     String type = atts.getType(i);
043:         *     String value = atts.getValue(i);
044:         *     [...]
045:         *   }
046:         * }
047:         * </pre>
048:         *
049:         * <p>(Note that the result of getLength() will be zero if there
050:         * are no attributes.)
051:         *
052:         * <p>As an alternative, the application can request the value or
053:         * type of specific attributes:</p>
054:         *
055:         * <pre>
056:         * public void startElement (String name, AttributeList atts) {
057:         *   String identifier = atts.getValue("id");
058:         *   String label = atts.getValue("label");
059:         *   [...]
060:         * }
061:         * </pre>
062:         *
063:         * @deprecated This interface has been replaced by the SAX2
064:         *             {@link org.xml.sax.Attributes Attributes}
065:         *             interface, which includes Namespace support.
066:         * @since SAX 1.0
067:         * @author David Megginson
068:         * @version 2.0.1 (sax2r2)
069:         * @see org.xml.sax.DocumentHandler#startElement startElement
070:         * @see org.xml.sax.helpers.AttributeListImpl AttributeListImpl
071:         */
072:        public interface AttributeList {
073:
074:            ////////////////////////////////////////////////////////////////////
075:            // Iteration methods.
076:            ////////////////////////////////////////////////////////////////////
077:
078:            /**
079:             * Return the number of attributes in this list.
080:             *
081:             * <p>The SAX parser may provide attributes in any
082:             * arbitrary order, regardless of the order in which they were
083:             * declared or specified.  The number of attributes may be
084:             * zero.</p>
085:             *
086:             * @return The number of attributes in the list.  
087:             */
088:            public abstract int getLength();
089:
090:            /**
091:             * Return the name of an attribute in this list (by position).
092:             *
093:             * <p>The names must be unique: the SAX parser shall not include the
094:             * same attribute twice.  Attributes without values (those declared
095:             * #IMPLIED without a value specified in the start tag) will be
096:             * omitted from the list.</p>
097:             *
098:             * <p>If the attribute name has a namespace prefix, the prefix
099:             * will still be attached.</p>
100:             *
101:             * @param i The index of the attribute in the list (starting at 0).
102:             * @return The name of the indexed attribute, or null
103:             *         if the index is out of range.
104:             * @see #getLength 
105:             */
106:            public abstract String getName(int i);
107:
108:            /**
109:             * Return the type of an attribute in the list (by position).
110:             *
111:             * <p>The attribute type is one of the strings "CDATA", "ID",
112:             * "IDREF", "IDREFS", "NMTOKEN", "NMTOKENS", "ENTITY", "ENTITIES",
113:             * or "NOTATION" (always in upper case).</p>
114:             *
115:             * <p>If the parser has not read a declaration for the attribute,
116:             * or if the parser does not report attribute types, then it must
117:             * return the value "CDATA" as stated in the XML 1.0 Recommentation
118:             * (clause 3.3.3, "Attribute-Value Normalization").</p>
119:             *
120:             * <p>For an enumerated attribute that is not a notation, the
121:             * parser will report the type as "NMTOKEN".</p>
122:             *
123:             * @param i The index of the attribute in the list (starting at 0).
124:             * @return The attribute type as a string, or
125:             *         null if the index is out of range.
126:             * @see #getLength 
127:             * @see #getType(java.lang.String)
128:             */
129:            public abstract String getType(int i);
130:
131:            /**
132:             * Return the value of an attribute in the list (by position).
133:             *
134:             * <p>If the attribute value is a list of tokens (IDREFS,
135:             * ENTITIES, or NMTOKENS), the tokens will be concatenated
136:             * into a single string separated by whitespace.</p>
137:             *
138:             * @param i The index of the attribute in the list (starting at 0).
139:             * @return The attribute value as a string, or
140:             *         null if the index is out of range.
141:             * @see #getLength
142:             * @see #getValue(java.lang.String)
143:             */
144:            public abstract String getValue(int i);
145:
146:            ////////////////////////////////////////////////////////////////////
147:            // Lookup methods.
148:            ////////////////////////////////////////////////////////////////////
149:
150:            /**
151:             * Return the type of an attribute in the list (by name).
152:             *
153:             * <p>The return value is the same as the return value for
154:             * getType(int).</p>
155:             *
156:             * <p>If the attribute name has a namespace prefix in the document,
157:             * the application must include the prefix here.</p>
158:             *
159:             * @param name The name of the attribute.
160:             * @return The attribute type as a string, or null if no
161:             *         such attribute exists.
162:             * @see #getType(int)
163:             */
164:            public abstract String getType(String name);
165:
166:            /**
167:             * Return the value of an attribute in the list (by name).
168:             *
169:             * <p>The return value is the same as the return value for
170:             * getValue(int).</p>
171:             *
172:             * <p>If the attribute name has a namespace prefix in the document,
173:             * the application must include the prefix here.</p>
174:             *
175:             * @param i The index of the attribute in the list.
176:             * @return The attribute value as a string, or null if
177:             *         no such attribute exists.
178:             * @see #getValue(int)
179:             */
180:            public abstract String getValue(String name);
181:
182:        }
183:
184:        // end of AttributeList.java
www.java2java.com | Contact Us
Copyright 2009 - 12 Demo Source and Support. All rights reserved.
All other trademarks are property of their respective owners.