Package com.google.java.contract.core.model

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


    "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

   * @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

    /* Root type. */
    rootMirror = e;

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

    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

TOP

Related Classes of com.google.java.contract.core.model.ElementKind

Copyright © 2018 www.massapicom. 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.