• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    迪恩网络公众号

Java StringCellProcessor类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了Java中org.supercsv.cellprocessor.ift.StringCellProcessor的典型用法代码示例。如果您正苦于以下问题:Java StringCellProcessor类的具体用法?Java StringCellProcessor怎么用?Java StringCellProcessor使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。



StringCellProcessor类属于org.supercsv.cellprocessor.ift包,在下文中一共展示了StringCellProcessor类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的Java代码示例。

示例1: create

import org.supercsv.cellprocessor.ift.StringCellProcessor; //导入依赖的package包/类
/**
 * {@inheritDoc}
 */
@Override
public CellProcessorFactory create(ProcessingMetadata<StrRegEx> metadata) {
    return new CellProcessorFactory() {

        @Override
        public int getOrder() {
            return metadata.getAnnotation().order();
        }

        @Override
        public CellProcessor create(CellProcessor next) {
            return new org.supercsv.cellprocessor.constraint.StrRegEx(metadata.getAnnotation().regex(),
                    (StringCellProcessor) next);
        }
    };
}
 
开发者ID:dmn1k,项目名称:super-csv-declarative,代码行数:20,代码来源:StrRegExCellProcessorProvider.java


示例2: create

import org.supercsv.cellprocessor.ift.StringCellProcessor; //导入依赖的package包/类
/**
 * {@inheritDoc}
 */
@Override
public CellProcessorFactory create(ProcessingMetadata<StrReplace> metadata) {
    return new CellProcessorFactory() {

        @Override
        public int getOrder() {
            return metadata.getAnnotation().order();
        }

        @Override
        public CellProcessor create(CellProcessor next) {
            return new org.supercsv.cellprocessor.StrReplace(metadata.getAnnotation().pattern(), metadata.getAnnotation().replacement(),
                    (StringCellProcessor) next);
        }
    };
}
 
开发者ID:dmn1k,项目名称:super-csv-declarative,代码行数:20,代码来源:StrReplaceCellProcessorProvider.java


示例3: create

import org.supercsv.cellprocessor.ift.StringCellProcessor; //导入依赖的package包/类
/**
 * {@inheritDoc}
 */
@Override
public CellProcessorFactory create(ProcessingMetadata<Truncate> metadata) {
    return new CellProcessorFactory() {

        @Override
        public int getOrder() {
            return metadata.getAnnotation().order();
        }

        @Override
        public CellProcessor create(CellProcessor next) {
            return new org.supercsv.cellprocessor.Truncate(metadata.getAnnotation().maxSize(), metadata.getAnnotation().suffix(),
                    (StringCellProcessor) next);
        }
    };
}
 
开发者ID:dmn1k,项目名称:super-csv-declarative,代码行数:20,代码来源:TruncateCellProcessorProvider.java


示例4: create

import org.supercsv.cellprocessor.ift.StringCellProcessor; //导入依赖的package包/类
/**
 * {@inheritDoc}
 */
@Override
public CellProcessorFactory create(ProcessingMetadata<FmtDate> metadata) {
    return new CellProcessorFactory() {

        @Override
        public int getOrder() {
            return metadata.getAnnotation().order();
        }

        @Override
        public CellProcessor create(CellProcessor next) {
            return new org.supercsv.cellprocessor.FmtDate(metadata.getAnnotation().format(), (StringCellProcessor) next);
        }
    };
}
 
开发者ID:dmn1k,项目名称:super-csv-declarative,代码行数:19,代码来源:FmtDateCellProcessorProvider.java


示例5: create

import org.supercsv.cellprocessor.ift.StringCellProcessor; //导入依赖的package包/类
/**
 * {@inheritDoc}
 */
@Override
public CellProcessorFactory create(ProcessingMetadata<FmtBool> metadata) {
    return new CellProcessorFactory() {

        @Override
        public int getOrder() {
            return metadata.getAnnotation().order();
        }

        @Override
        public CellProcessor create(CellProcessor next) {
            return new org.supercsv.cellprocessor.FmtBool(metadata.getAnnotation().trueValue(), metadata.getAnnotation().falseValue(),
                    (StringCellProcessor) next);
        }
    };
}
 
开发者ID:dmn1k,项目名称:super-csv-declarative,代码行数:20,代码来源:FmtBoolCellProcessorProvider.java


示例6: create

import org.supercsv.cellprocessor.ift.StringCellProcessor; //导入依赖的package包/类
/**
 * {@inheritDoc}
 */
