KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > jboss > axis > encoding > TypeMappingImpl


1 /*
2  * The Apache Software License, Version 1.1
3  *
4  *
5  * Copyright (c) 2001-2003 The Apache Software Foundation. All rights
6  * reserved.
7  *
8  * Redistribution and use in source and binary forms, with or without
9  * modification, are permitted provided that the following conditions
10  * are met:
11  *
12  * 1. Redistributions of source code must retain the above copyright
13  * notice, this list of conditions and the following disclaimer.
14  *
15  * 2. Redistributions in binary form must reproduce the above copyright
16  * notice, this list of conditions and the following disclaimer in
17  * the documentation and/or other materials provided with the
18  * distribution.
19  *
20  * 3. The end-user documentation included with the redistribution,
21  * if any, must include the following acknowledgment:
22  * "This product includes software developed by the
23  * Apache Software Foundation (http://www.apache.org/)."
24  * Alternately, this acknowledgment may appear in the software itself,
25  * if and wherever such third-party acknowledgments normally appear.
26  *
27  * 4. The names "Axis" and "Apache Software Foundation" must
28  * not be used to endorse or promote products derived from this
29  * software without prior written permission. For written
30  * permission, please contact apache@apache.org.
31  *
32  * 5. Products derived from this software may not be called "Apache",
33  * nor may "Apache" appear in their name, without prior written
34  * permission of the Apache Software Foundation.
35  *
36  * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
37  * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
38  * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
39  * DISCLAIMED. IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR
40  * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
41  * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
42  * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
43  * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
44  * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
45  * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
46  * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
47  * SUCH DAMAGE.
48  * ====================================================================
49  *
50  * This software consists of voluntary contributions made by many
51  * individuals on behalf of the Apache Software Foundation. For more
52  * information on the Apache Software Foundation, please see
53  * <http://www.apache.org/>.
54  */

55
56 package org.jboss.axis.encoding;
57
58 import org.jboss.axis.Constants;
59 import org.jboss.axis.encoding.ser.BeanDeserializerFactory;
60 import org.jboss.axis.encoding.ser.BeanSerializerFactory;
61 import org.jboss.axis.utils.ClassUtils;
62 import org.jboss.axis.utils.Messages;
63 import org.jboss.logging.Logger;
64
65 import javax.xml.namespace.QName JavaDoc;
66 import javax.xml.rpc.JAXRPCException JavaDoc;
67 import java.util.ArrayList JavaDoc;
68 import java.util.HashMap JavaDoc;
69 import java.util.List JavaDoc;
70
71 /**
72  * <p/>
73  * This is the implementation of the axis TypeMapping interface (which extends
74  * the JAX-RPC TypeMapping interface).
75  * </p>
76  * <p/>
77  * A TypeMapping is obtained from the singleton TypeMappingRegistry using
78  * the namespace of the webservice. The TypeMapping contains the tuples
79  * {Java type, SerializerFactory, DeserializerFactory, Type QName)
80  * </p>
81  * <p/>
82  * So if you have a Web Service with the namespace "XYZ", you call
83  * the TypeMappingRegistry.getTypeMapping("XYZ").
84  * </p>
85  * <p/>
86  * The wsdl in your web service will use a number of types. The tuple
87  * information for each of these will be accessed via the TypeMapping.
88  * </p>
89  * <p/>
90  * Because every web service uses the soap, schema, wsdl primitives, we could
91  * pre-populate the TypeMapping with these standard tuples. Instead,
92  * if the namespace/class matches is not found in the TypeMapping
93  * the request is delegated to the
94  * Default TypeMapping or another TypeMapping
95  * </p>
96  *
97  * @author Rich Scheuerle (scheu@us.ibm.com)
98  */

