Source Code Cross Referenced for SearchResult.java in  » Apache-Harmony-Java-SE » javax-package » javax » naming » directory » 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 » Apache Harmony Java SE » javax package » javax.naming.directory 
Source Cross Referenced  Class Diagram Java Document (Java Doc) 


001:        /* 
002:         * Licensed to the Apache Software Foundation (ASF) under one or more
003:         * contributor license agreements.  See the NOTICE file distributed with
004:         * this work for additional information regarding copyright ownership.
005:         * The ASF licenses this file to You under the Apache License, Version 2.0
006:         * (the "License"); you may not use this file except in compliance with
007:         * the License.  You may obtain a copy of the License at
008:         * 
009:         *     http://www.apache.org/licenses/LICENSE-2.0
010:         * 
011:         * Unless required by applicable law or agreed to in writing, software
012:         * distributed under the License is distributed on an "AS IS" BASIS,
013:         * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
014:         * See the License for the specific language governing permissions and
015:         * limitations under the License.
016:         */
017:
018:        package javax.naming.directory;
019:
020:        import javax.naming.Binding;
021:
022:        import org.apache.harmony.jndi.internal.nls.Messages;
023:
024:        /**
025:         * <code>SearchResult</code> returned from a search on a directory context and
026:         * is provided by a <code>NamingEnumeration</code>.
027:         * <p>
028:         * This class is not thread-safe.
029:         * </p>
030:         */
031:        public class SearchResult extends Binding {
032:
033:            /*
034:             * This constant is used during deserialization to check the version which
035:             * created the serialized object.
036:             */
037:            private static final long serialVersionUID = 0x80e805ecc9ed1c5cL;
038:
039:            /**
040:             * The attributes that were matched for this object.
041:             * 
042:             * @serial
043:             */
044:            private Attributes attrs;
045:
046:            /**
047:             * Creates a new instance of <code>SearchResult</code> with name
048:             * <code>s</code>, bound object <code>o</code> and an
049:             * <code>attributes</code>
050:             * 
051:             * @param s
052:             *            the name of this result. <code>s</code> should be relative
053:             *            to the target context for the search that produces this
054:             *            result.
055:             * @param o
056:             *            bound object of this result. The class of <code>o</code> is
057:             *            the value that will be returned by
058:             *            <code>Binding.getClassName()</code> for this search result,
059:             *            except where <code>setClassName()</code> is used to set a
060:             *            different value. If <code>o</code> is null,
061:             *            <code>getClassName()</code> will return null.
062:             * @param attributes
063:             *            The <code>attributes</code> should not be null. If there are
064:             *            no attributes for this search result, this parameter should be
065:             *            an empty collection.
066:             */
067:            public SearchResult(String s, Object o, Attributes attributes) {
068:                this (s, null, o, attributes, true);
069:            }
070:
071:            /**
072:             * Creates a new instance of <code>SearchResult</code> with name
073:             * <code>s</code>, bound object <code>o</code>, an
074:             * <code>attributes</code> and a boolean <code>flag</code>
075:             * 
076:             * @param s
077:             *            the name of this result. A true value of <code>flag</code>
078:             *            means <code>s</code> is relative to the target context of
079:             *            the search that produces this result. A false value of
080:             *            <code>flag</code> means that <code>s</code> is a URL
081:             *            string.
082:             * @param o
083:             *            bound object of this result. The class of <code>o</code> is
084:             *            the value that will be returned by
085:             *            <code>Binding.getClassName()</code> for this search result,
086:             *            except where <code>setClassName()</code> is used to set a
087:             *            different value. If <code>o</code> is null,
088:             *            <code>getClassName()</code> will return null.
089:             * @param attributes
090:             *            The <code>attributes</code> should not be null. If there are
091:             *            no attributes for this search result, this parameter should be
092:             *            an empty collection.
093:             * @param flag
094:             *            A true value of <code>flag</code> means <code>s</code> is
095:             *            relative to the target context of the search that produces
096:             *            this result. A false value of <code>flag</code> means that
097:             *            <code>s</code> is a URL string.
098:             * 
099:             */
100:            public SearchResult(String s, Object o, Attributes attributes,
101:                    boolean flag) {
102:                this (s, null, o, attributes, flag);
103:            }
104:
105:            /**
106:             * Creates a new instance of <code>SearchResult</code> with name
107:             * <code>s</code>, class name <code>s1</code> bound object
108:             * <code>o</code> and an <code>attributes</code>
109:             * 
110:             * @param s
111:             *            the name of this result. <code>s</code> should be relative
112:             *            to the target context for the search that produces this
113:             *            result.
114:             * @param s1
115:             *            If <code>s1</code> is not null, it specifies the name of the
116:             *            class of the bound object <code>o</code>. Passing a null
117:             *            value for <code>s1</code> will not stop
118:             *            <code>Binding.getClassName()</code> returning the name of
119:             *            the class of <code>o</code>.
120:             * @param o
121:             *            bound object of this result. The class of <code>o</code> is
122:             *            the value that will be returned by
123:             *            <code>Binding.getClassName()</code> for this search result,
124:             *            except where <code>setClassName()</code> is used to set a
125:             *            different value. If <code>o</code> is null,
126:             *            <code>getClassName()</code> will return null.
127:             * @param attributes
128:             *            The <code>attributes</code> should not be null. If there are
129:             *            no attributes for this search result, this parameter should be
130:             *            an empty collection.
131:             */
132:            public SearchResult(String s, String s1, Object o,
133:                    Attributes attributes) {
134:                this (s, s1, o, attributes, true);
135:            }
136:
137:            /**
138:             * Creates a new instance of <code>SearchResult</code> with name
139:             * <code>s</code>, class name <code>s1</code> bound object
140:             * <code>o</code> , an <code>attributes</code> and a boolean
141:             * <code>flag</code>
142:             * 
143:             * @param s
144:             *            the name of this result. A true value of <code>flag</code>
145:             *            means <code>s</code> is relative to the target context of
146:             *            the search that produces this result. A false value of
147:             *            <code>flag</code> means that <code>s</code> is a URL
148:             *            string.
149:             * @param s1
150:             *            If <code>s1</code> is not null, it specifies the name of the
151:             *            class of the bound object <code>o</code>. Passing a null
152:             *            value for <code>s1</code> will not stop
153:             *            <code>Binding.getClassName()</code> returning the name of
154:             *            the class of <code>o</code>.
155:             * @param o
156:             *            bound object of this result. The class of <code>o</code> is
157:             *            the value that will be returned by
158:             *            <code>Binding.getClassName()</code> for this search result,
159:             *            except where <code>setClassName()</code> is used to set a
160:             *            different value. If <code>o</code> is null,
161:             *            <code>getClassName()</code> will return null.
162:             * @param attributes
163:             *            The <code>attributes</code> should not be null. If there are
164:             *            no attributes for this search result, this parameter should be
165:             *            an empty collection.
166:             * @param flag
167:             *            A true value of <code>flag</code> means <code>s</code> is
168:             *            relative to the target context of the search that produces
169:             *            this result. A false value of <code>flag</code> means that
170:             *            <code>s</code> is a URL string.
171:             */
172:            public SearchResult(String s, String s1, Object o,
173:                    Attributes attributes, boolean flag) {
174:                super (s, s1, o, flag);
175:
176:                if (attributes == null) {
177:                    // jndi.8B=attrs must not be null
178:                    throw new IllegalArgumentException(Messages
179:                            .getString("jndi.8B")); //$NON-NLS-1$
180:                }
181:                this .attrs = attributes;
182:            }
183:
184:            /**
185:             * Gets attributes of this search result
186:             * 
187:             * @return an attributes. It should not be null.
188:             */
189:            public Attributes getAttributes() {
190:                return attrs;
191:            }
192:
193:            /**
194:             * Sets attributes of this search result
195:             * 
196:             * @param attributes
197:             *            an attributes. It should not be null.
198:             */
199:            public void setAttributes(Attributes attributes) {
200:                if (attributes == null) {
201:                    // jndi.8B=attrs must not be null
202:                    throw new IllegalArgumentException(Messages
203:                            .getString("jndi.8B")); //$NON-NLS-1$
204:                }
205:                this .attrs = attributes;
206:            }
207:
208:            /**
209:             * Return a concatenation of the <code>toString()</code> value for the
210:             * binding, and the <code>toString()</code> values for the attributes,
211:             * joined by colons.
212:             * 
213:             * @return string representation of this search result
214:             */
215:            @Override
216:            public String toString() {
217:                return new StringBuffer(super .toString()).append(":") //$NON-NLS-1$
218:                        .append(attrs.toString()).toString();
219:            }
220:
221:        }
www.java2java.com | Contact Us
Copyright 2009 - 12 Demo Source and Support. All rights reserved.
All other trademarks are property of their respective owners.