Source Code Cross Referenced for ClassificationFilter.java in  » Development » rapla » org » rapla » entities » dynamictype » 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 » Development » rapla » org.rapla.entities.dynamictype 
Source Cross Referenced  Class Diagram Java Document (Java Doc) 


001:        /*--------------------------------------------------------------------------*
002:         | Copyright (C) 2006 Christopher Kohlhaas                                  |
003:         |                                                                          |
004:         | This program is free software; you can redistribute it and/or modify     |
005:         | it under the terms of the GNU General Public License as published by the |
006:         | Free Software Foundation. A copy of the license has been included with   |
007:         | these distribution in the COPYING file, if not go to www.fsf.org         |
008:         |                                                                          |
009:         | As a special exception, you are granted the permissions to link this     |
010:         | program with every library, which license fulfills the Open Source       |
011:         | Definition as published by the Open Source Initiative (OSI).             |
012:         *--------------------------------------------------------------------------*/
013:        package org.rapla.entities.dynamictype;
014:
015:        import java.util.Iterator;
016:
017:        /** <p>A new ClassificationFilter for a classifications belonging to the
018:         same DynamicType can be created by the newClassificationFilter of
019:         the corresponding DynamicType object.
020:         </p>
021:
022:         <p>You can set rules for the attributes of the DynamicType.  A
023:         Classification (object implementing Classifiable) is matched by
024:         the filter when the conditions for each attribute-rule are
025:         matched (AND - function).</p>
026:
027:         <p>A condition is an array of size 2, the first field contains the 
028:         operator of the condition and the second the test value. 
029:         When an attribute-rule has more than one condition, at least
030:         one of the conditions must be matched (OR - function ) .
031:         </p>
032:         <p>
033:         The following Example matches all classifications
034:         with a title-value that contains either "rapla" or "sourceforge"
035:         ,a size-value that is > 5 and a category-department-value that
036:         is either the departmentA or the departmentB.
037:         </p>
038:
039:         <pre>
040:         DynamicType eventType = facade.getDynamicType("event");
041:         ClassificationFilter f = eventType.newClassificationFilter();
042:         f.addRule(
043:         "title"
044:         ,new Object {
045:         {"contains", "rapla"}
046:         ,{"contains", "sourceforge"}
047:         });
048:         f.addRule(
049:         "size"
050:         ,new Object{
051:         {">", new Integer(5)}
052:         });
053:
054:         Category departemntCategory = facade.getRootCategory().getCategory("departments");
055:         Category departmentA = departmentCategory.getCategory("departmentA");
056:         Category departmentB = departmentCategory.getCategory("departmentB");
057:         f.addRule(
058:         "department"
059:         ,new Object{
060:         {"=", departmentA}
061:         ,{ "=", departmentB}
062:         });
063:         </pre>
064:
065:         @see Classification
066:         */
067:        public interface ClassificationFilter extends Cloneable {
068:            DynamicType getType();
069:
070:            /** Defines a rule for the passed attribute. 
071:             */
072:            void setRule(int index, String attributeName, Object[][] conditions);
073:
074:            void setRule(int index, Attribute attribute, Object[][] conditions);
075:
076:            /** appends a rule. 
077:             *  @see #setRule*/
078:            void addRule(String attributeName, Object[][] conditions);
079:
080:            /** shortcut to 
081:             * <pre>
082:             * f.addRule(
083:                         attributeName
084:                         ,new Object{
085:                                    {"=", object}}
086:                          });
087:             * </pre>
088:             * @param attributeName
089:             * @param object
090:             */
091:            void addEqualsRule(String attributeName, Object object);
092:
093:            /** shortcut to 
094:             * <pre>
095:             * f.addRule(
096:                         attributeName
097:                         ,new Object{
098:                                    {"is", object}}
099:                          });
100:             * </pre>
101:             * @param attributeName
102:             * @param object
103:             */
104:            void addIsRule(String attributeName, Object object);
105:
106:            int ruleSize();
107:
108:            Iterator ruleIterator();
109:
110:            void removeAllRules();
111:
112:            void removeRule(int index);
113:
114:            boolean matches(Classification classification);
115:
116:            Object clone();
117:
118:            final ClassificationFilter[] CLASSIFICATIONFILTER_ARRAY = new ClassificationFilter[0];
119:
120:            ClassificationFilter[] toArray();
121:        }
www.java2java.com | Contact Us
Copyright 2009 - 12 Demo Source and Support. All rights reserved.
All other trademarks are property of their respective owners.