Source Code Cross Referenced for AbstractCollectionMapping.java in  » Search-Engine » compass-2.0 » org » compass » core » mapping » osem » 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 » Search Engine » compass 2.0 » org.compass.core.mapping.osem 
Source Cross Referenced  Class Diagram Java Document (Java Doc) 


001:        /*
002:         * Copyright 2004-2006 the original author or authors.
003:         * 
004:         * Licensed under the Apache License, Version 2.0 (the "License");
005:         * you may not use this file except in compliance with the License.
006:         * You may obtain a copy of the License at
007:         * 
008:         *      http://www.apache.org/licenses/LICENSE-2.0
009:         * 
010:         * Unless required by applicable law or agreed to in writing, software
011:         * distributed under the License is distributed on an "AS IS" BASIS,
012:         * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
013:         * See the License for the specific language governing permissions and
014:         * limitations under the License.
015:         */
016:
017:        package org.compass.core.mapping.osem;
018:
019:        import org.compass.core.engine.naming.PropertyPath;
020:        import org.compass.core.mapping.Mapping;
021:        import org.compass.core.mapping.OverrideByNameMapping;
022:        import org.compass.core.util.Parameter;
023:
024:        /**
025:         * @author kimchy
026:         */
027:        public abstract class AbstractCollectionMapping extends
028:                AbstractAccessorMapping implements  OverrideByNameMapping {
029:
030:            public static final class CollectionType extends Parameter {
031:
032:                private static final long serialVersionUID = 5419036751959715652L;
033:
034:                private CollectionType(String name) {
035:                    super (name);
036:                }
037:
038:                public static final CollectionType NOT_REQUIRED = new CollectionType(
039:                        "NOT_REQUIRED");
040:
041:                public static final CollectionType UNKNOWN = new CollectionType(
042:                        "UNKNOWN");
043:
044:                public static final CollectionType SET = new CollectionType(
045:                        "SET");
046:
047:                public static final CollectionType LIST = new CollectionType(
048:                        "LIST");
049:
050:                public static final CollectionType SORTED_SET = new CollectionType(
051:                        "SORTED_SET");
052:
053:                public static String toString(CollectionType collectionType) {
054:                    if (collectionType == CollectionType.NOT_REQUIRED) {
055:                        return "na";
056:                    } else if (collectionType == CollectionType.UNKNOWN) {
057:                        return "unknown";
058:                    } else if (collectionType == CollectionType.SET) {
059:                        return "set";
060:                    } else if (collectionType == CollectionType.LIST) {
061:                        return "list";
062:                    } else if (collectionType == CollectionType.SORTED_SET) {
063:                        return "sortset";
064:                    }
065:                    throw new IllegalArgumentException(
066:                            "Can't find collection type for [" + collectionType
067:                                    + "]");
068:                }
069:
070:                public static CollectionType fromString(String collectionType) {
071:                    if ("na".equalsIgnoreCase(collectionType)) {
072:                        return CollectionType.NOT_REQUIRED;
073:                    } else if ("unknown".equalsIgnoreCase(collectionType)) {
074:                        return CollectionType.UNKNOWN;
075:                    } else if ("set".equalsIgnoreCase(collectionType)) {
076:                        return CollectionType.SET;
077:                    } else if ("list".equalsIgnoreCase(collectionType)) {
078:                        return CollectionType.LIST;
079:                    } else if ("sortset".equalsIgnoreCase(collectionType)) {
080:                        return CollectionType.SORTED_SET;
081:                    }
082:                    throw new IllegalArgumentException(
083:                            "Can't find collection type for [" + collectionType
084:                                    + "]");
085:                }
086:            }
087:
088:            private PropertyPath collectionTypePath;
089:
090:            private PropertyPath colSizePath;
091:
092:            private Mapping elementMapping;
093:
094:            private boolean overrideByName;
095:
096:            private CollectionType collectionType;
097:
098:            public void copy(AbstractCollectionMapping copy) {
099:                super .copy(copy);
100:                copy.setElementMapping(getElementMapping());
101:                copy.setCollectionTypePath(getCollectionTypePath());
102:                copy.setColSizePath(getColSizePath());
103:                copy.setOverrideByName(isOverrideByName());
104:                copy.setCollectionType(getCollectionType());
105:            }
106:
107:            public boolean canBeCollectionWrapped() {
108:                return false;
109:            }
110:
111:            public Mapping getElementMapping() {
112:                return elementMapping;
113:            }
114:
115:            public void setElementMapping(Mapping elementMapping) {
116:                this .elementMapping = elementMapping;
117:            }
118:
119:            public PropertyPath getCollectionTypePath() {
120:                return collectionTypePath;
121:            }
122:
123:            public void setCollectionTypePath(PropertyPath collectionTypePath) {
124:                this .collectionTypePath = collectionTypePath;
125:            }
126:
127:            public PropertyPath getColSizePath() {
128:                return colSizePath;
129:            }
130:
131:            public void setColSizePath(PropertyPath colSizePath) {
132:                this .colSizePath = colSizePath;
133:            }
134:
135:            public boolean isOverrideByName() {
136:                return overrideByName;
137:            }
138:
139:            public void setOverrideByName(boolean overrideByName) {
140:                this .overrideByName = overrideByName;
141:            }
142:
143:            public CollectionType getCollectionType() {
144:                return collectionType;
145:            }
146:
147:            public void setCollectionType(CollectionType collectionType) {
148:                this.collectionType = collectionType;
149:            }
150:        }
www.java2java.com | Contact Us
Copyright 2009 - 12 Demo Source and Support. All rights reserved.
All other trademarks are property of their respective owners.