@Override
public CellProcessorFactory create(ProcessingMetadata<com.github.dmn1k.supercsv.io.declarative.annotation.Trim> metadata) {
    return new CellProcessorFactory() {

        @Override
        public int getOrder() {
            return metadata.getAnnotation().order();
        }

        @Override
        public CellProcessor create(CellProcessor next) {
            return new Trim((StringCellProcessor) next);
        }
    };
}
 
开发者ID:dmn1k,项目名称:super-csv-declarative,代码行数:19,代码来源:TrimCellProcessorProvider.java


示例7: create

import org.supercsv.cellprocessor.ift.StringCellProcessor; //导入依赖的package包/类
/**
 * {@inheritDoc}
 */
@Override
public CellProcessorFactory create(ProcessingMetadata<FmtNumber> metadata) {
    return new CellProcessorFactory() {

        @Override
        public int getOrder() {
            return metadata.getAnnotation().order();
        }

        @Override
        public CellProcessor create(CellProcessor next) {
            return new org.supercsv.cellprocessor.FmtNumber(metadata.getAnnotation().decimalFormat(), (StringCellProcessor) next);
        }
    };
}
 
开发者ID:dmn1k,项目名称:super-csv-declarative,代码行数:19,代码来源:FmtNumberCellProcessorProvider.java


示例8: create

import org.supercsv.cellprocessor.ift.StringCellProcessor; //导入依赖的package包/类
@Override
public Optional<CellProcessor> create(final CsvPattern anno, final Optional<CellProcessor> next,
        final FieldAccessor field, final TextFormatter<?> formatter, final Configuration config) {
    
    final int flags = Utils.buildRegexFlags(anno.flags());
    final java.util.regex.Pattern pattern;
    try {
        pattern = java.util.regex.Pattern.compile(anno.regex(), flags);
        
    } catch(PatternSyntaxException e) {
        throw new SuperCsvInvalidAnnotationException(anno, MessageBuilder.create("anno.attr.invalidType")
                .var("property", field.getNameWithClass())
                .varWithAnno("anno", anno.annotationType())
                .var("attrName", "regex")
                .var("attrValue", anno.regex())
                .var("type", "{key.regex}")
                .format(true));
    }
    
    final Pattern processor = next.map(n -> new Pattern(pattern, anno.description(), (StringCellProcessor)n))
            .orElseGet(() -> new Pattern(pattern, anno.description()));
    
    processor.setValidationMessage(anno.message());
    
    return Optional.of(processor);
}
 
开发者ID:mygreen,项目名称:super-csv-annotation,代码行数:27,代码来源:PatternFactory.java


示例9: create

import org.supercsv.cellprocessor.ift.StringCellProcessor; //导入依赖的package包/类
@Override
public Optional<CellProcessor> create(final CsvRightPad anno, final Optional<CellProcessor> next,
        final FieldAccessor field, final TextFormatter<?> formatter, final Configuration config) {
    
    if(anno.size() <= 0) {
        throw new SuperCsvInvalidAnnotationException(anno, MessageBuilder.create("anno.attr.min")
                .var("property", field.getNameWithClass())
                .varWithAnno("anno", anno.annotationType())
                .var("attrName", "size")
                .var("attrValue", anno.size())
                .var("min", 1)
                .format());
    }
    
    final RightPad processor = next.map(n -> new RightPad(anno.size(), anno.padChar(), (StringCellProcessor)n))
            .orElseGet(() -> new RightPad(anno.size(), anno.padChar()));
    
    return Optional.of(processor);
}
 
开发者ID:mygreen,项目名称:super-csv-annotation,代码行数:20,代码来源:RightPadFactory.java


示例10: create

import org.supercsv.cellprocessor.ift.StringCellProcessor; //导入依赖的package包/类
@Override
public Optional<CellProcessor> create(final CsvFullChar anno, final Optional<CellProcessor> next,
        final FieldAccessor field, final TextFormatter<?> formatter, final Configuration config) {
    
    final CharCategory[] categories;
    if(anno.categories().length == 0) {
        categories = CharCategory.values();
    } else {
        categories = anno.categories();
    }
    
    final FullChar processor = next.map(n -> new FullChar(categories, (StringCellProcessor) n))
            .orElseGet(() -> new FullChar(categories));
    
    return Optional.of(processor);
}
 
开发者ID:mygreen,项目名称:super-csv-annotation,代码行数:17,代码来源:FullCharFactory.java


示例11: create

