Java源码示例:org.apache.nifi.annotation.behavior.WritesAttributes

示例1
/**
 * Collects the attributes that a processor is writing to.
 *
 * @param processor the processor to describe
 * @return the list of attributes the processor is writing
 */
private List<WritesAttribute> getWritesAttributes(Processor processor) {
    List<WritesAttribute> attributes = new ArrayList<>();

    WritesAttributes writesAttributes = processor.getClass().getAnnotation(WritesAttributes.class);
    if (writesAttributes != null) {
        attributes.addAll(Arrays.asList(writesAttributes.value()));
    }

    WritesAttribute writeAttribute = processor.getClass().getAnnotation(WritesAttribute.class);
    if (writeAttribute != null) {
        attributes.add(writeAttribute);
    }

    return attributes;
}
 
示例2
/**
 * Collects the attributes that a processor is writing to.
 *
 * @param processor the processor to describe
 * @return the list of attributes the processor is writing
 */
private List<WritesAttribute> getWritesAttributes(Processor processor) {
    List<WritesAttribute> attributes = new ArrayList<>();

    WritesAttributes writesAttributes = processor.getClass().getAnnotation(WritesAttributes.class);
    if (writesAttributes != null) {
        attributes.addAll(Arrays.asList(writesAttributes.value()));
    }

    WritesAttribute writeAttribute = processor.getClass().getAnnotation(WritesAttribute.class);
    if (writeAttribute != null) {
        attributes.add(writeAttribute);
    }

    return attributes;
}
 
示例3
private List<WritesAttribute> getWritesAttributes(Processor processor) {
    List<WritesAttribute> attributes = new ArrayList<>();

    WritesAttributes writesAttributes = processor.getClass().getAnnotation(WritesAttributes.class);
    if (writesAttributes != null) {
        Collections.addAll(attributes, writesAttributes.value());
    }

    WritesAttribute writeAttribute = processor.getClass().getAnnotation(WritesAttribute.class);
    if (writeAttribute != null) {
        attributes.add(writeAttribute);
    }

    return attributes;
}