public class AttributeAnalyzer extends Object
Modifier and Type | Field and Description |
---|---|
static String |
VALUE_FALSE
The value name of
false . |
static String |
VALUE_NULL
The value name of
null . |
static String |
VALUE_TRUE
The value name of
true . |
Constructor and Description |
---|
AttributeAnalyzer(DmdlSemantics environment,
AstAttribute attribute)
Creates a new instance.
|
Modifier and Type | Method and Description |
---|---|
void |
error(AstAttributeElement element,
AstAttributeValueMap.Entry entry,
String message,
Object... arguments)
Reports an error.
|
void |
error(AstAttributeElement element,
String message,
Object... arguments)
Reports an error.
|
boolean |
hasError()
Whether or not errors were occurred.
|
Value<Boolean> |
toBoolean(AstAttributeElement element)
Analyze the given element as a boolean value.
|
Value<Character> |
toCharacter(AstAttributeElement element)
Analyze the given element as a character value.
|
MapValue<Character,Character> |
toCharacterMapWithNullValue(AstAttributeElement element)
Analyze the given element as a character map.
|
Value<Charset> |
toCharset(AstAttributeElement element)
Analyze the given element as a character set.
|
Value<ClassName> |
toClassName(AstAttributeElement element)
Analyze the given element as a class name.
|
Value<ClassName> |
toClassName(AstAttributeElement element,
Function<String,Optional<String>> resolver)
Analyze the given element as a class name.
|
Value<DatePattern> |
toDatePattern(AstAttributeElement element)
Analyze the given element as a date format.
|
Value<DecimalPattern> |
toDecimalPatternWithNull(AstAttributeElement element)
Analyze the given element as a decimal format.
|
<T extends Enum<T>> |
toEnumConstant(AstAttributeElement element,
Class<T> type)
Analyze the given element as an enum constant.
|
Value<String> |
toString(AstAttributeElement element)
Analyze the given element as a string value.
|
Value<String> |
toStringWithNull(AstAttributeElement element)
Analyze the given element as a nullable string value.
|
Value<ZoneId> |
toZoneIdWithNull(AstAttributeElement element)
Analyze the given element as a time-zone ID.
|
void |
warn(AstAttributeElement element,
AstAttributeValueMap.Entry entry,
String message,
Object... arguments)
Reports a warning.
|
void |
warn(AstAttributeElement element,
String message,
Object... arguments)
Reports a warning.
|
public static final String VALUE_NULL
null
.public static final String VALUE_TRUE
true
.public static final String VALUE_FALSE
false
.public AttributeAnalyzer(DmdlSemantics environment, AstAttribute attribute)
environment
- the current environmentattribute
- the source attributepublic boolean hasError()
true
if occurredpublic Value<String> toString(AstAttributeElement element)
element
- the target elementpublic Value<String> toStringWithNull(AstAttributeElement element)
element
- the target elementpublic Value<Boolean> toBoolean(AstAttributeElement element)
element
- the target elementpublic Value<Character> toCharacter(AstAttributeElement element)
element
- the target elementpublic Value<Charset> toCharset(AstAttributeElement element)
element
- the target elementpublic Value<DecimalPattern> toDecimalPatternWithNull(AstAttributeElement element)
element
- the target elementpublic Value<DatePattern> toDatePattern(AstAttributeElement element)
element
- the target elementpublic Value<ZoneId> toZoneIdWithNull(AstAttributeElement element)
element
- the target elementpublic Value<ClassName> toClassName(AstAttributeElement element)
element
- the target elementpublic <T extends Enum<T>> Value<T> toEnumConstant(AstAttributeElement element, Class<T> type)
T
- the enum typeelement
- the target elementtype
- the enum typepublic Value<ClassName> toClassName(AstAttributeElement element, Function<String,Optional<String>> resolver)
element
- the target elementresolver
- the resolverpublic MapValue<Character,Character> toCharacterMapWithNullValue(AstAttributeElement element)
element
- the target elementpublic void error(AstAttributeElement element, String message, Object... arguments)
element
- the target elementmessage
- the error message pattern, {0}
is reserved for the element patharguments
- the pattern argumentspublic void error(AstAttributeElement element, AstAttributeValueMap.Entry entry, String message, Object... arguments)
element
- the target elemententry
- the map entrymessage
- the error message pattern, {0}
is reserved for the element patharguments
- the pattern argumentspublic void warn(AstAttributeElement element, String message, Object... arguments)
element
- the target elementmessage
- the error message pattern, {0}
is reserved for the element patharguments
- the pattern argumentspublic void warn(AstAttributeElement element, AstAttributeValueMap.Entry entry, String message, Object... arguments)
element
- the target elemententry
- the map entrymessage
- the error message pattern, {0}
is reserved for the element patharguments
- the pattern argumentsCopyright © 2011–2019 Asakusa Framework Team. All rights reserved.