Java 类com.amazonaws.services.simpleworkflow.flow.annotations.Workflow 实例源码

项目:aws-swf-build-tools    文件:ProcessorUtils.java   
public static List<com.amazonaws.eclipse.simpleworkflow.asynchrony.objectmodel.Workflow> getAllSuperWorkflows(
        ProcessingEnvironment processingEnv, TypeElement workflow, DeclaredType workflowAnnotationType,
        Set<DeclaredType> annotationsToExcludeFromCopying) {

    List<com.amazonaws.eclipse.simpleworkflow.asynchrony.objectmodel.Workflow> superWorkflows = new ArrayList<com.amazonaws.eclipse.simpleworkflow.asynchrony.objectmodel.Workflow>();

    for (TypeMirror superInterfaceType : workflow.getInterfaces()) {
        Element superInterfaceDeclaration = processingEnv.getTypeUtils().asElement(superInterfaceType);
        Workflow annotation = superInterfaceDeclaration != null ? superInterfaceDeclaration.getAnnotation(Workflow.class) : null;

        if (annotation != null) {
            superWorkflows.add(getWorkflowModel(processingEnv, (TypeElement) superInterfaceDeclaration,
                    workflowAnnotationType, annotationsToExcludeFromCopying));
        }
    }

    return superWorkflows;
}
项目:aws-swf-build-tools    文件:WorkflowValidator.java   
@Override
public Boolean visitType(TypeElement e, ProcessingEnvironment p) {
    if (e.getAnnotation(Workflow.class) != null) {
        if (e.getKind().isClass()) {
            reportError(p, "@Workflow can only be used on an interface.", e);
        }

        if (e.getNestingKind().isNested()) {
            reportError(p, "@Workflow not allowed on inner or nested types.", e);
        }
    }

    return super.visitType(e, p);
}
项目:aws-swf-build-tools    文件:ProcessorUtils.java   
public static com.amazonaws.eclipse.simpleworkflow.asynchrony.objectmodel.Workflow getWorkflowModel(
        ProcessingEnvironment processingEnv, TypeElement workflow, DeclaredType workflowAnnotationType,
        Set<DeclaredType> annotationsToExcludeFromCopying) {

    WorkflowTypeVisitor visitor = new WorkflowTypeVisitor(processingEnv, (TypeElement) workflow, workflowAnnotationType,
            annotationsToExcludeFromCopying);
    visitor.scan(workflow, processingEnv);
    return visitor.getWorkflowDefinition();
}