当前位置: 首页>>代码示例>>Java>>正文


Java StringCellProcessor类代码示例

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


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


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