Logo Search packages:      
Sourcecode: japitools version File versions  Download package

static boolean net::wuffies::japi::Japize::includeException ( NonArrayRefType[]  excps,
int  index 
) throws ClassNotFoundException [inline, static, package]

Check to see if an exception should be included in the list of exceptions. Subclasses of RuntimeException and Error should be omitted, as should subclasses of other exceptions also thrown.

Definition at line 1212 of file Japize.java.

References net::wuffies::japi::ClassType::getName(), getWrapper(), and net::wuffies::japi::ClassType::getWrapper().

Referenced by getObjComparableString(), and japizeClass().

                                    {
    boolean isSuper = false;
    ClassType excp;
    if (excps[index] instanceof ClassType) {
      excp = (ClassType) excps[index];
    } else {
      TypeParam tp = (TypeParam) excps[index];
      while (tp.getPrimaryConstraint() instanceof TypeParam) {
        tp = (TypeParam) tp.getPrimaryConstraint();
      }
      excp = (ClassType) tp.getPrimaryConstraint();
    }
    for (ClassWrapper supclass = excp.getWrapper();
         supclass != null;
         supclass = getWrapper(supclass.getSuperclass())) {
      String supname = supclass.getName();
      if ("java.lang.RuntimeException".equals(supname) ||
          "java.lang.Error".equals(supname)) {
        return false;
      }
      if (isSuper) {
        for (int i = 0; i < excps.length; i++) {
          if (i != index && excps[i] instanceof ClassType &&
              supname.equals(((ClassType) excps[i]).getName())) return false;
        }
      }
      isSuper = true;
    }
    return true;
  }


Generated by  Doxygen 1.6.0   Back to index