/** * Adds the given declaration to the specified type. The list of members * will be initialized if it is <code>null</code>. * * @param type * type declaration * @param decl * member declaration */ public static void addMember(TypeDeclaration type, BodyDeclaration decl) { List<BodyDeclaration> members = type.getMembers(); if (members == null) { members = new ArrayList<BodyDeclaration>(); type.setMembers(members); } members.add(decl); }
public TypeDeclaration(int beginLine, int beginColumn, int endLine, int endColumn, List<AnnotationExpr> annotations, int modifiers, String name, List<BodyDeclaration> members) { super(beginLine, beginColumn, endLine, endColumn, annotations); setName(name); setModifiers(modifiers); setMembers(members); }
public TypeDeclaration(List<AnnotationExpr> annotations, int modifiers, String name, List<BodyDeclaration> members) { super(annotations); setName(name); setModifiers(modifiers); setMembers(members); }
members.add(nodes.nestedDeclaration); parent.setMembers(members);