public class AnnotationConfigsProcessor extends Object
Constructor and Description |
---|
AnnotationConfigsProcessor() |
Modifier and Type | Method and Description |
---|---|
static boolean |
isRecordValueExists(String fieldName,
BLangRecordLiteral record)
Returns True if the value of the field exists, False otherwise.
|
static List<String> |
searchArrayField(String fieldName,
BLangAnnotationAttachment annotation)
Search annotations and returns array field value by field name.
|
static Optional<Object> |
searchArrayField(String fieldName,
BLangRecordLiteral record)
Search records and returns field value object by field name.
|
static Optional<String> |
searchStringField(String fieldName,
BLangAnnotationAttachment annotation)
Search annotations and returns string field value by field name.
|
static Optional<String> |
searchStringField(String fieldName,
BLangRecordLiteral record)
Search records and returns string field value by field name.
|
static void |
visitAnnotation(BLangAnnotationAttachment annotation,
BiConsumer<BLangRecordLiteral.BLangRecordKeyValue,BLangSimpleVarRef> acceptor)
Visit annotation for the provided annotations acceptor.
|
static void |
visitRecords(List<BLangRecordLiteral.BLangRecordKeyValue> records,
BiConsumer<BLangRecordLiteral.BLangRecordKeyValue,BLangSimpleVarRef> acceptor)
Visit each records for the provided annotations acceptor.
|
public static void visitAnnotation(BLangAnnotationAttachment annotation, BiConsumer<BLangRecordLiteral.BLangRecordKeyValue,BLangSimpleVarRef> acceptor)
annotation
- BLangAnnotationAttachment
acceptor
- BiConsumer
annotations acceptorpublic static void visitRecords(List<BLangRecordLiteral.BLangRecordKeyValue> records, BiConsumer<BLangRecordLiteral.BLangRecordKeyValue,BLangSimpleVarRef> acceptor)
records
- list of BLangRecordLiteral.BLangRecordKeyValue
acceptor
- BiConsumer
annotations acceptorpublic static Optional<String> searchStringField(String fieldName, BLangAnnotationAttachment annotation)
fieldName
- field nameannotation
- BLangAnnotationAttachment
public static List<String> searchArrayField(String fieldName, BLangAnnotationAttachment annotation)
fieldName
- field nameannotation
- BLangAnnotationAttachment
public static Optional<String> searchStringField(String fieldName, BLangRecordLiteral record)
fieldName
- field namerecord
- BLangRecordLiteral
public static Optional<Object> searchArrayField(String fieldName, BLangRecordLiteral record)
fieldName
- field namerecord
- BLangRecordLiteral
Object
or null otherwisepublic static boolean isRecordValueExists(String fieldName, BLangRecordLiteral record)
fieldName
- field namerecord
- BLangRecordLiteral
Copyright © 2019 WSO2. All rights reserved.