Java 类groovy.lang.Grab 实例源码

项目:https-github.com-g0t4-jenkins2-course-spring-boot    文件:DependencyCustomizer.java   
private AnnotationNode createGrabAnnotation(String group, String module,
        String version, String classifier, String type, boolean transitive) {
    AnnotationNode annotationNode = new AnnotationNode(new ClassNode(Grab.class));
    annotationNode.addMember("group", new ConstantExpression(group));
    annotationNode.addMember("module", new ConstantExpression(module));
    annotationNode.addMember("version", new ConstantExpression(version));
    if (classifier != null) {
        annotationNode.addMember("classifier", new ConstantExpression(classifier));
    }
    if (type != null) {
        annotationNode.addMember("type", new ConstantExpression(type));
    }
    annotationNode.addMember("transitive", new ConstantExpression(transitive));
    annotationNode.addMember("initClass", new ConstantExpression(false));
    return annotationNode;
}
项目:spring-boot-concourse    文件:DependencyCustomizer.java   
private AnnotationNode createGrabAnnotation(String group, String module,
        String version, String classifier, String type, boolean transitive) {
    AnnotationNode annotationNode = new AnnotationNode(new ClassNode(Grab.class));
    annotationNode.addMember("group", new ConstantExpression(group));
    annotationNode.addMember("module", new ConstantExpression(module));
    annotationNode.addMember("version", new ConstantExpression(version));
    if (classifier != null) {
        annotationNode.addMember("classifier", new ConstantExpression(classifier));
    }
    if (type != null) {
        annotationNode.addMember("type", new ConstantExpression(type));
    }
    annotationNode.addMember("transitive", new ConstantExpression(transitive));
    annotationNode.addMember("initClass", new ConstantExpression(false));
    return annotationNode;
}
项目:contestparser    文件:DependencyCustomizer.java   
private AnnotationNode createGrabAnnotation(String group, String module,
        String version, String classifier, String type, boolean transitive) {
    AnnotationNode annotationNode = new AnnotationNode(new ClassNode(Grab.class));
    annotationNode.addMember("group", new ConstantExpression(group));
    annotationNode.addMember("module", new ConstantExpression(module));
    annotationNode.addMember("version", new ConstantExpression(version));
    if (classifier != null) {
        annotationNode.addMember("classifier", new ConstantExpression(classifier));
    }
    if (type != null) {
        annotationNode.addMember("type", new ConstantExpression(type));
    }
    annotationNode.addMember("transitive", new ConstantExpression(transitive));
    annotationNode.addMember("initClass", new ConstantExpression(false));
    return annotationNode;
}
项目:https-github.com-g0t4-jenkins2-course-spring-boot    文件:ArchiveCommand.java   
private void visitModule(ModuleNode module) {
    for (ClassNode classNode : module.getClasses()) {
        AnnotationNode annotation = new AnnotationNode(new ClassNode(Grab.class));
        annotation.addMember("value", new ConstantExpression("groovy"));
        classNode.addAnnotation(annotation);
        // We only need to do it at most once
        break;
    }
    // Disable the addition of a static initializer that calls Grape.addResolver
    // because all the dependencies are local now
    disableGrabResolvers(module.getClasses());
    disableGrabResolvers(module.getImports());
}
项目:https-github.com-g0t4-jenkins2-course-spring-boot    文件:DependencyCustomizerTests.java   
@Test
public void basicAdd() {
    this.dependencyCustomizer.add("spring-boot-starter-logging");
    List<AnnotationNode> grabAnnotations = this.classNode
            .getAnnotations(new ClassNode(Grab.class));
    assertThat(grabAnnotations).hasSize(1);
    AnnotationNode annotationNode = grabAnnotations.get(0);
    assertGrabAnnotation(annotationNode, "org.springframework.boot",
            "spring-boot-starter-logging", "1.2.3", null, null, true);
}
项目:https-github.com-g0t4-jenkins2-course-spring-boot    文件:DependencyCustomizerTests.java   
@Test
public void nonTransitiveAdd() {
    this.dependencyCustomizer.add("spring-boot-starter-logging", false);
    List<AnnotationNode> grabAnnotations = this.classNode
            .getAnnotations(new ClassNode(Grab.class));
    assertThat(grabAnnotations).hasSize(1);
    AnnotationNode annotationNode = grabAnnotations.get(0);
    assertGrabAnnotation(annotationNode, "org.springframework.boot",
            "spring-boot-starter-logging", "1.2.3", null, null, false);
}
项目:https-github.com-g0t4-jenkins2-course-spring-boot    文件:DependencyCustomizerTests.java   
@Test
public void fullyCustomized() {
    this.dependencyCustomizer.add("spring-boot-starter-logging", "my-classifier",
            "my-type", false);
    List<AnnotationNode> grabAnnotations = this.classNode
            .getAnnotations(new ClassNode(Grab.class));
    assertThat(grabAnnotations).hasSize(1);
    AnnotationNode annotationNode = grabAnnotations.get(0);
    assertGrabAnnotation(annotationNode, "org.springframework.boot",
            "spring-boot-starter-logging", "1.2.3", "my-classifier", "my-type",
            false);
}
项目:https-github.com-g0t4-jenkins2-course-spring-boot    文件:DependencyCustomizerTests.java   
@Test
public void anyMissingClassesWithMixtureOfClassesPerformsAdd() {
    this.dependencyCustomizer
            .ifAnyMissingClasses(getClass().getName(), "does.not.Exist")
            .add("spring-boot-starter-logging");
    assertThat(this.classNode.getAnnotations(new ClassNode(Grab.class))).hasSize(1);
}
项目:https-github.com-g0t4-jenkins2-course-spring-boot    文件:DependencyCustomizerTests.java   
@Test
public void allMissingClassesWithMixtureOfClassesDoesNotPerformAdd() {
    this.dependencyCustomizer
            .ifAllMissingClasses(getClass().getName(), "does.not.Exist")
            .add("spring-boot-starter-logging");
    assertThat(this.classNode.getAnnotations(new ClassNode(Grab.class))).isEmpty();
}
项目:https-github.com-g0t4-jenkins2-course-spring-boot    文件:DependencyCustomizerTests.java   
@Test
public void allMissingClassesWithAllClassesMissingPerformsAdd() {
    this.dependencyCustomizer
            .ifAllMissingClasses("does.not.Exist", "does.not.exist.Either")
            .add("spring-boot-starter-logging");
    assertThat(this.classNode.getAnnotations(new ClassNode(Grab.class))).hasSize(1);
}
项目:spring-boot-concourse    文件:ArchiveCommand.java   
private void visitModule(ModuleNode module) {
    for (ClassNode classNode : module.getClasses()) {
        AnnotationNode annotation = new AnnotationNode(new ClassNode(Grab.class));
        annotation.addMember("value", new ConstantExpression("groovy"));
        classNode.addAnnotation(annotation);
        // We only need to do it at most once
        break;
    }
    // Disable the addition of a static initializer that calls Grape.addResolver
    // because all the dependencies are local now
    disableGrabResolvers(module.getClasses());
    disableGrabResolvers(module.getImports());
}
项目:spring-boot-concourse    文件:DependencyCustomizerTests.java   
@Test
public void basicAdd() {
    this.dependencyCustomizer.add("spring-boot-starter-logging");
    List<AnnotationNode> grabAnnotations = this.classNode
            .getAnnotations(new ClassNode(Grab.class));
    assertThat(grabAnnotations).hasSize(1);
    AnnotationNode annotationNode = grabAnnotations.get(0);
    assertGrabAnnotation(annotationNode, "org.springframework.boot",
            "spring-boot-starter-logging", "1.2.3", null, null, true);
}
项目:spring-boot-concourse    文件:DependencyCustomizerTests.java   
@Test
public void nonTransitiveAdd() {
    this.dependencyCustomizer.add("spring-boot-starter-logging", false);
    List<AnnotationNode> grabAnnotations = this.classNode
            .getAnnotations(new ClassNode(Grab.class));
    assertThat(grabAnnotations).hasSize(1);
    AnnotationNode annotationNode = grabAnnotations.get(0);
    assertGrabAnnotation(annotationNode, "org.springframework.boot",
            "spring-boot-starter-logging", "1.2.3", null, null, false);
}
项目:spring-boot-concourse    文件:DependencyCustomizerTests.java   
@Test
public void fullyCustomized() {
    this.dependencyCustomizer.add("spring-boot-starter-logging", "my-classifier",
            "my-type", false);
    List<AnnotationNode> grabAnnotations = this.classNode
            .getAnnotations(new ClassNode(Grab.class));
    assertThat(grabAnnotations).hasSize(1);
    AnnotationNode annotationNode = grabAnnotations.get(0);
    assertGrabAnnotation(annotationNode, "org.springframework.boot",
            "spring-boot-starter-logging", "1.2.3", "my-classifier", "my-type",
            false);
}
项目:spring-boot-concourse    文件:DependencyCustomizerTests.java   
@Test
public void anyMissingClassesWithMixtureOfClassesPerformsAdd() {
    this.dependencyCustomizer
            .ifAnyMissingClasses(getClass().getName(), "does.not.Exist")
            .add("spring-boot-starter-logging");
    assertThat(this.classNode.getAnnotations(new ClassNode(Grab.class))).hasSize(1);
}
项目:spring-boot-concourse    文件:DependencyCustomizerTests.java   
@Test
public void allMissingClassesWithMixtureOfClassesDoesNotPerformAdd() {
    this.dependencyCustomizer
            .ifAllMissingClasses(getClass().getName(), "does.not.Exist")
            .add("spring-boot-starter-logging");
    assertThat(this.classNode.getAnnotations(new ClassNode(Grab.class))).isEmpty();
}
项目:spring-boot-concourse    文件:DependencyCustomizerTests.java   
@Test
public void allMissingClassesWithAllClassesMissingPerformsAdd() {
    this.dependencyCustomizer
            .ifAllMissingClasses("does.not.Exist", "does.not.exist.Either")
            .add("spring-boot-starter-logging");
    assertThat(this.classNode.getAnnotations(new ClassNode(Grab.class))).hasSize(1);
}
项目:contestparser    文件:ArchiveCommand.java   
private void visitModule(ModuleNode module) {
    for (ClassNode classNode : module.getClasses()) {
        AnnotationNode annotation = new AnnotationNode(new ClassNode(Grab.class));
        annotation.addMember("value", new ConstantExpression("groovy"));
        classNode.addAnnotation(annotation);
        // We only need to do it at most once
        break;
    }
    // Disable the addition of a static initializer that calls Grape.addResolver
    // because all the dependencies are local now
    disableGrabResolvers(module.getClasses());
    disableGrabResolvers(module.getImports());
}
项目:contestparser    文件:DependencyCustomizerTests.java   
@Test
public void basicAdd() {
    this.dependencyCustomizer.add("spring-boot-starter-logging");
    List<AnnotationNode> grabAnnotations = this.classNode
            .getAnnotations(new ClassNode(Grab.class));
    assertEquals(1, grabAnnotations.size());
    AnnotationNode annotationNode = grabAnnotations.get(0);
    assertGrabAnnotation(annotationNode, "org.springframework.boot",
            "spring-boot-starter-logging", "1.2.3", null, null, true);
}
项目:contestparser    文件:DependencyCustomizerTests.java   
@Test
public void nonTransitiveAdd() {
    this.dependencyCustomizer.add("spring-boot-starter-logging", false);
    List<AnnotationNode> grabAnnotations = this.classNode
            .getAnnotations(new ClassNode(Grab.class));
    assertEquals(1, grabAnnotations.size());
    AnnotationNode annotationNode = grabAnnotations.get(0);
    assertGrabAnnotation(annotationNode, "org.springframework.boot",
            "spring-boot-starter-logging", "1.2.3", null, null, false);
}
项目:contestparser    文件:DependencyCustomizerTests.java   
@Test
public void fullyCustomized() {
    this.dependencyCustomizer.add("spring-boot-starter-logging", "my-classifier",
            "my-type", false);
    List<AnnotationNode> grabAnnotations = this.classNode
            .getAnnotations(new ClassNode(Grab.class));
    assertEquals(1, grabAnnotations.size());
    AnnotationNode annotationNode = grabAnnotations.get(0);
    assertGrabAnnotation(annotationNode, "org.springframework.boot",
            "spring-boot-starter-logging", "1.2.3", "my-classifier", "my-type",
            false);
}
项目:contestparser    文件:DependencyCustomizerTests.java   
@Test
public void anyMissingClassesWithMixtureOfClassesPerformsAdd() {
    this.dependencyCustomizer
            .ifAnyMissingClasses(getClass().getName(), "does.not.Exist")
            .add("spring-boot-starter-logging");
    assertEquals(1, this.classNode.getAnnotations(new ClassNode(Grab.class)).size());
}
项目:contestparser    文件:DependencyCustomizerTests.java   
@Test
public void allMissingClassesWithMixtureOfClassesDoesNotPerformAdd() {
    this.dependencyCustomizer
            .ifAllMissingClasses(getClass().getName(), "does.not.Exist")
            .add("spring-boot-starter-logging");
    assertEquals(0, this.classNode.getAnnotations(new ClassNode(Grab.class)).size());
}
项目:contestparser    文件:DependencyCustomizerTests.java   
@Test
public void allMissingClassesWithAllClassesMissingPerformsAdd() {
    this.dependencyCustomizer
            .ifAllMissingClasses("does.not.Exist", "does.not.exist.Either")
            .add("spring-boot-starter-logging");
    assertEquals(1, this.classNode.getAnnotations(new ClassNode(Grab.class)).size());
}
项目:https-github.com-g0t4-jenkins2-course-spring-boot    文件:DependencyCustomizerTests.java   
@Test
public void anyMissingClassesWithMissingClassesPerformsAdd() {
    this.dependencyCustomizer.ifAnyMissingClasses("does.not.Exist")
            .add("spring-boot-starter-logging");
    assertThat(this.classNode.getAnnotations(new ClassNode(Grab.class))).hasSize(1);
}
项目:https-github.com-g0t4-jenkins2-course-spring-boot    文件:DependencyCustomizerTests.java   
@Test
public void anyMissingClassesWithNoMissingClassesDoesNotPerformAdd() {
    this.dependencyCustomizer.ifAnyMissingClasses(getClass().getName())
            .add("spring-boot-starter-logging");
    assertThat(this.classNode.getAnnotations(new ClassNode(Grab.class))).isEmpty();
}
项目:https-github.com-g0t4-jenkins2-course-spring-boot    文件:DependencyCustomizerTests.java   
@Test
public void allMissingClassesWithNoMissingClassesDoesNotPerformAdd() {
    this.dependencyCustomizer.ifAllMissingClasses(getClass().getName())
            .add("spring-boot-starter-logging");
    assertThat(this.classNode.getAnnotations(new ClassNode(Grab.class))).isEmpty();
}
项目:https-github.com-g0t4-jenkins2-course-spring-boot    文件:ResolveDependencyCoordinatesTransformationTests.java   
private AnnotationNode createGrabAnnotation() {
    ClassNode classNode = new ClassNode(Grab.class);
    AnnotationNode annotationNode = new AnnotationNode(classNode);
    annotationNode.addMember("value", new ConstantExpression("spring-core"));
    return annotationNode;
}
项目:spring-boot-concourse    文件:DependencyCustomizerTests.java   
@Test
public void anyMissingClassesWithMissingClassesPerformsAdd() {
    this.dependencyCustomizer.ifAnyMissingClasses("does.not.Exist")
            .add("spring-boot-starter-logging");
    assertThat(this.classNode.getAnnotations(new ClassNode(Grab.class))).hasSize(1);
}
项目:spring-boot-concourse    文件:DependencyCustomizerTests.java   
@Test
public void anyMissingClassesWithNoMissingClassesDoesNotPerformAdd() {
    this.dependencyCustomizer.ifAnyMissingClasses(getClass().getName())
            .add("spring-boot-starter-logging");
    assertThat(this.classNode.getAnnotations(new ClassNode(Grab.class))).isEmpty();
}
项目:spring-boot-concourse    文件:DependencyCustomizerTests.java   
@Test
public void allMissingClassesWithNoMissingClassesDoesNotPerformAdd() {
    this.dependencyCustomizer.ifAllMissingClasses(getClass().getName())
            .add("spring-boot-starter-logging");
    assertThat(this.classNode.getAnnotations(new ClassNode(Grab.class))).isEmpty();
}
项目:spring-boot-concourse    文件:ResolveDependencyCoordinatesTransformationTests.java   
private AnnotationNode createGrabAnnotation() {
    ClassNode classNode = new ClassNode(Grab.class);
    AnnotationNode annotationNode = new AnnotationNode(classNode);
    annotationNode.addMember("value", new ConstantExpression("spring-core"));
    return annotationNode;
}
项目:contestparser    文件:DependencyCustomizerTests.java   
@Test
public void anyMissingClassesWithMissingClassesPerformsAdd() {
    this.dependencyCustomizer.ifAnyMissingClasses("does.not.Exist")
            .add("spring-boot-starter-logging");
    assertEquals(1, this.classNode.getAnnotations(new ClassNode(Grab.class)).size());
}
项目:contestparser    文件:DependencyCustomizerTests.java   
@Test
public void anyMissingClassesWithNoMissingClassesDoesNotPerformAdd() {
    this.dependencyCustomizer.ifAnyMissingClasses(getClass().getName())
            .add("spring-boot-starter-logging");
    assertEquals(0, this.classNode.getAnnotations(new ClassNode(Grab.class)).size());
}
项目:contestparser    文件:DependencyCustomizerTests.java   
@Test
public void allMissingClassesWithNoMissingClassesDoesNotPerformAdd() {
    this.dependencyCustomizer.ifAllMissingClasses(getClass().getName())
            .add("spring-boot-starter-logging");
    assertEquals(0, this.classNode.getAnnotations(new ClassNode(Grab.class)).size());
}
项目:contestparser    文件:ResolveDependencyCoordinatesTransformationTests.java   
private AnnotationNode createGrabAnnotation() {
    ClassNode classNode = new ClassNode(Grab.class);
    AnnotationNode annotationNode = new AnnotationNode(classNode);
    annotationNode.addMember("value", new ConstantExpression("spring-core"));
    return annotationNode;
}