public class JsonPropertyTrait extends Object implements Trait<JsonPropertyTrait>
Modifier and Type | Class and Description |
---|---|
static class |
JsonPropertyTrait.Kind
The field kind.
|
Constructor and Description |
---|
JsonPropertyTrait(AstAttribute attribute,
JsonPropertyTrait.Kind kind)
Creates a new instance.
|
JsonPropertyTrait(AstAttribute attribute,
String name,
JsonPropertySettings settings)
Creates a new instance.
|
Modifier and Type | Method and Description |
---|---|
static Optional<JsonPropertyTrait> |
find(PropertyDeclaration property)
Returns the trait for the property.
|
static JsonPropertyTrait |
get(PropertyDeclaration property)
Returns the trait for the property.
|
JsonPropertyTrait.Kind |
getKind()
Returns the field kind.
|
static JsonPropertyTrait.Kind |
getKind(PropertyDeclaration property)
Returns the field kind of the property.
|
Optional<String> |
getName()
Returns the field name.
|
static String |
getName(PropertyDeclaration property)
Returns the field name of the property.
|
AstNode |
getOriginalAst()
Returns the corresponded syntactic element of this.
|
JsonPropertySettings |
getSettings()
Returns the settings.
|
static JsonPropertySettings |
getSettings(PropertyDeclaration property)
Returns the field settings of the property.
|
public JsonPropertyTrait(AstAttribute attribute, JsonPropertyTrait.Kind kind)
attribute
- the original attributekind
- the field kindIllegalArgumentException
- if some parameters were null
public JsonPropertyTrait(AstAttribute attribute, String name, JsonPropertySettings settings)
attribute
- the original attributename
- the explicit field name (nullable)settings
- the field settingsIllegalArgumentException
- if some parameters were null
public AstNode getOriginalAst()
Element
getOriginalAst
in interface Element
null
if unknownpublic static Optional<JsonPropertyTrait> find(PropertyDeclaration property)
property
- the propertypublic static JsonPropertyTrait get(PropertyDeclaration property)
property
- the propertypublic static JsonPropertyTrait.Kind getKind(PropertyDeclaration property)
property
- target propertypublic static String getName(PropertyDeclaration property)
property
- target propertypublic static JsonPropertySettings getSettings(PropertyDeclaration property)
property
- target propertypublic JsonPropertyTrait.Kind getKind()
public JsonPropertySettings getSettings()
Copyright © 2011–2019 Asakusa Framework Team. All rights reserved.