Source Code Cross Referenced for DataSectionElementSpec.java in  » Web-Services » xins » org » xins » common » spec » 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 Services » xins » org.xins.common.spec 
Source Cross Referenced  Class Diagram Java Document (Java Doc) 


001:        /*
002:         * $Id: DataSectionElementSpec.java,v 1.16 2007/09/18 11:20:47 agoubard Exp $
003:         *
004:         * Copyright 2003-2007 Orange Nederland Breedband B.V.
005:         * See the COPYRIGHT file for redistribution and use restrictions.
006:         */
007:        package org.xins.common.spec;
008:
009:        import java.util.List;
010:        import java.util.Map;
011:
012:        import org.xins.common.MandatoryArgumentChecker;
013:
014:        /**
015:         * Specification of a data section element.
016:         *
017:         * @version $Revision: 1.16 $ $Date: 2007/09/18 11:20:47 $
018:         * @author <a href="mailto:anthony.goubard@japplis.com">Anthony Goubard</a>
019:         *
020:         * @since XINS 1.3.0
021:         */
022:        public final class DataSectionElementSpec {
023:
024:            /**
025:             * Name of the element, cannot be <code>null</code>.
026:             */
027:            private final String _name;
028:
029:            /**
030:             * Description of the element, cannot be <code>null</code>.
031:             */
032:            private final String _description;
033:
034:            /**
035:             * Flag indicating that the element can have PCDATA.
036:             */
037:            private final boolean _isPCDataAllowed;
038:
039:            /**
040:             * The sub elements of the element, cannot be <code>null</code>.
041:             */
042:            private final Map _subElements;
043:
044:            /**
045:             * The attributes of the element, cannot be <code>null</code>.
046:             */
047:            private final Map _attributes;
048:
049:            /**
050:             * The attribute combos of the element, cannot be <code>null</code>.
051:             */
052:            private final List _attributeCombos;
053:
054:            /**
055:             * Creates a new instance of <code>DataSectionElementSpec</code>.
056:             *
057:             * @param name
058:             *    the name of the data section element, cannot be <code>null</code>.
059:             *
060:             * @param description
061:             *    the description of the data section element, cannot be <code>null</code>.
062:             *
063:             * @param isPCDataAllowed
064:             *    <code>true</code> if the element can contain text, <code>false</code> otherwise.
065:             *
066:             * @param subElements
067:             *    the sub elements that can contain this element, cannot be <code>null</code>.
068:             *
069:             * @param attributes
070:             *    the possible attributes for this element, cannot be <code>null</code>.
071:             *
072:             * @param attributeCombos
073:             *    the attribute combos for this element, cannot be <code>null</code>.
074:             */
075:            DataSectionElementSpec(String name, String description,
076:                    boolean isPCDataAllowed, Map subElements, Map attributes,
077:                    List attributeCombos) {
078:                _name = name;
079:                _description = description;
080:                _isPCDataAllowed = isPCDataAllowed;
081:                _attributes = attributes;
082:                _subElements = subElements;
083:                _attributeCombos = attributeCombos;
084:            }
085:
086:            /**
087:             * Gets the name of the data element.
088:             *
089:             * @return
090:             *    The name of the data element, never <code>null</code>.
091:             */
092:            public String getName() {
093:
094:                return _name;
095:            }
096:
097:            /**
098:             * Gets the description of the data element.
099:             *
100:             * @return
101:             *    The description of the data element, never <code>null</code>.
102:             */
103:            public String getDescription() {
104:
105:                return _description;
106:            }
107:
108:            /**
109:             * Gets the specified sub element that are included in this element.
110:             *
111:             * @param elementName
112:             *    the name of the element, cannot be <code>null</code>.
113:             *
114:             * @return
115:             *    The specification of the sub element, never <code>null</code>.
116:             *
117:             * @throws IllegalArgumentException
118:             *    if <code>elementName == null</code>.
119:             *
120:             * @throws EntityNotFoundException
121:             *    if the element does not have any sub element with the specified name.
122:             */
123:            public DataSectionElementSpec getSubElement(String elementName)
124:                    throws IllegalArgumentException, EntityNotFoundException {
125:
126:                MandatoryArgumentChecker.check("elementName", elementName);
127:
128:                DataSectionElementSpec element = (DataSectionElementSpec) _subElements
129:                        .get(elementName);
130:
131:                if (element == null) {
132:                    throw new EntityNotFoundException("Sub element \""
133:                            + elementName + "\" not found in the element \""
134:                            + _name + "\".");
135:                }
136:
137:                return element;
138:            }
139:
140:            /**
141:             * Gets the specification of the sub elements that are included in this element.
142:             * The key is the name of the element, the value is the {@link DataSectionElementSpec} object.
143:             *
144:             * @return
145:             *    the specification of the sub elements, never <code>null</code>.
146:             */
147:            public Map getSubElements() {
148:
149:                return _subElements;
150:            }
151:
152:            /**
153:             * Gets the specification of the specified attribute of the element.
154:             *
155:             * @param attributeName
156:             *    the name of the attribute, cannot be <code>null</code>.
157:             *
158:             * @return
159:             *    The specification of the attribute, never <code>null</code>.
160:             *
161:             * @throws EntityNotFoundException
162:             *    if the element does not have any attribute with the specified name.
163:             *
164:             * @throws IllegalArgumentException
165:             *    if <code>attributeName == null</code>.
166:             */
167:            public ParameterSpec getAttribute(String attributeName)
168:                    throws EntityNotFoundException, IllegalArgumentException {
169:
170:                MandatoryArgumentChecker.check("attributeName", attributeName);
171:
172:                ParameterSpec attribute = (ParameterSpec) _attributes
173:                        .get(attributeName);
174:
175:                if (attribute == null) {
176:                    throw new EntityNotFoundException("Attribute \""
177:                            + attributeName + "\" not found in the element \""
178:                            + _name + "\".");
179:                }
180:
181:                return attribute;
182:            }
183:
184:            /**
185:             * Gets the attributes of the element.
186:             * The key is the name of the attribute, the value is the {@link ParameterSpec} object.
187:             *
188:             * @return
189:             *    The specification of the attributes, never <code>null</code>.
190:             */
191:            public Map getAttributes() {
192:
193:                return _attributes;
194:            }
195:
196:            /**
197:             * Returns whether the element can contain a PCDATA text.
198:             *
199:             * @return
200:             *    <code>true</code> if the element can contain text, <code>false</code> otherwise.
201:             */
202:            public boolean isPCDataAllowed() {
203:
204:                return _isPCDataAllowed;
205:            }
206:
207:            /**
208:             * Gets the attribute combos defined for the element.
209:             * A list of {@link AttributeComboSpec} object.
210:             *
211:             * @return
212:             *    the list of the attribute combos define for the element, never <code>null</code>.
213:             *
214:             * @since XINS 1.4.0
215:             */
216:            public List getAttributeCombos() {
217:
218:                return _attributeCombos;
219:            }
220:        }
www.java2java.com | Contact Us
Copyright 2009 - 12 Demo Source and Support. All rights reserved.
All other trademarks are property of their respective owners.