public class CsvFieldTrait extends Object implements Trait<CsvFieldTrait>
Modifier and Type | Class and Description |
---|---|
static class |
CsvFieldTrait.Kind
The field kind.
|
static class |
CsvFieldTrait.QuoteStrategy
Column quoting strategy.
|
Constructor and Description |
---|
CsvFieldTrait(AstNode originalAst,
CsvFieldTrait.Kind kind,
String name)
Creates a new instance.
|
CsvFieldTrait(AstNode originalAst,
CsvFieldTrait.Kind kind,
String name,
CsvFieldTrait.QuoteStrategy quote)
Creates a new instance.
|
Modifier and Type | Method and Description |
---|---|
static String |
getFieldName(PropertyDeclaration property)
Returns the CSV field name of the property.
|
static CsvFieldTrait.Kind |
getKind(PropertyDeclaration property,
CsvFieldTrait.Kind defaultKind)
Returns the CSV field kind of the property.
|
AstNode |
getOriginalAst()
Returns the corresponded syntactic element of this.
|
static CsvFieldTrait.QuoteStrategy |
getQuoteStrategy(PropertyDeclaration property)
Returns the quoting strategy for the CSV field property.
|
public CsvFieldTrait(AstNode originalAst, CsvFieldTrait.Kind kind, String name)
originalAst
- the original AST, or null
if this is an ad-hoc elementkind
- the field kindname
- the explicit field name (nullable)IllegalArgumentException
- if some parameters were null
public CsvFieldTrait(AstNode originalAst, CsvFieldTrait.Kind kind, String name, CsvFieldTrait.QuoteStrategy quote)
originalAst
- the original AST, or null
if this is an ad-hoc elementkind
- the field kindname
- the explicit field name (nullable)quote
- quoting strategy (nullable)IllegalArgumentException
- if some parameters were null
public AstNode getOriginalAst()
Element
getOriginalAst
in interface Element
null
if unknownpublic static CsvFieldTrait.Kind getKind(PropertyDeclaration property, CsvFieldTrait.Kind defaultKind)
property
- target propertydefaultKind
- default kindIllegalArgumentException
- if some parameters were null
public static String getFieldName(PropertyDeclaration property)
property
- target propertyIllegalArgumentException
- if some parameters were null
public static CsvFieldTrait.QuoteStrategy getQuoteStrategy(PropertyDeclaration property)
property
- the target propertyIllegalArgumentException
- if some parameters were null
Copyright © 2011–2019 Asakusa Framework Team. All rights reserved.