import org.supercsv.cellprocessor.ift.StringCellProcessor; //导入依赖的package包/类
@Override
public Optional<CellProcessor> create(final CsvHalfChar anno, final Optional<CellProcessor> next,
        final FieldAccessor field, final TextFormatter<?> formatter, final Configuration config) {
    
    final CharCategory[] categories;
    if(anno.categories().length == 0) {
        categories = CharCategory.values();
    } else {
        categories = anno.categories();
    }
    
    final HalfChar processor = next.map(n -> new HalfChar(categories, (StringCellProcessor) n))
            .orElseGet(() -> new HalfChar(categories));
    
    return Optional.of(processor);
}
 
开发者ID:mygreen,项目名称:super-csv-annotation,代码行数:17,代码来源:HalfCharFactory.java


示例12: create

import org.supercsv.cellprocessor.ift.StringCellProcessor; //导入依赖的package包/类
@Override
public Optional<CellProcessor> create(final CsvLeftPad anno, final Optional<CellProcessor> next,
        final FieldAccessor field, final TextFormatter<?> formatter, final Configuration config) {
    
    if(anno.size() <= 0) {
        throw new SuperCsvInvalidAnnotationException(anno, MessageBuilder.create("anno.attr.min")
                .var("property", field.getNameWithClass())
                .varWithAnno("anno", anno.annotationType())
                .var("attrName", "size")
                .var("attrValue", anno.size())
                .var("min", 1)
                .format());
    }
    
    final LeftPad processor = next.map(n -> new LeftPad(anno.size(), anno.padChar(), (StringCellProcessor)n))
            .orElseGet(() -> new LeftPad(anno.size(), anno.padChar()));
    
    return Optional.of(processor);
}
 
开发者ID:mygreen,项目名称:super-csv-annotation,代码行数:20,代码来源:LeftPadFactory.java


示例13: create

import org.supercsv.cellprocessor.ift.StringCellProcessor; //导入依赖的package包/类
@Override
public Optional<CellProcessor> create(final CsvRegexReplace anno, final Optional<CellProcessor> next,
        final FieldAccessor field, final TextFormatter<?> formatter, final Configuration config) {
    
    final int flags = Utils.buildRegexFlags(anno.flags());
    final Pattern pattern;
    try {
        pattern = Pattern.compile(anno.regex(), flags);
    } catch(PatternSyntaxException e) {
        throw new SuperCsvInvalidAnnotationException(anno, MessageBuilder.create("anno.attr.invalidType")
                .var("property", field.getNameWithClass())
                .varWithAnno("anno", anno.annotationType())
                .var("attrName", "regex")
                .var("attrValue", anno.regex())
                .var("type", "{key.regex}")
                .format(true));
    }
    
    final String replacement = anno.replacement();
    
    final RegexReplace processor = next.map(n ->  new RegexReplace(pattern, replacement, (StringCellProcessor) n))
            .orElseGet(() -> new RegexReplace(pattern, replacement));
    
    return Optional.of(processor);
}
 
开发者ID:mygreen,项目名称:super-csv-annotation,代码行数:26,代码来源:RegexReplaceFactory.java


示例14: create

import org.supercsv.cellprocessor.ift.StringCellProcessor; //导入依赖的package包/类
@Override
public Optional<CellProcessor> create(final CsvMultiPad anno, final Optional<CellProcessor> next,
        final FieldAccessor field, final TextFormatter<?> formatter, final Configuration config) {
    
    if(anno.size() <= 0) {
        throw new SuperCsvInvalidAnnotationException(anno,
                MessageBuilder.create("anno.attr.min")
                    .var("property", field.getNameWithClass())
                    .varWithAnno("anno", anno.annotationType())
                    .var("attrName", "size")
                    .var("attrValue", anno.size())
                    .var("min", 1)
                    .format());
    }
    
    final PaddingProcessor paddingProcessor = (PaddingProcessor)config.getBeanFactory().create(anno.paddingProcessor());
    
    final MultiPad processor = next.map(n -> new MultiPad(anno.size(), anno.padChar(), anno.rightAlign(),
                anno.chopped(), paddingProcessor, (StringCellProcessor)n))
            .orElseGet(() -> new MultiPad(anno.size(), anno.padChar(), anno.rightAlign(),
                    anno.chopped(), paddingProcessor));
    
    return Optional.of(processor);
}
 
开发者ID:mygreen,项目名称:super-csv-annotation,代码行数:25,代码来源:MultiPadFactory.java


示例15: create