99 public class TypeMappingImpl implements TypeMapping
100 {
101    private static Logger log = Logger.getLogger(TypeMappingImpl.class.getName());
102
103    public class Pair
104    {
105       public Class JavaDoc javaType;
106       public QName JavaDoc xmlType;
107
108       public Pair(Class JavaDoc javaType, QName JavaDoc xmlType)
109       {
110          this.javaType = javaType;
111          this.xmlType = xmlType;
112       }
113
114       public boolean equals(Object JavaDoc o)
115       {
116          if (o == null) return false;
117          Pair p = (Pair)o;
118          // Test straight equality
119
if (p.xmlType == this.xmlType &&
120                  p.javaType == this.javaType)
121          {
122             return true;
123          }
124          return (p.xmlType.equals(this.xmlType) &&
125                  p.javaType.equals(this.javaType));
126       }
127
128       public int hashCode()
129       {
130          int hashcode = 0;
131          if (javaType != null)
132          {
133             hashcode ^= javaType.hashCode();
134          }
135          if (xmlType != null)
136          {
137             hashcode ^= xmlType.hashCode();
138          }
139          return hashcode;
140       }
141    }
142
143    private HashMap JavaDoc qName2Pair; // QName to Pair Mapping
144
private HashMap JavaDoc class2Pair; // Class Name to Pair Mapping
145
private HashMap JavaDoc pair2SF; // Pair to Serialization Factory
146
private HashMap JavaDoc pair2DF; // Pair to Deserialization Factory
147
protected TypeMapping delegate; // Pointer to delegate or null
148
private ArrayList JavaDoc namespaces; // Supported namespaces
149

150    /**
151     * Should we "auto-type" classes we don't recognize into the "java:"
152     * namespace?
153     */

154    private boolean doAutoTypes = false;
155
156    /**
157     * Construct TypeMapping
158     */

159    public TypeMappingImpl(TypeMapping delegate)
160    {
161       qName2Pair = new HashMap JavaDoc();
162       class2Pair = new HashMap JavaDoc();
163       pair2SF = new HashMap JavaDoc();
164       pair2DF = new HashMap JavaDoc();
165       this.delegate = delegate;
166       namespaces = new ArrayList JavaDoc();
167    }
168
169    /**
170     * setDelegate sets the new Delegate TypeMapping
171     */

172    public void setDelegate(TypeMapping delegate)
173    {
174       this.delegate = delegate;
175    }
176
177    /**
178     * getDelegate gets the new Delegate TypeMapping
179     */

180    public TypeMapping getDelegate()
181    {
182       return delegate;
183    }
184
185    /********* JAX-RPC Compliant Method Definitions *****************/
186
187    /**
188     * Gets the list of encoding styles supported by this TypeMapping object.
189     *
190     * @return String[] of namespace URIs for the supported encoding
191     * styles and XML schema namespaces.
192     */

193    public String JavaDoc[] getSupportedEncodings()
194    {
195       String JavaDoc[] stringArray = new String JavaDoc[namespaces.size()];
196       return (String JavaDoc[])namespaces.toArray(stringArray);
197    }
198
199    /**
200     * Sets the list of encoding styles supported by this TypeMapping object.
201     * (Not sure why this is useful...this information is automatically updated
202     * during registration.
203     *
204     * @param namespaceURIs String[] of namespace URI's
205     */

206    public void setSupportedEncodings(String JavaDoc[] namespaceURIs)
207    {
208       namespaces.clear();
209       for (int i = 0; i < namespaceURIs.length; i++)
210       {
211          if (!namespaces.contains(namespaceURIs[i]))
212          {
213             namespaces.add(namespaceURIs[i]);
214          }
215       }
216    }
217
218    /**
219     * isRegistered returns true if the [javaType, xmlType]
220     * pair is registered.
221     *
222     * @param javaType - Class of the Java type
223     * @param xmlType - Qualified name of the XML data type
224     * @return true if there is a mapping for the given pair, or
225     * false if the pair is not specifically registered.
226     * <p/>
227     * For example if called with (java.lang.String[], soapenc:Array)
228     * this routine will return false because this pair is
229     * probably not specifically registered.
230     * However if getSerializer is called with the same pair,
231     * the default TypeMapping will use extra logic to find
232     * a serializer (i.e. array serializer)
233     */

234    public boolean isRegistered(Class JavaDoc javaType, QName JavaDoc xmlType)
235    {
236       if (javaType == null || xmlType == null)
237       {
238          // REMOVED_FOR_TCK
239
// return false;
240
throw new JAXRPCException JavaDoc(Messages.getMessage(javaType == null ?
241                  "badJavaType" : "badXmlType"));
242       }
243       if (pair2SF.keySet().contains(new Pair(javaType, xmlType)))
244       {
245          return true;
246       }
247       if (delegate != null)
248       {
249          return delegate.isRegistered(javaType, xmlType);
250       }
251       return false;
252    }
253
254    /**
255     * Registers SerializerFactory and DeserializerFactory for a
256     * specific type mapping between an XML type and Java type.
257     *
258     * @param javaType - Class of the Java type
259     * @param xmlType - Qualified name of the XML data type
260     * @param sf - SerializerFactory
261     * @param dsf - DeserializerFactory
262     * @throws JAXRPCException - If any error during the registration
263     */

264    public void register(Class JavaDoc javaType, QName JavaDoc xmlType,
265                         javax.xml.rpc.encoding.SerializerFactory JavaDoc sf,
266                         javax.xml.rpc.encoding.DeserializerFactory JavaDoc dsf)
267            throws JAXRPCException JavaDoc
268    {
269       // At least a serializer or deserializer factory must be specified.
270
if (sf == null && dsf == null)
271       {
272          throw new JAXRPCException JavaDoc(Messages.getMessage("badSerFac"));
273       }
274
275       internalRegister(javaType, xmlType, sf, dsf);
276    }
277
278    /**
279     * Internal version of register(), which allows null factories.
280     *
281     * @param javaType
282     * @param xmlType
283     * @param sf
284     * @param dsf
285     * @throws JAXRPCException
286     */

287    protected void internalRegister(Class JavaDoc javaType, QName JavaDoc xmlType,
288                                    javax.xml.rpc.encoding.SerializerFactory JavaDoc sf,
289                                    javax.xml.rpc.encoding.DeserializerFactory JavaDoc dsf)
290            throws JAXRPCException JavaDoc
291    {
292       // Both javaType and xmlType must be specified.
293
if (javaType == null || xmlType == null)
294       {
295          throw new JAXRPCException JavaDoc(Messages.getMessage(javaType == null ?
296                  "badJavaType" : "badXmlType"));
297       }
298
299       //REMOVED_FOR_TCK
300
//if (sf != null &&
301
// !(sf instanceof javax.xml.rpc.encoding.SerializerFactory)) {
302
// throw new JAXRPCException(message text);
303
//}
304
//if (dsf != null &&
305
// !(dsf instanceof javax.xml.rpc.encoding.DeserializerFactory)) {
306
// throw new JAXRPCException(message text);
307
//}
308

309       Pair pair = new Pair(javaType, xmlType);
310
311       // Only register the appropriate mappings.
312
if ((dsf != null) || (qName2Pair.get(xmlType) == null))
313          qName2Pair.put(xmlType, pair);
314       if ((sf != null) || (class2Pair.get(javaType) == null))
315          class2Pair.put(javaType, pair);
316
317       if (sf != null)
318          pair2SF.put(pair, sf);
319       if (dsf != null)
320          pair2DF.put(pair, dsf);
321    }
322
323    /**
324     * Gets the SerializerFactory registered for the specified pair
325     * of Java type and XML data type.
326     *
327     * @param javaType - Class of the Java type
328     * @param xmlType - Qualified name of the XML data type
329     * @return Registered SerializerFactory
330     * @throws JAXRPCException - If there is no registered SerializerFactory
331     * for this pair of Java type and XML data type
332     * java.lang.IllegalArgumentException -
333     * If invalid or unsupported XML/Java type is specified
334     */

335    public javax.xml.rpc.encoding.SerializerFactory JavaDoc
336            getSerializer(Class JavaDoc javaType, QName JavaDoc xmlType)
337            throws JAXRPCException JavaDoc
338    {
339
340       javax.xml.rpc.encoding.SerializerFactory JavaDoc sf = null;
341
342       // If the xmlType was not provided, get one
343
if (xmlType == null)
344       {
345          xmlType = getTypeQName(javaType);
346          // If we couldn't find one, we're hosed, since getTypeQName()
347
// already asked all of our delegates.
348
if (xmlType == null)
349          {
350             return null;
351          }
352
353          // If we're doing autoTyping, and we got a type in the right
354
// namespace, we can use the default serializer.
355
if (doAutoTypes &&
356                  xmlType.getNamespaceURI().equals(Constants.NS_URI_JAVA))
357          {
358             return new BeanSerializerFactory(javaType, xmlType);
359          }
360       }
361
362       // Try to get the serializer associated with this pair
363
Pair pair = new Pair(javaType, xmlType);
364
365       // Now get the serializer with the pair
366
sf = (javax.xml.rpc.encoding.SerializerFactory JavaDoc)pair2SF.get(pair);
367
368       // If not successful, use the javaType to get another Pair unless
369
// we've got an array, in which case make sure we get the
370
// ArraySerializer.
371
if (sf == null)
372       {
373          if (javaType.isArray())
374          {
375             pair = (Pair)qName2Pair.get(Constants.SOAP_ARRAY);
376          }
377          else
378          {
379             pair = (Pair)class2Pair.get(pair.javaType);
380          }
381          if (pair != null)
382          {
383             sf = (javax.xml.rpc.encoding.SerializerFactory JavaDoc)pair2SF.get(pair);
384          }
385       }
386
387       if (sf == null && delegate != null)
388       {
389          sf = delegate.getSerializer(javaType, xmlType);
390       }
391       return sf;
392    }
393
394    /**
395     * Get the exact XML type QName which will be used when serializing a
396     * given Class to a given type QName. In other words, if we have:
397     * <p/>
398     * Class TypeQName
399     * ----------------------
400     * Base myNS:Base
401     * Child myNS:Child
402     * <p/>
403     * and call getXMLType(Child.class, BASE_QNAME), we should get
404     * CHILD_QNAME.
405     *
406     * @param javaType
407     * @param xmlType
408     * @return the type's QName
409     * @throws JAXRPCException
410     */

411    public QName JavaDoc getXMLType(Class JavaDoc javaType, QName JavaDoc xmlType)
412            throws JAXRPCException JavaDoc
413    {
414       javax.xml.rpc.encoding.SerializerFactory JavaDoc sf = null;
415
416       // If the xmlType was not provided, get one
417
if (xmlType == null)
418       {
419          xmlType = getTypeQNameRecursive(javaType);
420
421          // If we couldn't find one, we're hosed, since getTypeQName()
422
// already asked all of our delegates.
423
if (xmlType == null)
424          {
425             return null;
426          }
427
428          // If we're doing autoTyping, we can use the default.
429
if (doAutoTypes &&
430                  xmlType.getNamespaceURI().equals(Constants.NS_URI_JAVA))
431          {
432             return xmlType;
433          }
434       }
435
436       // Try to get the serializer associated with this pair
437
Pair pair = new Pair(javaType, xmlType);
438
439       // Now get the serializer with the pair
440
sf = (javax.xml.rpc.encoding.SerializerFactory JavaDoc)pair2SF.get(pair);
441
442       // If not successful, use the xmlType to get
443
// another pair. For some xmlTypes (like SOAP_ARRAY)
444
// all of the possible javaTypes are not registered.
445
if (sf == null)
446       {
447          if (javaType.isArray())
448          {
449             pair = (Pair)qName2Pair.get(pair.xmlType);
450          }
451          else
452          {
453             pair = (Pair)class2Pair.get(pair.javaType);
454          }
455          if (pair != null)
456          {
457             sf = (javax.xml.rpc.encoding.SerializerFactory JavaDoc)pair2SF.get(pair);
458          }
459       }
460
461       if (sf == null && delegate != null)
462       {
463          return ((TypeMappingImpl)delegate).getXMLType(javaType, xmlType);
464       }
465
466       if (pair != null)
467       {
468          xmlType = pair.xmlType;
469       }
470
471       return xmlType;
472    }
473
474    /**
475     * Gets the DeserializerFactory registered for the specified pair
476     * of Java type and XML data type.
477     *
478     * @param javaType - Class of the Java type
479     * @param xmlType - Qualified name of the XML data type
480     * @return Registered DeserializerFactory
481     * @throws JAXRPCException - If there is no registered DeserializerFactory
482     * for this pair of Java type and XML data type
483     * java.lang.IllegalArgumentException -
484     * If invalid or unsupported XML/Java type is specified
485     */

486    public javax.xml.rpc.encoding.DeserializerFactory JavaDoc
487            getDeserializer(Class JavaDoc javaType, QName JavaDoc xmlType)
488            throws JAXRPCException JavaDoc
489    {
490       javax.xml.rpc.encoding.DeserializerFactory JavaDoc df = null;
491
492       if (javaType == null)
493       {
494          javaType = getClassForQName(xmlType);
495          // If we don't have a mapping, we're hosed since getClassForQName()
496
// has already asked all our delegates.
497
if (javaType == null)
498          {
499             return null;
500          }
501
502          if (doAutoTypes &&
503                  Constants.NS_URI_JAVA.equals(xmlType.getNamespaceURI()))
504          {
505             try
506             {
507                javaType = ClassUtils.forName(xmlType.getLocalPart());
508             }
509             catch (ClassNotFoundException JavaDoc e)
510             {
511                return null;
512             }
513             return new BeanDeserializerFactory(javaType, xmlType);
514          }
515       }
516
517       Pair pair = new Pair(javaType, xmlType);
518
519       df = (javax.xml.rpc.encoding.DeserializerFactory JavaDoc)pair2DF.get(pair);
520
521       if (df == null && delegate != null)
522       {
523          df = delegate.getDeserializer(javaType, xmlType);
524       }
525       return df;
526    }
527
528    /**
529     * Removes the SerializerFactory registered for the specified
530     * pair of Java type and XML data type.
531     *
532     * @param javaType - Class of the Java type
533     * @param xmlType - Qualified name of the XML data type
534     * @throws JAXRPCException - If there is error in
535     * removing the registered SerializerFactory
536     */

537    public void removeSerializer(Class JavaDoc javaType, QName JavaDoc xmlType)
538            throws JAXRPCException JavaDoc
539    {
540       if (javaType == null || xmlType == null)
541       {
542          throw new JAXRPCException JavaDoc(Messages.getMessage(javaType == null ?
543                  "badJavaType" : "badXmlType"));
544       }
545
546       Pair pair = new Pair(javaType, xmlType);
547       pair2SF.remove(pair);
548    }
549
550    /**
551     * Removes the DeserializerFactory registered for the specified
552     * pair of Java type and XML data type.
553     *
554     * @param javaType - Class of the Java type
555     * @param xmlType - Qualified name of the XML data type
556     * @throws JAXRPCException - If there is error in
557     * removing the registered DeserializerFactory
558     */

559    public void removeDeserializer(Class JavaDoc javaType, QName JavaDoc xmlType)
560            throws JAXRPCException JavaDoc
561    {
562       if (javaType == null || xmlType == null)
563       {
564          throw new JAXRPCException JavaDoc(Messages.getMessage(javaType == null ?
565                  "badJavaType" : "badXmlType"));
566       }
567       Pair pair = new Pair(javaType, xmlType);
568       pair2DF.remove(pair);
569    }
570
571
572    /********* End JAX-RPC Compliant Method Definitions *****************/
573
574    /**
575     * Gets the QName for the type mapped to Class.
576     *
577     * @param javaType class or type
578     * @return xmlType qname or null
579     */

580    public QName JavaDoc getTypeQNameRecursive(Class JavaDoc javaType)
581    {
582       QName JavaDoc ret = null;
583       while (javaType != null)
584       {
585          ret = getTypeQName(javaType);
586          if (ret != null)
587             return ret;
588
589          // Walk my interfaces...
590
Class JavaDoc[] interfaces = javaType.getInterfaces();
591          if (interfaces != null)
592          {
593             for (int i = 0; i < interfaces.length; i++)
594             {
595                Class JavaDoc iface = interfaces[i];
596                ret = getTypeQName(iface);
597                if (ret != null)
598                   return ret;
599             }
600          }
601
602          javaType = javaType.getSuperclass();
603       }
604       return null;
605    }
606
607    public QName JavaDoc getTypeQName(Class JavaDoc javaType)
608    {
609       //log.debug("getTypeQName javaType =" + javaType);
610
if (javaType == null)
611          return null;
612
613       QName JavaDoc xmlType = null;
614       Pair pair = (Pair)class2Pair.get(javaType);
615       if (pair == null && delegate != null)
616       {
617          xmlType = delegate.getTypeQName(javaType);
618       }
619       else if (pair != null)
620       {
621          xmlType = pair.xmlType;
622       }
623
624       if (xmlType == null && doAutoTypes)
625       {
626          xmlType = new QName JavaDoc(Constants.NS_URI_JAVA,
627                  javaType.getName());
628       }
629
630       // Can only detect arrays via code
631
if (xmlType == null && (javaType.isArray() ||
632               javaType == List JavaDoc.class ||
633               List JavaDoc.class.isAssignableFrom(javaType)))
634       {
635
636          // get the registered array if any
637
pair = (Pair)class2Pair.get(Object JavaDoc[].class);
638          // TODO: it always returns the last registered one,
639
// so that's why the soap 1.2 typemappings have to
640
// move to an other registry to differentiate them
641
if (pair != null)
642          {
643             xmlType = pair.xmlType;
644          }
645          else
646          {
647             xmlType = Constants.SOAP_ARRAY;
648          }
649       }
650
651       //log.debug("getTypeQName xmlType =" + xmlType);
652
return xmlType;
653    }
654
655    /**
656     * Gets the Class mapped to QName.
657     *
658     * @param xmlType qname or null
659     * @return javaType class or type
660     */

661    public Class JavaDoc getClassForQName(QName JavaDoc xmlType)
662    {
663       if (xmlType == null)
664          return null;
665
666       Class JavaDoc javaType = null;
667       Pair pair = (Pair)qName2Pair.get(xmlType);
668       if (pair == null && delegate != null)
669       {
670          javaType = delegate.getClassForQName(xmlType);
671       }
672       else if (pair != null)
673       {
674          javaType = pair.javaType;
675       }
676
677       if (javaType == null && doAutoTypes &&
678               Constants.NS_URI_JAVA.equals(xmlType.getNamespaceURI()))
679       {
680          // Classloader?
681
try
682          {
683             javaType = ClassUtils.forName(xmlType.getLocalPart());
684          }
685          catch (ClassNotFoundException JavaDoc e)
686          {
687          }
688       }
689
690       return javaType;
691    }
692
693    /**
694     * Gets the SerializerFactory registered for the Java type.
695     *
696     * @param javaType - Class of the Java type
697     * @return Registered SerializerFactory
698     * @throws JAXRPCException - If there is no registered SerializerFactory
699     * for this pair of Java type and XML data type
700     * java.lang.IllegalArgumentException -
701     * If invalid or unsupported XML/Java type is specified
702     */

703    public javax.xml.rpc.encoding.SerializerFactory JavaDoc
704            getSerializer(Class JavaDoc javaType)
705            throws JAXRPCException JavaDoc
706    {
707       return getSerializer(javaType, null);
708    }
709
710    /**
711     * Gets the DeserializerFactory registered for the xmlType.
712     *
713     * @param xmlType - Qualified name of the XML data type
714     * @return Registered DeserializerFactory
715     * @throws JAXRPCException - If there is no registered DeserializerFactory
716     * for this pair of Java type and XML data type
717     * java.lang.IllegalArgumentException -
718     * If invalid or unsupported XML/Java type is specified
719     */

720    public javax.xml.rpc.encoding.DeserializerFactory JavaDoc
721            getDeserializer(QName JavaDoc xmlType)
722            throws JAXRPCException JavaDoc
723    {
724       return getDeserializer(null, xmlType);
725    }
726
727    public void setDoAutoTypes(boolean doAutoTypes)
728    {
729       this.doAutoTypes = doAutoTypes;
730    }
731
732    /**
733     * Returns an array of all the classes contained within this mapping
734     */

735    public Class JavaDoc[] getAllClasses()
736    {
737       java.util.HashSet JavaDoc temp = new java.util.HashSet JavaDoc();
738       if (delegate != null)
739       {
740          temp.addAll(java.util.Arrays.asList(delegate.getAllClasses()));
741       }
742       temp.addAll(class2Pair.keySet());
743       return (Class JavaDoc[])temp.toArray(new Class JavaDoc[temp.size()]);
744    }
745 }
746
Popular Tags