Examples of ElementKind


Examples of com.google.dart.engine.element.ElementKind

    SimpleIdentifier identifier = (SimpleIdentifier) expression;
    Element element = identifier.getStaticElement();
    if (!(element instanceof VariableElement)) {
      return null;
    }
    ElementKind kind = element.getKind();
    if (kind == ElementKind.LOCAL_VARIABLE) {
      return (VariableElement) element;
    }
    if (kind == ElementKind.PARAMETER) {
      return (VariableElement) element;
View Full Code Here

Examples of com.google.dart.engine.element.ElementKind

    Element element = getNameScope().lookup(node, getDefiningLibrary());
    if (!(element instanceof VariableElement)) {
      return null;
    }
    // Must be local or parameter.
    ElementKind kind = element.getKind();
    if (kind == ElementKind.LOCAL_VARIABLE) {
      node.setStaticElement(element);
      if (node.inSetterContext()) {
        LocalVariableElementImpl variableImpl = (LocalVariableElementImpl) element;
        variableImpl.markPotentiallyMutatedInScope();
View Full Code Here

Examples of com.google.java.contract.core.model.ElementKind

    "utils.isContractAnnotation(annotation)"
  })
  @Ensures("result != null")
  private ContractAnnotationModel createBlankContractModel(Element parent,
      AnnotationMirror annotation, boolean primary, ClassName owner) {
    ElementKind kind = utils.getAnnotationKindForName(annotation);

    boolean virtual;
    TypeName returnType;
    switch (parent.getKind()) {
      default:
View Full Code Here

Examples of com.google.java.contract.core.model.ElementKind

    "type != null",
    "type.getKind() != ElementKind.ANNOTATION_TYPE" +
        "|| type.getInterfaces().size() == 1"
  })
  private void appendInterfaces(TypeModel type) {
    final ElementKind kind = type.getKind();
    if (kind != ElementKind.ANNOTATION_TYPE) {
      Set<? extends ClassName> interfaces = type.getInterfaces();
      if (interfaces.size() != 0) {
        if (kind == ElementKind.INTERFACE) {
          append(" extends ");
View Full Code Here

Examples of com.google.java.contract.core.model.ElementKind

   * @param annotationName the fully qualified name of the annotation
   * @return the contract type, null if not contracts
   */
  ElementKind getAnnotationKindForName(AnnotationMirror annotation) {
    String annotationName = annotation.getAnnotationType().toString();
    ElementKind kind;
    if (annotationName.equals("com.google.java.contract.Invariant")) {
      kind = ElementKind.INVARIANT;
    } else if (annotationName.equals("com.google.java.contract.Requires")) {
      kind = ElementKind.REQUIRES;
    } else if (annotationName.equals("com.google.java.contract.Ensures")) {
View Full Code Here

Examples of com.google.java.contract.core.model.ElementKind

    /* Root type. */
    rootMirror = e;

    /* Create type. */
    ElementKind kind = null;
    switch (e.getKind()) {
      case INTERFACE:
        kind = ElementKind.INTERFACE;
        break;
      case ENUM:
View Full Code Here

Examples of com.google.java.contract.core.model.ElementKind

    oin.close();
  }

  @Override
  public Void visitVariable(VariableElement e, ElementModel p) {
    ElementKind kind = null;
    switch (e.getKind()) {
      case ENUM_CONSTANT:
        kind = ElementKind.CONSTANT;
        break;
      default:
View Full Code Here

Examples of javax.lang.model.element.ElementKind

    //renv.getRootElements()返回的Element并不是都有@Controller的
    //按理说用@SupportedAnnotationTypes指明我的Processor只处理哪些注解,javac就应该返回带有@Controller注解的Element,
    //但是实际情况并不是这样,所以这里要再判断一下。
    for (Element element : renv.getRootElements()) {
      ElementKind kind = element.getKind();
      if (kind != ElementKind.CLASS) //有可能是package-info.java中指定的PackageElement(也就是PackageSymbol)
        continue;
      //只处理最顶层的类
      NestingKind nestingKind = ((TypeElement) element).getNestingKind();
      if (nestingKind != NestingKind.TOP_LEVEL)
View Full Code Here

Examples of javax.lang.model.element.ElementKind

    private boolean isFirstAction = true;

    @Override
    public ControllerElementVisitor visitExecutable(ExecutableElement e, Void v) {
      ElementKind kind = e.getKind();
      if (kind != ElementKind.METHOD)
        return this;

      Set<Modifier> modifiers = e.getModifiers();
      if (!modifiers.contains(Modifier.PUBLIC) || modifiers.contains(Modifier.STATIC))
View Full Code Here

Examples of javax.lang.model.element.ElementKind

    }

    private void validateMemberNames(TypeElement type) {
        Map<String, Element> saw = Maps.create();
        for (Element member : type.getEnclosedElements()) {
            ElementKind kind = member.getKind();
            if (kind != ElementKind.METHOD
                    && kind.isClass() == false
                    && kind.isInterface() == false) {
                continue;
            }
            if (member.getModifiers().contains(Modifier.PUBLIC) == false) {
                continue;
            }
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.