KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > objectweb > modfact > jmi > reflect > RefBaseObjectImpl


1 package org.objectweb.modfact.jmi.reflect;
2
3 import javax.jmi.reflect.*;
4 import java.util.*;
5
6 public abstract class RefBaseObjectImpl
7         
8         extends ReflectHelper
9         implements javax.jmi.reflect.RefBaseObject, java.io.Serializable JavaDoc {
10     
11     static RefPackageImpl m3 = null;
12     
13     RefObjectImpl metaObject = null;
14     RefPackageImpl container = null;
15     String JavaDoc name = null;
16     
17     public RefBaseObjectImpl() {
18     }
19     
20     public String JavaDoc refMofId() {
21         return String.valueOf(this.hashCode());
22     }
23     
24     public javax.jmi.reflect.RefPackage refOutermostPackage() {
25         Object JavaDoc r = this;
26         RefPackage p = this.refImmediatePackage();
27         while(p!=null) {
28             r = p;
29             p = p.refImmediatePackage();
30         }
31         return (RefPackage)r;
32     }
33  
34     public javax.jmi.reflect.RefPackage refImmediatePackage() {
35         return container;
36     }
37     
38     public java.util.Collection JavaDoc refVerifyConstraints(boolean param) {
39         throw new RuntimeException JavaDoc("No implementation: refVerifyConstraints");
40     }
41     
42     // helper methods
43

44     public List refTypeName() {
45         List typeName;
46         RefBaseObjectImpl p = (RefBaseObjectImpl)refImmediatePackage();
47         typeName = (p==null)? new Vector() : p.refTypeName();
48         typeName.add( name );
49         return typeName;
50     }
51     
52     
53     boolean isM3() {
54       return refOutermostPackage()==m3;
55     }
56     
57     
58     public String JavaDoc toString() {
59         String JavaDoc className = this.getClass().getName();
60         String JavaDoc type = className.substring(className.lastIndexOf(".")+1 ,className.length()) // no package prefix
61
+refTypeName().toString();
62         return type;
63     }
64     
65
66 // //lookup for contained RefClass, RefPackage, RefAssociation
67
//
68
// RefBaseObject resolveQualifiedNameInExtent(List qName) {
69
// return ReflectHelper.resolveQualifiedNameInExtent(this, qName);
70
// }
71

72 }
73
Popular Tags