Search in sources :

Example 16 with BLangAnnotationAttachmentPoint

use of org.wso2.ballerinalang.compiler.tree.BLangAnnotationAttachmentPoint in project ballerina by ballerina-lang.

the class AnnotationAttachment method convertToPackageModel.

/**
 * Converts a {@link org.ballerinalang.model.AnnotationAttachment} to {@link AnnotationAttachment}.
 * @param annotationAttachment The langconstruct to be converted.
 * @return Converted langconstruct.
 */
public static AnnotationAttachment convertToPackageModel(BLangAnnotationAttachmentPoint annotationAttachment) {
    if (null != annotationAttachment) {
        AnnotationAttachment tempAnnotationAttachment = new AnnotationAttachment();
        // tempAnnotationAttachment.setPackagePath(annotationAttachment.getPkgPath());
        BLangAnnotationAttachmentPoint.AttachmentPoint attachmentPoint = annotationAttachment.getAttachmentPoint();
        if (attachmentPoint != null) {
            tempAnnotationAttachment.setAttachedPoint(attachmentPoint.getValue());
        }
        return tempAnnotationAttachment;
    } else {
        return null;
    }
}
Also used : BLangAnnotationAttachment(org.wso2.ballerinalang.compiler.tree.BLangAnnotationAttachment) BLangAnnotationAttachmentPoint(org.wso2.ballerinalang.compiler.tree.BLangAnnotationAttachmentPoint)

Aggregations

BLangAnnotationAttachmentPoint (org.wso2.ballerinalang.compiler.tree.BLangAnnotationAttachmentPoint)16 SymbolEnv (org.wso2.ballerinalang.compiler.semantics.model.SymbolEnv)12 BSymbol (org.wso2.ballerinalang.compiler.semantics.model.symbols.BSymbol)7 BType (org.wso2.ballerinalang.compiler.semantics.model.types.BType)4 Arrays (java.util.Arrays)2 List (java.util.List)2 Optional (java.util.Optional)2 Set (java.util.Set)2 Collectors (java.util.stream.Collectors)2 BStructSymbol (org.wso2.ballerinalang.compiler.semantics.model.symbols.BStructSymbol)2 BLangAnnotationAttachment (org.wso2.ballerinalang.compiler.tree.BLangAnnotationAttachment)2 BLangEndpoint (org.wso2.ballerinalang.compiler.tree.BLangEndpoint)2 CaseFormat (com.google.common.base.CaseFormat)1 Gson (com.google.gson.Gson)1 JsonArray (com.google.gson.JsonArray)1 JsonElement (com.google.gson.JsonElement)1 JsonNull (com.google.gson.JsonNull)1 JsonObject (com.google.gson.JsonObject)1 JsonParser (com.google.gson.JsonParser)1 JsonPrimitive (com.google.gson.JsonPrimitive)1