void endCompilationUnit(Set<Whitespace> ws) { compUnit.addWS(ws); }
public static OperatorKind valueFrom(String opValue) { for (OperatorKind operatorKind : OperatorKind.values()) { if (operatorKind.opValue.equals(opValue)) { return operatorKind; } } return null; } }
@Override public String toString() { return String.valueOf(this.lhsExpr) + " " + this.opKind.value() + " " + this.targetType; } }
@Override public void process(ServiceNode serviceData, List<AnnotationAttachmentNode> annotations) { List<BLangFunction> resources = (List<BLangFunction>) serviceData.getResources(); resources.forEach(res -> validate(serviceData.getName().getValue(), res, this.dlog)); }
private String getOutputFilePath(ServiceNode serviceNode) { String cUnit = serviceNode.getPosition().getSource().getCompilationUnitName(); String dir = cUnit.substring(0, cUnit.lastIndexOf(File.separator) + 1); String file = serviceNode.getName().getValue().toLowerCase(Locale.ENGLISH) + "_client.bal"; return dir + file; }
@Override public void process(ServiceNode serviceNode, List<AnnotationAttachmentNode> annotations) { for (AnnotationAttachmentNode attachmentNode : annotations) { String annotationKey = attachmentNode.getAnnotationName().getValue(); try { AnnotationProcessorFactory.getAnnotationProcessorInstance(annotationKey).processAnnotation (serviceNode, attachmentNode); } catch (KubernetesPluginException e) { dlog.logDiagnostic(Diagnostic.Kind.ERROR, serviceNode.getPosition(), e.getMessage()); } } }
@Override public void process(FunctionNode functionNode, List<AnnotationAttachmentNode> annotations) { for (AnnotationAttachmentNode attachmentNode : annotations) { String annotationKey = attachmentNode.getAnnotationName().getValue(); try { AnnotationProcessorFactory.getAnnotationProcessorInstance(annotationKey).processAnnotation (functionNode, attachmentNode); } catch (KubernetesPluginException e) { dlog.logDiagnostic(Diagnostic.Kind.ERROR, functionNode.getPosition(), e.getMessage()); } } }
@Override public void visit(BLangStreamAction streamAction) { streamActionClause = new StringBuilder("insert into "); String streamName = "stream" + streamAction.getInvokableBody().getFunctionNode().getName().getValue(); streamName = streamName.replaceAll("\\$", "_"); streamActionClause.append(streamName); }
private static BType getMessageBType(BLangExpression attributeValue) { BType requestType = null; if (NodeKind.SIMPLE_VARIABLE_REF.equals(attributeValue.getKind())) { requestType = ((BLangSimpleVarRef) attributeValue).symbol.getType(); } else if (NodeKind.TYPEDESC_EXPRESSION.equals(attributeValue.getKind())) { requestType = ((BLangTypedescExpr) attributeValue).resolvedType; } return requestType; }
void endMarkDownDocumentLine(Set<Whitespace> ws) { MarkdownDocumentationNode markdownDocumentationNode = markdownDocumentationStack.peek(); markdownDocumentationNode.addWS(ws); }
private static IdentifierNode createIdentifier(String value) { IdentifierNode node = TreeBuilder.createIdentifierNode(); if (value != null) { node.setValue(value); } return node; }
void endCallableParamList(Set<Whitespace> ws) { this.invokableNodeStack.peek().addWS(ws); }
private void attachDeprecatedNode(DocumentableNode documentableNode) { if (!deprecatedAttachmentStack.empty()) { documentableNode.addDeprecatedAttachment(deprecatedAttachmentStack.pop()); } }
private void attachMarkdownDocumentations(DocumentableNode documentableNode) { if (!markdownDocumentationStack.empty()) { documentableNode.setMarkdownDocumentationAttachment(markdownDocumentationStack.pop()); } }
void addAttachPoint(AttachPoint attachPoint, Set<Whitespace> ws) { attachPointStack.push(attachPoint); this.annotationStack.peek().addWS(ws); }
private void generateAnnotations(AnnotatableNode node, String key, BLangFunction target, BLangSimpleVariable annMapVar) { if (node.getAnnotationAttachments().size() == 0) { return; } BLangSimpleVariable entryVar = createAnnotationMapEntryVar(key, annMapVar, target.body, target.symbol); int annCount = 0; for (AnnotationAttachmentNode attachment : node.getAnnotationAttachments()) { initAnnotation((BLangAnnotationAttachment) attachment, entryVar, target.body, target.symbol, annCount++); } }
void endMarkdownDocumentationString(Set<Whitespace> ws) { MarkdownDocumentationNode markdownDocumentationNode = markdownDocumentationStack.peek(); markdownDocumentationNode.addWS(ws); }
private IdentifierNode createIdentifier(String value) { IdentifierNode node = TreeBuilder.createIdentifierNode(); if (value != null) { node.setValue(value); } return node; }
void endParameterDocumentationLine(Set<Whitespace> ws) { MarkdownDocumentationNode markdownDocumentationNode = markdownDocumentationStack.peek(); markdownDocumentationNode.addWS(ws); }