Source Code Cross Referenced for PropertyGroup.java in  » Content-Management-System » harmonise » org » openharmonise » vfs » metadata » 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 » Content Management System » harmonise » org.openharmonise.vfs.metadata 
Source Cross Referenced  Class Diagram Java Document (Java Doc) 


001:        /*
002:         * The contents of this file are subject to the 
003:         * Mozilla Public License Version 1.1 (the "License"); 
004:         * you may not use this file except in compliance with the License. 
005:         * You may obtain a copy of the License at http://www.mozilla.org/MPL/
006:         *
007:         * Software distributed under the License is distributed on an "AS IS"
008:         * basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. 
009:         * See the License for the specific language governing rights and 
010:         * limitations under the License.
011:         *
012:         * The Initial Developer of the Original Code is Simulacra Media Ltd.
013:         * Portions created by Simulacra Media Ltd are Copyright (C) Simulacra Media Ltd, 2004.
014:         *
015:         * All Rights Reserved.
016:         *
017:         * Contributor(s):
018:         */
019:        package org.openharmonise.vfs.metadata;
020:
021:        import java.util.ArrayList;
022:        import java.util.Iterator;
023:        import java.util.List;
024:
025:        import org.w3c.dom.Element;
026:        import org.w3c.dom.Node;
027:        import org.w3c.dom.NodeList;
028:        import org.w3c.dom.Text;
029:
030:        /**
031:         * A property group is essentially just a virtual file collection, this class
032:         * wraps the data that is required for use as a property group thus
033:         * simplifying usage in certain situations.
034:         * 
035:         * @author Matthew Large
036:         * @version $Revision: 1.1 $
037:         *
038:         */
039:        public class PropertyGroup {
040:
041:            /**
042:             * Full path to the virtual file for this property group.
043:             */
044:            private String m_sHREF;
045:
046:            /**
047:             * Version identifier for this property group.
048:             */
049:            private int m_nVersion;
050:
051:            /**
052:             * Name for this property group.
053:             */
054:            private String m_sName;
055:
056:            /**
057:             * Display name for this property group.
058:             */
059:            private String m_sDisplayName;
060:
061:            /**
062:             * List of {@link Property} objects which are children of this property group.
063:             */
064:            private ArrayList m_aChildren = new ArrayList(5);
065:
066:            /**
067:             * List of {@link PropertyGroup} objects which are children of this property.
068:             */
069:            private ArrayList m_aSubGroups = new ArrayList(5);
070:
071:            /**
072:             * 
073:             */
074:            public PropertyGroup() {
075:                super ();
076:            }
077:
078:            /**
079:             * Sets the name of this property group.
080:             * 
081:             * @param sName Name
082:             */
083:            public void setName(String sName) {
084:                this .m_sName = sName;
085:            }
086:
087:            /**
088:             * Sets the full path to the virtual file for this property group.
089:             * 
090:             * @param sHREF Full path
091:             */
092:            public void setHREF(String sHREF) {
093:                this .m_sHREF = sHREF;
094:            }
095:
096:            /**
097:             * Returns the full path to the virtual file for this property group.
098:             * 
099:             * @return Full path
100:             */
101:            public String getHREF() {
102:                return this .m_sHREF;
103:            }
104:
105:            /**
106:             * Returns a list of {@link Property} objects that are children of
107:             * this property group.
108:             * 
109:             * @return List of {@link Property} objects.
110:             */
111:            public List getChildren() {
112:                ArrayList vals = new ArrayList();
113:                Iterator itor = m_aChildren.iterator();
114:                while (itor.hasNext()) {
115:                    String sHREF = (String) itor.next();
116:                    vals.add(PropertyCache.getInstance().getPropertyByPath(
117:                            sHREF));
118:                }
119:
120:                return vals;
121:            }
122:
123:            /**
124:             * Returns a list of paths to the virtual files of properties
125:             * which are children of this property group.
126:             * 
127:             * @return List of paths
128:             */
129:            public List getChildrenHREFs() {
130:                return this .m_aChildren;
131:            }
132:
133:            /**
134:             * Sets the paths to the virtual files of properties
135:             * which are children of this property group.
136:             * 
137:             * @param aHREFs List of paths
138:             */
139:            public void setChildrenHREFs(List aHREFs) {
140:                this .m_aChildren = new ArrayList(aHREFs);
141:            }
142:
143:            /**
144:             * Returns a list of {@link PropertyGroup} objects which are
145:             * children of this property group.
146:             * 
147:             * @return List of {@link PropertyGroup} objects.
148:             */
149:            public List getSubGroups() {
150:                ArrayList vals = new ArrayList();
151:                Iterator itor = m_aSubGroups.iterator();
152:                while (itor.hasNext()) {
153:                    String sHREF = (String) itor.next();
154:                    vals.add(PropertyCache.getInstance()
155:                            .getPropertyGroup(sHREF));
156:                }
157:
158:                return vals;
159:            }
160:
161:            /**
162:             * Populates this property group from a XML element.
163:             * 
164:             * @param elValue Root element of the property group XML
165:             */
166:            public void instantiate(Element elValue) {
167:                this .m_sName = elValue
168:                        .getAttributeNS(
169:                                "http://www.simulacramedia.com/harmoniseclient/propdefs",
170:                                "name");
171:                NodeList nl = elValue.getChildNodes();
172:                for (int i = 0; i < nl.getLength(); i++) {
173:                    Node node = nl.item(i);
174:                    if (node.getNodeType() == Node.ELEMENT_NODE) {
175:                        Element element = (Element) node;
176:                        if (element.getLocalName().equalsIgnoreCase(
177:                                "displayname")) {
178:                            Node node2 = element.getFirstChild();
179:                            if (node2.getNodeType() == Node.TEXT_NODE) {
180:                                this .m_sDisplayName = ((Text) node2)
181:                                        .getNodeValue();
182:                            }
183:                        } else if (element.getLocalName().equalsIgnoreCase(
184:                                "version")) {
185:                            Node node2 = element.getFirstChild();
186:                            if (node2.getNodeType() == Node.TEXT_NODE) {
187:                                this .m_nVersion = Integer
188:                                        .parseInt(((Text) node2).getNodeValue());
189:                            }
190:                        } else if (element.getLocalName().equalsIgnoreCase(
191:                                "href")) {
192:                            Node node2 = element.getFirstChild();
193:                            if (node2.getNodeType() == Node.TEXT_NODE) {
194:                                this .m_sHREF = ((Text) node2).getNodeValue();
195:                            }
196:                        } else if (element.getLocalName().equalsIgnoreCase(
197:                                "children")) {
198:                            NodeList nl2 = element.getChildNodes();
199:                            for (int j = 0; j < nl2.getLength(); j++) {
200:                                Node childNode = (Node) nl2.item(j);
201:                                if (childNode.getNodeType() == Node.ELEMENT_NODE) {
202:                                    Element childElement = (Element) childNode;
203:                                    Node node2 = childElement.getFirstChild();
204:                                    if (node2.getNodeType() == Node.TEXT_NODE) {
205:                                        String sTemp = ((Text) node2)
206:                                                .getNodeValue();
207:                                        this .m_aChildren.add(sTemp.trim());
208:                                    }
209:                                }
210:                            }
211:                        } else if (element.getLocalName().equalsIgnoreCase(
212:                                "subgroups")) {
213:                            NodeList nl2 = element.getChildNodes();
214:                            for (int j = 0; j < nl2.getLength(); j++) {
215:                                Node childNode = (Node) nl2.item(j);
216:                                if (childNode.getNodeType() == Node.ELEMENT_NODE) {
217:                                    Element childElement = (Element) childNode;
218:                                    Node node2 = childElement.getFirstChild();
219:                                    if (node2.getNodeType() == Node.TEXT_NODE) {
220:                                        String sTemp = ((Text) node2)
221:                                                .getNodeValue();
222:                                        this.m_aSubGroups.add(sTemp.trim());
223:                                    }
224:                                }
225:                            }
226:                        }
227:                    }
228:                }
229:            }
230:        }
www.java2java.com | Contact Us
Copyright 2009 - 12 Demo Source and Support. All rights reserved.
All other trademarks are property of their respective owners.