public void addParent(Identifier parent) { addParent(typeRef(parent)); } public void addParent(SimpleTypeRef parent) {
public void generateObjectiveCClasses() throws IOException { for (Struct in : Result.getMap(result.classes, Type.ObjCClass).values()) { outputObjectiveCClass(in); } for (Struct protocol : Result.getMap(result.classes, Type.ObjCProtocol).values()) { for (String parent : getForcedProtocolParents(String.valueOf(protocol.getTag()))) { protocol.addParent(ident(parent)); } outputObjectiveCClass(protocol); } }
public void generateObjectiveCClasses() throws IOException { for (Struct in : Result.getMap(result.classes, Type.ObjCClass).values()) { outputObjectiveCClass(in); } for (Struct protocol : Result.getMap(result.classes, Type.ObjCProtocol).values()) { for (String parent : getForcedProtocolParents(String.valueOf(protocol.getTag()))) { protocol.addParent(ident(parent)); } outputObjectiveCClass(protocol); } }
interf.addModifiers(ModifierType.Public); interf.setTag(ident(name)); interf.addParent(ident(CLAbstractUserProgram.class)); interf.setType(Struct.Type.JavaClass);
struct.setForwardDeclaration(false); if (parentIdentifier != null) struct.addParent(parentIdentifier);
Struct publicStaticClass(Identifier name, Identifier parentName, Struct.Type type, Element toCloneCommentsFrom, Identifier... interfaces) { Struct cl = new Struct(); cl.setType(type); cl.setTag(name); if (parentName != null) { cl.setParents(typeRef(parentName)); } if (type == Struct.Type.JavaInterface) { for (Identifier inter : interfaces) { cl.addParent(typeRef(inter)); } } else { for (Identifier inter : interfaces) { cl.addProtocol(typeRef(inter)); } } if (!result.config.noComments) { cl.importComments(toCloneCommentsFrom, getFileCommentContent(toCloneCommentsFrom)); } cl.addModifiers(ModifierType.Public, ModifierType.Static); return cl; }
Struct publicStaticClass(Identifier name, Identifier parentName, Struct.Type type, Element toCloneCommentsFrom, Identifier... interfaces) { Struct cl = new Struct(); cl.setType(type); cl.setTag(name); if (parentName != null) { cl.setParents(typeRef(parentName)); } if (type == Struct.Type.JavaInterface) { for (Identifier inter : interfaces) { cl.addParent(typeRef(inter)); } } else { for (Identifier inter : interfaces) { cl.addProtocol(typeRef(inter)); } } if (!result.config.noComments) { cl.importComments(toCloneCommentsFrom, getFileCommentContent(toCloneCommentsFrom)); } cl.addModifiers(ModifierType.Public, ModifierType.Static); return cl; }
Struct publicStaticClass(Identifier name, Identifier parentName, Struct.Type type, Element toCloneCommentsFrom, Identifier... interfaces) { Struct cl = new Struct(); cl.setType(type); cl.setTag(name); if (parentName != null) { cl.setParents(typeRef(parentName)); } if (type == Struct.Type.JavaInterface) { for (Identifier inter : interfaces) { cl.addParent(typeRef(inter)); } } else { for (Identifier inter : interfaces) { cl.addProtocol(typeRef(inter)); } } if (!result.config.noComments) { cl.importComments(toCloneCommentsFrom, getFileCommentContent(toCloneCommentsFrom)); } cl.addModifiers(ModifierType.Public, ModifierType.Static); return cl; }
Struct publicStaticClass(Identifier name, Identifier parentName, Struct.Type type, Element toCloneCommentsFrom, Identifier... interfaces) { Struct cl = new Struct(); cl.setType(type); cl.setTag(name); if (parentName != null) { cl.setParents(typeRef(parentName)); } if (type == Struct.Type.JavaInterface) { for (Identifier inter : interfaces) { cl.addParent(typeRef(inter)); } } else { for (Identifier inter : interfaces) { cl.addProtocol(typeRef(inter)); } } if (!result.config.noComments) { cl.importComments(toCloneCommentsFrom, getFileCommentContent(toCloneCommentsFrom)); } cl.addModifiers(ModifierType.Public, ModifierType.Static); return cl; }
instanceStruct.addProtocol(ident(ObjCObject.class)); } else { instanceStruct.addParent(id.clone()); classStruct.addParent(ident(id, classClassName)); instanceStruct.addParent(ident(ObjCObject.class)); } else if (isNSObject) { instanceStruct.addProtocol(ident(ObjCObject.class)); } else { instanceStruct.addParent(ident(NSObject.class)); classStruct.addParent(ident(NSClass.class)); } else { classStruct.addParent(ident(ident(NSObject.class), classClassName)); instanceStruct.addParent(id); } else { instanceStruct.addProtocol(id); classInterfaceStruct.setType(Struct.Type.JavaInterface); classInterfaceStruct.setTag(ident(classInterfaceNameInCategoriesAndProtocols)); classInterfaceStruct.addParent(ident(ObjCClass.class)); classStruct.addProtocol(ident(classInterfaceNameInCategoriesAndProtocols)); } else {
instanceStruct.addProtocol(ident(ObjCObject.class)); } else { instanceStruct.addParent(id.clone()); classStruct.addParent(ident(id, classClassName)); instanceStruct.addParent(ident(ObjCObject.class)); } else if (isNSObject) { instanceStruct.addProtocol(ident(ObjCObject.class)); } else { instanceStruct.addParent(ident(NSObject.class)); classStruct.addParent(ident(NSClass.class)); } else { classStruct.addParent(ident(ident(NSObject.class), classClassName)); instanceStruct.addParent(id); } else { instanceStruct.addProtocol(id); classInterfaceStruct.setType(Struct.Type.JavaInterface); classInterfaceStruct.setTag(ident(classInterfaceNameInCategoriesAndProtocols)); classInterfaceStruct.addParent(ident(ObjCClass.class)); classStruct.addProtocol(ident(classInterfaceNameInCategoriesAndProtocols)); } else {
implementations.addModifiers(ModifierType.Public); implementations.setTag(implementationsSimpleClassName); implementations.addParent(ident(config.runtime.libraryClass, expr(typeRef(implementationsSimpleClassName)))); if (declarationsFullClassName != null) { implementations.addProtocol(declarationsFullClassName.clone());
implementations.addModifiers(ModifierType.Public); implementations.setTag(implementationsSimpleClassName); implementations.addParent(ident(config.runtime.libraryClass, expr(typeRef(implementationsSimpleClassName)))); if (declarationsFullClassName != null) { implementations.addProtocol(declarationsFullClassName.clone());
struct.addParent(new SimpleIdentifier((parentClass!=null?parentClass.getText():null)));
interf.setType(Struct.Type.JavaClass); } else { interf.addParent(libSuperInter); interf.setType(Struct.Type.JavaInterface);
interf.setType(Struct.Type.JavaClass); } else { interf.addParent(libSuperInter); interf.setType(Struct.Type.JavaInterface);