Source Code Cross Referenced for AttributesHolder.java in  » 6.0-JDK-Modules » jaxb-xjc » com » sun » xml » xsom » impl » 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 » com.sun.xml.xsom.impl 
Source Cross Referenced  Class Diagram Java Document (Java Doc) 


001:        /*
002:         * The contents of this file are subject to the terms
003:         * of the Common Development and Distribution License
004:         * (the "License").  You may not use this file except
005:         * in compliance with the License.
006:         * 
007:         * You can obtain a copy of the license at
008:         * https://jwsdp.dev.java.net/CDDLv1.0.html
009:         * See the License for the specific language governing
010:         * permissions and limitations under the License.
011:         * 
012:         * When distributing Covered Code, include this CDDL
013:         * HEADER in each file and include the License file at
014:         * https://jwsdp.dev.java.net/CDDLv1.0.html  If applicable,
015:         * add the following below this CDDL HEADER, with the
016:         * fields enclosed by brackets "[]" replaced with your
017:         * own identifying information: Portions Copyright [yyyy]
018:         * [name of copyright owner]
019:         */
020:        package com.sun.xml.xsom.impl;
021:
022:        import com.sun.xml.xsom.XSAttGroupDecl;
023:        import com.sun.xml.xsom.XSAttributeUse;
024:        import com.sun.xml.xsom.impl.parser.SchemaDocumentImpl;
025:        import com.sun.xml.xsom.impl.scd.Iterators;
026:        import com.sun.xml.xsom.impl.Ref.AttGroup;
027:        import org.xml.sax.Locator;
028:
029:        import java.util.AbstractSet;
030:        import java.util.ArrayList;
031:        import java.util.Collection;
032:        import java.util.HashSet;
033:        import java.util.Iterator;
034:        import java.util.List;
035:        import java.util.Map;
036:        import java.util.Set;
037:        import java.util.TreeMap;
038:        import java.util.LinkedHashMap;
039:
040:        public abstract class AttributesHolder extends DeclarationImpl {
041:
042:            protected AttributesHolder(SchemaDocumentImpl _parent,
043:                    AnnotationImpl _annon, Locator loc,
044:                    ForeignAttributesImpl _fa, String _name, boolean _anonymous) {
045:
046:                super (_parent, _annon, loc, _fa, _parent.getTargetNamespace(),
047:                        _name, _anonymous);
048:            }
049:
050:            /** set the local wildcard. */
051:            public abstract void setWildcard(WildcardImpl wc);
052:
053:            /**
054:             * Local attribute use.
055:             * Use linked hash map to guarantee the iteration order, and make it close to
056:             * what was in the schema document.
057:             */
058:            protected final Map<UName, AttributeUseImpl> attributes = new LinkedHashMap<UName, AttributeUseImpl>();
059:
060:            public void addAttributeUse(UName name, AttributeUseImpl a) {
061:                attributes.put(name, a);
062:            }
063:
064:            /** prohibited attributes. */
065:            protected final Set<UName> prohibitedAtts = new HashSet<UName>();
066:
067:            public void addProhibitedAttribute(UName name) {
068:                prohibitedAtts.add(name);
069:            }
070:
071:            public List<XSAttributeUse> getAttributeUses() {
072:                // TODO: this is fairly inefficient
073:                List<XSAttributeUse> v = new ArrayList<XSAttributeUse>();
074:                v.addAll(attributes.values());
075:                for (XSAttGroupDecl agd : getAttGroups())
076:                    v.addAll(agd.getAttributeUses());
077:                return v;
078:            }
079:
080:            public Iterator<XSAttributeUse> iterateAttributeUses() {
081:                return getAttributeUses().iterator();
082:            }
083:
084:            public XSAttributeUse getDeclaredAttributeUse(String nsURI,
085:                    String localName) {
086:                return attributes.get(new UName(nsURI, localName));
087:            }
088:
089:            public Iterator<AttributeUseImpl> iterateDeclaredAttributeUses() {
090:                return attributes.values().iterator();
091:            }
092:
093:            public Collection<AttributeUseImpl> getDeclaredAttributeUses() {
094:                return attributes.values();
095:            }
096:
097:            /** {@link Ref.AttGroup}s that are directly refered from this. */
098:            protected final Set<Ref.AttGroup> attGroups = new HashSet<Ref.AttGroup>();
099:
100:            public void addAttGroup(Ref.AttGroup a) {
101:                attGroups.add(a);
102:            }
103:
104:            // Iterates all AttGroups which are directly referenced from this component
105:            // this does not iterate att groups referenced from the base type
106:            public Iterator<XSAttGroupDecl> iterateAttGroups() {
107:                return new Iterators.Adapter<XSAttGroupDecl, Ref.AttGroup>(
108:                        attGroups.iterator()) {
109:                    protected XSAttGroupDecl filter(AttGroup u) {
110:                        return u.get();
111:                    }
112:                };
113:            }
114:
115:            public Set<XSAttGroupDecl> getAttGroups() {
116:                return new AbstractSet<XSAttGroupDecl>() {
117:                    public Iterator<XSAttGroupDecl> iterator() {
118:                        return iterateAttGroups();
119:                    }
120:
121:                    public int size() {
122:                        return attGroups.size();
123:                    }
124:                };
125:            }
126:        }
www.java2java.com | Contact Us
Copyright 2009 - 12 Demo Source and Support. All rights reserved.
All other trademarks are property of their respective owners.