Source Code Cross Referenced for DAnnotation.java in  » 6.0-JDK-Modules » jaxb-xjc » org » kohsuke » rngom » digested » 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 » 6.0 JDK Modules » jaxb xjc » org.kohsuke.rngom.digested 
Source Cross Referenced  Class Diagram Java Document (Java Doc) 


001:        package org.kohsuke.rngom.digested;
002:
003:        import org.xml.sax.Locator;
004:        import org.w3c.dom.Element;
005:
006:        import javax.xml.namespace.QName;
007:        import java.util.Map;
008:        import java.util.HashMap;
009:        import java.util.List;
010:        import java.util.ArrayList;
011:        import java.util.Collections;
012:
013:        /**
014:         * Annotation.
015:         *
016:         * @author Kohsuke Kawaguchi (kk@kohsuke.org)
017:         */
018:        public class DAnnotation {
019:
020:            /**
021:             * Instance reserved to be empty.
022:             */
023:            static final DAnnotation EMPTY = new DAnnotation();
024:
025:            /**
026:             * Keyed by QName.
027:             */
028:            final Map<QName, Attribute> attributes = new HashMap<QName, Attribute>();
029:
030:            /**
031:             * List of nested elements.
032:             */
033:            final List<Element> contents = new ArrayList<Element>();
034:
035:            /**
036:             * Attribute.
037:             */
038:            public static class Attribute {
039:                private final String ns;
040:                private final String localName;
041:                private final String prefix;
042:
043:                private String value;
044:                private Locator loc;
045:
046:                public Attribute(String ns, String localName, String prefix) {
047:                    this .ns = ns;
048:                    this .localName = localName;
049:                    this .prefix = prefix;
050:                }
051:
052:                public Attribute(String ns, String localName, String prefix,
053:                        String value, Locator loc) {
054:                    this .ns = ns;
055:                    this .localName = localName;
056:                    this .prefix = prefix;
057:                    this .value = value;
058:                    this .loc = loc;
059:                }
060:
061:                /**
062:                 * Gets the namespace URI of this attribute.
063:                 *
064:                 * @return
065:                 *      can be empty (to represent the default namespace), but never null.
066:                 */
067:                public String getNs() {
068:                    return ns;
069:                }
070:
071:                /**
072:                 * Gets the local name of this attribute.
073:                 *
074:                 * @return
075:                 *      always non-null.
076:                 */
077:                public String getLocalName() {
078:                    return localName;
079:                }
080:
081:                /**
082:                 * Gets the prefix of thie attribute.
083:                 *
084:                 * @return
085:                 *      null if this attribute didn't have a prefix.
086:                 */
087:                public String getPrefix() {
088:                    return prefix;
089:                }
090:
091:                /**
092:                 * Gets the attribute value.
093:                 *
094:                 * @return
095:                 *      never null.
096:                 */
097:                public String getValue() {
098:                    return value;
099:                }
100:
101:                /**
102:                 * Gets the location in the source schema file where this annotation was present.
103:                 *
104:                 * @return
105:                 *      never null.
106:                 */
107:                public Locator getLoc() {
108:                    return loc;
109:                }
110:            }
111:
112:            /**
113:             * Gets the attribute of a given name.
114:             *
115:             * @param nsUri
116:             *      can be empty but must not be null.
117:             * @return
118:             *      null if no such attribute is found.
119:             */
120:            public Attribute getAttribute(String nsUri, String localName) {
121:                return getAttribute(new QName(nsUri, localName));
122:            }
123:
124:            public Attribute getAttribute(QName n) {
125:                return attributes.get(n);
126:            }
127:
128:            /**
129:             * Gets the read-only view of all the attributes.
130:             *
131:             * @return
132:             *      can be empty but never null.
133:             *      the returned map is read-only.
134:             */
135:            public Map<QName, Attribute> getAttributes() {
136:                return Collections.unmodifiableMap(attributes);
137:            }
138:
139:            /**
140:             * Gets the read-only view of all the child elements of this annotation.
141:             *
142:             * @return
143:             *      can be empty but never null.
144:             *      the returned list is read-only.
145:             */
146:            public List<Element> getChildren() {
147:                return Collections.unmodifiableList(contents);
148:            }
149:        }
www.java2java.com | Contact Us
Copyright 2009 - 12 Demo Source and Support. All rights reserved.
All other trademarks are property of their respective owners.