import org.supercsv.cellprocessor.ift.StringCellProcessor; //导入依赖的package包/类
@Override
public Optional<CellProcessor> create(final CsvTruncate anno, final Optional<CellProcessor> next,
        final FieldAccessor field, final TextFormatter<?> formatter, final Configuration config) {
    
    if(anno.maxSize() <= 0) {
        throw new SuperCsvInvalidAnnotationException(anno, MessageBuilder.create("anno.attr.min")
                .var("property", field.getNameWithClass())
                .varWithAnno("anno", anno.annotationType())
                .var("attrName", "maxSize")
                .var("attrValue", anno.maxSize())
                .var("min", 1)
                .format());
    }
    
    final Truncate processor = next.map(n -> new Truncate(anno.maxSize(), anno.suffix(), (StringCellProcessor)n))
            .orElseGet(() -> new Truncate(anno.maxSize(), anno.suffix()));
    
    return Optional.of(processor);
}
 
开发者ID:mygreen,项目名称:super-csv-annotation,代码行数:20,代码来源:TruncateFactory.java


示例16: parseStrReplace

import org.supercsv.cellprocessor.ift.StringCellProcessor; //导入依赖的package包/类
private CellProcessor parseStrReplace(
        final CellProcessor nextProcessor,
        final String def) {

    String[] params = parseParams(def);

    Preconditions.checkArgument(
            params[0].length() > 0 && params[1].length() > 0,
            "regex and replacemenet cannot be empty: " + def);

    StrReplace processor;
    if (nextProcessor != null) {

        Preconditions.checkArgument(
                nextProcessor instanceof StringCellProcessor,
                "the next processor must be of type StringCellProcessor");

        processor = new StrReplace(
                params[0],
                params[1],
                (StringCellProcessor) nextProcessor);
    } else {
        processor = new StrReplace(
                params[0],
                params[1]);
    }
    return processor;
}
 
开发者ID:clidev,项目名称:spike.x,代码行数:29,代码来源:DsvLineParser.java


示例17: create

import org.supercsv.cellprocessor.ift.StringCellProcessor; //导入依赖的package包/类
@Override
public Optional<CellProcessor> create(final CsvDefaultValue anno, final Optional<CellProcessor> next,
        final FieldAccessor field, final TextFormatter<?> formatter, final Configuration config) {
    
    final DefaultValue processor = next.map(n ->  new DefaultValue(anno.value(), (StringCellProcessor) n))
            .orElseGet(() -> new DefaultValue(anno.value()));
    
    return Optional.of(processor);
}
 
开发者ID:mygreen,项目名称:super-csv-annotation,代码行数:10,代码来源:DefaultValueFactory.java


示例18: create

import org.supercsv.cellprocessor.ift.StringCellProcessor; //导入依赖的package包/类
@Override
public Optional<CellProcessor> create(final CsvNullConvert anno, final Optional<CellProcessor> next,
        final FieldAccessor field, final TextFormatter<?> formatter, final Configuration config) {
    
    final Set<String> tokens = Arrays.stream(anno.value())
            .collect(Collectors.toSet());
    
    final NullConvert processor = next.map(n -> new NullConvert(tokens, anno.ignoreCase(), (StringCellProcessor)n))
            .orElseGet(() -> new NullConvert(tokens, anno.ignoreCase()));
    
    return Optional.of(processor);
}
 
开发者ID:mygreen,项目名称:super-csv-annotation,代码行数:13,代码来源:NullConvertFactory.java


示例19: RightPad

import org.supercsv.cellprocessor.ift.StringCellProcessor; //导入依赖的package包/类
public RightPad(final int padSize, final char padChar, final StringCellProcessor next) {
    super(next);
    
    checkPreconditions(padSize);
    this.padSize = padSize;
    this.padChar = padChar;
}
 
开发者ID:mygreen,项目名称:super-csv-annotation,代码行数:8,代码来源:RightPad.java


示例20: create

import org.supercsv.cellprocessor.ift.StringCellProcessor; //导入依赖的package包/类
@Override
public Optional<CellProcessor> create(final CsvTrim anno, final Optional<CellProcessor> next,
        final FieldAccessor field, final TextFormatter<?> formatter, final Configuration config) {
    
    final Trim processor = next.map(n -> new Trim((StringCellProcessor)n))
            .orElseGet(() -> new Trim());
    
    return Optional.of(processor);
}
 
开发者ID:mygreen,项目名称:super-csv-annotation,代码行数:10,代码来源:TrimFactory.java



注:本文中的org.supercsv.cellprocessor.ift.StringCellProcessor类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
Java Versioned类代码示例发布时间:2022-05-22
下一篇:
Java Controller类代码示例发布时间:2022-05-22
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap