Examples of EnumConstantDeclaration


Examples of com.github.antlrjavaparser.api.body.EnumConstantDeclaration

        }
        if (entries.size() != entries2.size()) {
            return false;
        }
        for (int i = 0; i < entries.size(); i++) {
            final EnumConstantDeclaration constant = entries.get(i);
            final EnumConstantDeclaration constant2 = entries2.get(i);

            if (!equals(constant, constant2)) {
                return false;
            }
        }
View Full Code Here

Examples of com.github.antlrjavaparser.api.body.EnumConstantDeclaration

            if (constant.getName().equals(name.getSymbolName())) {
                throw new IllegalArgumentException("Enum constant '"
                        + name.getSymbolName() + "' already exists");
            }
        }
        final EnumConstantDeclaration newEntry = new EnumConstantDeclaration(
                name.getSymbolName());
        constants.add(constants.size(), newEntry);
    }
View Full Code Here

Examples of com.sun.mirror.declaration.EnumConstantDeclaration

    unwrapped = BeansWrapper.getDefaultInstance().unwrap((TemplateModel) list.get(1));
    if (!(unwrapped instanceof EnumConstantDeclaration)) {
      throw new TemplateModelException("The nameForEnumConstant method must have an enum constant declaration as a parameter.");
    }
    EnumConstantDeclaration constant = (EnumConstantDeclaration) unwrapped;

    String name = ObjCDeploymentModule.scrubIdentifier(typeDefinition.getName());
    String simpleName = ObjCDeploymentModule.scrubIdentifier(typeDefinition.getSimpleName());
    String clientName = ObjCDeploymentModule.scrubIdentifier(typeDefinition.getClientSimpleName());
    String simpleNameDecap = ObjCDeploymentModule.scrubIdentifier(Introspector.decapitalize(simpleName));
    String clientNameDecap = ObjCDeploymentModule.scrubIdentifier(Introspector.decapitalize(clientName));
    if (name == null) {
      name = "anonymous_" + clientNameDecap;
    }
    PackageDeclaration pckg = ((TypeDeclaration) typeDefinition).getPackage();
    String packageName = pckg == null ? "" : pckg.getQualifiedName();
    String packageIdentifier = this.packages2ids.containsKey(packageName) ? ObjCDeploymentModule.scrubIdentifier(this.packages2ids.get(packageName)) : ObjCDeploymentModule.scrubIdentifier(packageName);
    String nsid = ObjCDeploymentModule.scrubIdentifier(namespaces2ids.get(typeDefinition.getNamespace()));

    String constantName = ObjCDeploymentModule.scrubIdentifier(constant.getSimpleName());
    String constantClientName = ObjCDeploymentModule.scrubIdentifier(constant.getAnnotation(ClientName.class) != null ? constant.getAnnotation(ClientName.class).value() : constantName);
    return String.format(this.pattern, this.projectLabel, nsid, name, clientName, clientNameDecap, simpleName, simpleNameDecap, packageIdentifier, constantClientName, constantName);
  }
View Full Code Here

Examples of com.sun.mirror.declaration.EnumConstantDeclaration

    unwrapped = BeansWrapper.getDefaultInstance().unwrap((TemplateModel) list.get(1));
    if (!(unwrapped instanceof EnumConstantDeclaration)) {
      throw new TemplateModelException("The nameForEnumConstant method must have an enum constant declaration as a parameter.");
    }
    EnumConstantDeclaration constant = (EnumConstantDeclaration) unwrapped;

    String name = CDeploymentModule.scrubIdentifier(typeDefinition.getName());
    String simpleName = CDeploymentModule.scrubIdentifier(typeDefinition.getSimpleName());
    String clientName = CDeploymentModule.scrubIdentifier(typeDefinition.getClientSimpleName());
    String simpleNameDecap = CDeploymentModule.scrubIdentifier(Introspector.decapitalize(simpleName));
    String clientNameDecap = CDeploymentModule.scrubIdentifier(Introspector.decapitalize(clientName));
    if (name == null) {
      name = "anonymous_" + clientNameDecap;
    }
    PackageDeclaration pckg = ((TypeDeclaration) typeDefinition).getPackage();
    String packageUnderscored = CDeploymentModule.scrubIdentifier(pckg != null ? pckg.getQualifiedName().replace('.', '_') :"");
    String nsid = CDeploymentModule.scrubIdentifier(namespaces2ids.get(typeDefinition.getNamespace()));

    String constantName = CDeploymentModule.scrubIdentifier(constant.getSimpleName());
    String constantClientName = CDeploymentModule.scrubIdentifier(constant.getAnnotation(ClientName.class) != null ? constant.getAnnotation(ClientName.class).value() : constantName);
    return String.format(this.pattern, this.projectLabel, nsid, name, clientName, clientNameDecap, simpleName, simpleNameDecap, packageUnderscored, constantClientName, constantName);
  }
View Full Code Here

Examples of japa.parser.ast.body.EnumConstantDeclaration

            if (constant.getName().equals(name.getSymbolName())) {
                throw new IllegalArgumentException("Enum constant '"
                        + name.getSymbolName() + "' already exists");
            }
        }
        final EnumConstantDeclaration newEntry = new EnumConstantDeclaration(
                name.getSymbolName());
        constants.add(constants.size(), newEntry);
    }
View Full Code Here

Examples of japa.parser.ast.body.EnumConstantDeclaration

    printer.printLn(" {");
    printer.indent();
    if (n.getEntries() != null) {
      printer.printLn();
      for (Iterator<EnumConstantDeclaration> i = n.getEntries().iterator(); i.hasNext();) {
        EnumConstantDeclaration e = i.next();
        e.accept(this, arg);
        if (i.hasNext()) {
          printer.print(", ");
        }
      }
    }
View Full Code Here

Examples of japa.parser.ast.body.EnumConstantDeclaration

    public Boolean visit(EmptyTypeDeclaration n1, Node arg) {
        return Boolean.TRUE;
    }

    public Boolean visit(EnumConstantDeclaration n1, Node arg) {
        EnumConstantDeclaration n2 = (EnumConstantDeclaration) arg;

        // javadoc are checked at CompilationUnit

        if (!objEquals(n1.getName(), n2.getName())) {
            return Boolean.FALSE;
        }

        if (!nodesEquals(n1.getAnnotations(), n2.getAnnotations())) {
            return Boolean.FALSE;
        }

        if (!nodesEquals(n1.getArgs(), n2.getArgs())) {
            return Boolean.FALSE;
        }

        if (!nodesEquals(n1.getClassBody(), n2.getClassBody())) {
            return Boolean.FALSE;
        }

        return Boolean.TRUE;
    }
View Full Code Here

Examples of japa.parser.ast.body.EnumConstantDeclaration

        printer.printLn(" {");
        printer.indent();
        if (n.getEntries() != null) {
            printer.printLn();
            for (Iterator<EnumConstantDeclaration> i = n.getEntries().iterator(); i.hasNext();) {
                EnumConstantDeclaration e = i.next();
                e.accept(this, arg);
                if (i.hasNext()) {
                    printer.print(", ");
                }
            }
        }
View Full Code Here

Examples of japa.parser.ast.body.EnumConstantDeclaration

    }

    final public EnumDeclaration EnumDeclaration(Modifier modifier) throws ParseException {
        String name;
        List impList = null;
        EnumConstantDeclaration entry;
        List entries = null;
        BodyDeclaration member;
        List members = null;
        int line = modifier.beginLine;
        int column = modifier.beginColumn;
View Full Code Here

Examples of japa.parser.ast.body.EnumConstantDeclaration

                jj_la1[22] = jj_gen;
                ;
        }
        {
            if (true) {
                return new EnumConstantDeclaration(line, column, token.endLine, token.endColumn, popJavadoc(), annotations, name, args, classBody);
            }
        }
        throw new Error("Missing return statement in function");
    }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.