String getFileCommentContent(File file, Element e) { if (file != null) { String path = result.config.relativizeFileForSourceComments(file.getAbsolutePath()); String inCategoryStr = ""; if (e instanceof Function) { Function fc = (Function) e; Struct parent; if (fc.getType() == Type.ObjCMethod && ((parent = as(fc.getParentElement(), Struct.class)) != null) && (parent.getCategoryName() != null)) { inCategoryStr = "from " + parent.getCategoryName() + " "; } } return "<i>" + inCategoryStr + "native declaration : " + path + (e == null || e.getElementLine() < 0 ? "" : ":" + e.getElementLine()) + "</i>"; } else if (e != null && e.getElementLine() >= 0) { return "<i>native declaration : <input>:" + e.getElementLine() + "</i>"; } return null; }
String getFileCommentContent(File file, Element e) { if (file != null) { String path = result.config.relativizeFileForSourceComments(file.getAbsolutePath()); String inCategoryStr = ""; if (e instanceof Function) { Function fc = (Function) e; Struct parent; if (fc.getType() == Type.ObjCMethod && ((parent = as(fc.getParentElement(), Struct.class)) != null) && (parent.getCategoryName() != null)) { inCategoryStr = "from " + parent.getCategoryName() + " "; } } return "<i>" + inCategoryStr + "native declaration : " + path + (e == null || e.getElementLine() < 0 ? "" : ":" + e.getElementLine()) + "</i>"; } else if (e != null && e.getElementLine() >= 0) { return "<i>native declaration : <input>:" + e.getElementLine() + "</i>"; } return null; }
public Identifier getFullClassName(Struct struct) { if (struct == null) { return null; } Identifier javaPackage = getPackageName(struct); Identifier tag = struct.getTag(); String categ = struct.getCategoryName(); Identifier fullName = ident(javaPackage, categ == null ? tag.clone() : ident(categ)); return fullName; }
public Identifier getFullClassName(Struct struct) { if (struct == null) { return null; } Identifier javaPackage = getPackageName(struct); Identifier tag = struct.getTag(); String categ = struct.getCategoryName(); Identifier fullName = ident(javaPackage, categ == null ? tag.clone() : ident(categ)); return fullName; }
if (struct.getCategoryName() != null) { getMap(objCCategoriesByTargetType, struct.getTag()).put(struct.getCategoryName(), struct); objCCategoriesByName.put(struct.getCategoryName(), struct); } else { getMap(classes, struct.getType()).put(struct.getTag(), struct);
public Identifier getPackageName(Struct struct) { if (struct == null) { return null; } String library = result.getLibrary(struct); Identifier javaPackage = result.getLibraryPackage(library); //if (struct.getType() == Struct.Type.ObjCClass) { // String name = String.valueOf(struct.getTag()); //if (name.equals("NSObject")) // javaPackage = ident(NSObject.class.getPackage().getName().split("\\.")); //else if (name.equals("NSClass")) // javaPackage = ident(NSClass.class.getPackage().getName().split("\\.")); //else if (name.equals("NSString")) // javaPackage = ident(NSString.class.getPackage().getName().split("\\.")); //} if (struct.getType() == Type.ObjCProtocol) { javaPackage = ident(javaPackage, "protocols"); } else if (struct.getCategoryName() != null) { javaPackage = ident(javaPackage, "categories"); } return javaPackage; }
if (struct.getCategoryName() != null) { getMap(objCCategoriesByTargetType, struct.getTag()).put(struct.getCategoryName(), struct); objCCategoriesByName.put(struct.getCategoryName(), struct); } else { getMap(classes, struct.getType()).put(struct.getTag(), struct);
public Identifier getPackageName(Struct struct) { if (struct == null) { return null; } String library = result.getLibrary(struct); Identifier javaPackage = result.getLibraryPackage(library); //if (struct.getType() == Struct.Type.ObjCClass) { // String name = String.valueOf(struct.getTag()); //if (name.equals("NSObject")) // javaPackage = ident(NSObject.class.getPackage().getName().split("\\.")); //else if (name.equals("NSClass")) // javaPackage = ident(NSClass.class.getPackage().getName().split("\\.")); //else if (name.equals("NSString")) // javaPackage = ident(NSString.class.getPackage().getName().split("\\.")); //} if (struct.getType() == Type.ObjCProtocol) { javaPackage = ident(javaPackage, "protocols"); } else if (struct.getCategoryName() != null) { javaPackage = ident(javaPackage, "categories"); } return javaPackage; }
modifiersStringPrefix(e); append(e.isForwardDeclaration() ? "@class " : "@interface ", e.getTag()); if (e.getCategoryName() != null) { append(" (", e.getCategoryName(), ")");
public Struct generateObjectiveCClass(Struct in, Signatures signatures) throws IOException { boolean isProtocol = in.getType() == Type.ObjCProtocol, isCategory = in.getCategoryName() != null; instanceStruct.setTag(isCategory ? ident(in.getCategoryName()) : in.getTag().clone()); if (isProtocol || isCategory) { instanceStruct.setType(Type.JavaInterface);
public Struct generateObjectiveCClass(Struct in, Signatures signatures) throws IOException { boolean isProtocol = in.getType() == Type.ObjCProtocol, isCategory = in.getCategoryName() != null; instanceStruct.setTag(isCategory ? ident(in.getCategoryName()) : in.getTag().clone()); if (isProtocol || isCategory) { instanceStruct.setType(Type.JavaInterface);