Source Code Cross Referenced for StyleKeyFactoryCollector.java in  » Report » pentaho-report » org » jfree » report » modules » parser » ext » factory » stylekey » 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 » Report » pentaho report » org.jfree.report.modules.parser.ext.factory.stylekey 
Source Cross Referenced  Class Diagram Java Document (Java Doc) 


001:        /**
002:         * ===========================================
003:         * JFreeReport : a free Java reporting library
004:         * ===========================================
005:         *
006:         * Project Info:  http://reporting.pentaho.org/
007:         *
008:         * (C) Copyright 2001-2007, by Object Refinery Ltd, Pentaho Corporation and Contributors.
009:         *
010:         * This library is free software; you can redistribute it and/or modify it under the terms
011:         * of the GNU Lesser General Public License as published by the Free Software Foundation;
012:         * either version 2.1 of the License, or (at your option) any later version.
013:         *
014:         * This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY;
015:         * without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
016:         * See the GNU Lesser General Public License for more details.
017:         *
018:         * You should have received a copy of the GNU Lesser General Public License along with this
019:         * library; if not, write to the Free Software Foundation, Inc., 59 Temple Place, Suite 330,
020:         * Boston, MA 02111-1307, USA.
021:         *
022:         * [Java is a trademark or registered trademark of Sun Microsystems, Inc.
023:         * in the United States and other countries.]
024:         *
025:         * ------------
026:         * StyleKeyFactoryCollector.java
027:         * ------------
028:         * (C) Copyright 2001-2007, by Object Refinery Ltd, Pentaho Corporation and Contributors.
029:         */package org.jfree.report.modules.parser.ext.factory.stylekey;
030:
031:        import java.util.ArrayList;
032:        import java.util.Iterator;
033:
034:        import org.jfree.report.modules.parser.ext.factory.base.ClassFactory;
035:        import org.jfree.report.style.StyleKey;
036:
037:        /**
038:         * A style key factory.
039:         *
040:         * @author Thomas Morgner
041:         */
042:        public class StyleKeyFactoryCollector implements  StyleKeyFactory {
043:            /**
044:             * Storage for the factories.
045:             */
046:            private final ArrayList factories;
047:
048:            /**
049:             * Creates a new factory.
050:             */
051:            public StyleKeyFactoryCollector() {
052:                factories = new ArrayList();
053:            }
054:
055:            /**
056:             * Adds a factory.
057:             *
058:             * @param factory the factory.
059:             */
060:            public void addFactory(final StyleKeyFactory factory) {
061:                factories.add(factory);
062:            }
063:
064:            /**
065:             * Returns an iterator that provides access to the factories.
066:             *
067:             * @return The iterator.
068:             */
069:            public Iterator getFactories() {
070:                return factories.iterator();
071:            }
072:
073:            /**
074:             * Returns a style key.
075:             *
076:             * @param name the name.
077:             * @return The style key.
078:             */
079:            public StyleKey getStyleKey(final String name) {
080:                for (int i = 0; i < factories.size(); i++) {
081:                    final StyleKeyFactory fact = (StyleKeyFactory) factories
082:                            .get(i);
083:                    final StyleKey o = fact.getStyleKey(name);
084:                    if (o != null) {
085:                        return o;
086:                    }
087:                }
088:                return null;
089:            }
090:
091:            /**
092:             * Creates an object.
093:             *
094:             * @param k     the style key.
095:             * @param value the value.
096:             * @param c     the class.
097:             * @param cf    the class factory used to create the basic object.
098:             * @return The object.
099:             */
100:            public Object createBasicObject(final StyleKey k,
101:                    final String value, final Class c, final ClassFactory cf) {
102:                for (int i = 0; i < factories.size(); i++) {
103:                    final StyleKeyFactory fact = (StyleKeyFactory) factories
104:                            .get(i);
105:                    final Object o = fact.createBasicObject(k, value, c, cf);
106:                    if (o != null) {
107:                        return o;
108:                    }
109:                }
110:                return null;
111:            }
112:
113:            /**
114:             * Returns an iterator that provides access to the registered keys.
115:             *
116:             * @return The iterator.
117:             */
118:            public Iterator getRegisteredKeys() {
119:                final ArrayList list = new ArrayList();
120:                for (int i = 0; i < factories.size(); i++) {
121:                    final StyleKeyFactory f = (StyleKeyFactory) factories
122:                            .get(i);
123:                    final Iterator keys = f.getRegisteredKeys();
124:                    while (keys.hasNext()) {
125:                        list.add(keys.next());
126:                    }
127:                }
128:                return list.iterator();
129:            }
130:
131:            /**
132:             * Indicated whether an other object is equal to this one.
133:             *
134:             * @param o the other object.
135:             * @return true, if the object is equal, false otherwise.
136:             *
137:             * @see java.lang.Object#equals(java.lang.Object)
138:             */
139:            public boolean equals(final Object o) {
140:                if (this  == o) {
141:                    return true;
142:                }
143:                if (!(o instanceof  StyleKeyFactoryCollector)) {
144:                    return false;
145:                }
146:
147:                final StyleKeyFactoryCollector styleKeyFactoryCollector = (StyleKeyFactoryCollector) o;
148:
149:                if (!factories.equals(styleKeyFactoryCollector.factories)) {
150:                    return false;
151:                }
152:
153:                return true;
154:            }
155:
156:            /**
157:             * Computes an hashcode for this factory.
158:             *
159:             * @return the hashcode.
160:             *
161:             * @see java.lang.Object#hashCode()
162:             */
163:            public int hashCode() {
164:                return factories.hashCode();
165:            }
166:        }
www_.__j___a__v__a___2__s__.c_o_m | Contact Us
Copyright 2009 - 12 Demo Source and Support. All rights reserved.
All other trademarks are property of their respective owners.