public static List<ClassDef> createClassDef(StdJavaExpressions converter,ClassPool classPool,FileUnit fu) throws CompileFailed {
List<ClassDef> defs = new ArrayList<ClassDef>() ;
Collection<Exception> errors = new ArrayList<Exception>() ;
for(ClassDecl cdecl: fu.classDecl) {
ClassDef cd ;
FileUnitInfo fuinfo = classPool.findFileUnit(fu) ;
TypeName cname = ClassPool.getClassName(fu,cdecl) ;
switch(cdecl.classType) {
case ABSTRACT:
cd = new ClassDef(ClassDefType.ABSTRACT,fu.filename,cname,fuinfo.getFullQualified(cdecl.superClass)) ;
break ;
case INTERFACE:
cd = new ClassDef(ClassDefType.INTERFACE,fu.filename,cname,fuinfo.getFullQualified(cdecl.superClass)) ;
break ;
default:
cd = new ClassDef(ClassDefType.DEFAULT,fu.filename,cname,fuinfo.getFullQualified(cdecl.superClass)) ;
break ;
}
VarStack fdcls = new VarStack() ;
try {
fdcls = StdJavaExpressions.makeFieldDecls(classPool,classPool.new SimpleResolver(cname),fdcls);
} catch (CompilerException e) {
errors.add(e) ;
}
for(String iface: cdecl.interfaces) {
cd = cd.addInterface(fuinfo.getFullQualified(iface)) ;
}
for(FieldOrMethod fom: cdecl.decls) {
if (fom instanceof FieldDecl) {
try {
cd = cd.addField(getDef(converter,classPool,cdecl,(FieldDecl)fom,fuinfo)) ;