code
stringlengths
73
34.1k
label
stringclasses
1 value
public ListSessionsResponse listSessions(ListSessionsRequest request) { checkNotNull(request, "The parameter request should NOT be null."); InternalRequest internalRequest = createRequest(HttpMethodName.GET, request, LIVE_SESSION); if (request.getStatus() != null) { checkStringNotEm...
java
public ListAppResponse listApp(ListAppRequest request) { checkNotNull(request, "The parameter request should NOT be null."); InternalRequest internalRequest = createRequest(HttpMethodName.GET, request, LIVE_APP); return invokeHttpClient(internalRequest, ListAppResponse.class); }
java
public ListAppStreamsResponse listAppStreams(String app) { ListAppStreamsRequest request = new ListAppStreamsRequest(); request.setApp(app); return listAppStreams(request); }
java
public StartRecordingResponse startRecording(String sessionId, String recording) { checkStringNotEmpty(sessionId, "The parameter sessionId should NOT be null or empty string."); checkStringNotEmpty(recording, "The parameter recording should NOT be null or empty string."); StartRecordingRequest r...
java
public StopRecordingResponse stopRecording(String sessionId) { checkStringNotEmpty(sessionId, "The parameter sessionId should NOT be null or empty string."); StopRecordingRequest request = new StopRecordingRequest().withSessionId(sessionId); InternalRequest internalRequest = createRequest(HttpMe...
java
public GetSessionSourceInfoResponse getSessionSourceInfo(String sessionId) { checkStringNotEmpty(sessionId, "The parameter sessionId should NOT be null or empty string."); GetSessionSourceInfoRequest request = new GetSessionSourceInfoRequest(); InternalRequest internalRequest = createRequest(Htt...
java
public GetRecordingResponse getRecording(String recording) { checkStringNotEmpty(recording, "The parameter recording should NOT be null or empty string."); GetRecordingRequest request = new GetRecordingRequest(); InternalRequest internalRequest = createRequest(HttpMethodName.GET, request, RECORD...
java
public ListRecordingsResponse listRecordings() { GetRecordingRequest request = new GetRecordingRequest(); InternalRequest internalRequest = createRequest(HttpMethodName.GET, request, RECORDING); return invokeHttpClient(internalRequest, ListRecordingsResponse.class); }
java
public ListNotificationsResponse listNotifications() { ListNotificationsRequest request = new ListNotificationsRequest(); InternalRequest internalRequest = createRequest(HttpMethodName.GET, request, LIVE_NOTIFICATION); return invokeHttpClient(internalRequest, ListNotificationsResponse.class); ...
java
public CreateNotificationResponse createNotification(CreateNotificationRequest request) { checkNotNull(request, "The parameter request should NOT be null."); checkStringNotEmpty(request.getName(), "The parameter name should NOT be null or empty string."); checkStringNotEmpty(req...
java
public ListSecurityPoliciesResponse listSecurityPolicies() { ListSecurityPoliciesRequest request = new ListSecurityPoliciesRequest(); InternalRequest internalRequest = createRequest(HttpMethodName.GET, request, LIVE_SECURITY_POLICY); return invokeHttpClient(internalRequest, ListSecurityPoliciesR...
java
public ListDomainAppResponse listDomainApp(ListDomainAppRequest request) { checkNotNull(request, "The parameter request should NOT be null."); checkStringNotEmpty(request.getPlayDomain(), "playDomain should NOT be empty."); InternalRequest internalRequest = createRequest(HttpMethodName.GET, ...
java
public void updateStreamPresets(UpdateStreamPresetsRequest request) { checkNotNull(request, "The parameter request should NOT be null."); checkStringNotEmpty(request.getDomain(), "Domain should NOT be empty."); checkStringNotEmpty(request.getApp(), "App should NOT be empty"); checkStrin...
java
public void updateStreamPresets(String domain, String app, String stream, Map<String, String> presets) { UpdateStreamPresetsRequest request = new UpdateStreamPresetsRequest() .withDomain(domain) .withApp(app) .withStream(stream) .withPresets(preset...
java
public void updateStreamRecording(UpdateStreamRecordingRequest request) { checkNotNull(request, "The parameter request should NOT be null."); checkStringNotEmpty(request.getDomain(), "Domain should NOT be empty."); checkStringNotEmpty(request.getApp(), "App should NOT be empty"); checkS...
java
public void updateStreamRecording(String domain, String app, String stream, String recording) { UpdateStreamRecordingRequest request = new UpdateStreamRecordingRequest() .withDomain(domain) .withApp(app) .withStream(stream) .withRecording(recording...
java
public void updateStreamPullUrl(UpdateStreamPullUrlRequest request) { checkNotNull(request, "The parameter request should NOT be null."); checkStringNotEmpty(request.getDomain(), "Domain should NOT be empty."); checkStringNotEmpty(request.getApp(), "App should NOT be empty"); checkStrin...
java
public void updateStreamPullUrl(String domain, String app, String stream, String pullUrl) { UpdateStreamPullUrlRequest request = new UpdateStreamPullUrlRequest() .withDomain(domain) .withApp(app) .withStream(stream) .withPullUrl(pullUrl); u...
java
public void updateStreamDestinationPushUrl(UpdateStreamDestinationPushUrlRequest request) { checkNotNull(request, "The parameter request should NOT be null."); checkStringNotEmpty(request.getDomain(), "Domain should NOT be empty."); checkStringNotEmpty(request.getApp(), "App should NOT be empty...
java
public GetDomainStatisticsResponse getDomainStatistics(GetDomainStatisticsRequest request) { checkNotNull(request, "The parameter request should NOT be null."); checkStringNotEmpty(request.getDomain(), "Domain should NOT be empty."); InternalRequest internalRequest = createRequest(HttpMethodNam...
java
public GetDomainStatisticsResponse getDomainStatistics(String domain) { GetDomainStatisticsRequest request = new GetDomainStatisticsRequest(); request.setDomain(domain); return getDomainStatistics(request); }
java
public GetAllDomainsPlayCountResponse getAllDomainsPlayCount(GetAllDomainsStatisticsRequest request) { checkNotNull(request, "The parameter request should NOT be null."); checkStringNotEmpty(request.getTimeInterval(), "timeInterval should NOT be null"); checkStringNotEmpty(request.getStartTime(...
java
public GetOneDomainPlayCountResponse getOneDomainPlayCount(GetOneDomainStatisticsRequest request) { checkNotNull(request, "The parameter request should NOT be null."); checkNotNull(request.getDomain(), "The domain parameter can not be null"); checkStringNotEmpty(request.getTimeInterval(), "time...
java
public ListDomainStatisticsResponse listDomainStatistics(ListDomainStatisticsRequest request) { checkNotNull(request, "The parameter request should NOT be null."); checkStringNotEmpty(request.getStartTime(), "startTime should NOT be empty"); InternalRequest internalRequest = createRequest(Http...
java
public ListStreamStatisticsResponse listStreamStatistics(ListStreamStatisticsRequest request) { checkNotNull(request, "The parameter request should NOT be null."); checkStringNotEmpty(request.getDomain(), "Domain should NOT be null"); checkStringNotEmpty(request.getApp(), "App should NOT be nul...
java
public GetStreamStatisticsResponse getStreamStatistics(GetStreamStatisticsRequest request) { checkNotNull(request, "The parameter request should NOT be null."); checkStringNotEmpty(request.getDomain(), "Domain should NOT be null"); checkStringNotEmpty(request.getApp(), "App should NOT be null")...
java
public CreateVpcResponse createVpc(String name, String cidr) { CreateVpcRequest request = new CreateVpcRequest(); request.withName(name).withCidr(cidr); return createVpc(request); }
java
public ListVpcsResponse listVpcs(ListVpcsRequest request) { checkNotNull(request, "request should not be null."); InternalRequest internalRequest = this.createRequest(request, HttpMethodName.GET, VPC_PREFIX); if (request.getMarker() != null) { internalRequest.addParameter("marker", r...
java
public GetVpcResponse getVpc(GetVpcRequest getVpcRequest) { checkNotNull(getVpcRequest, "request should not be null."); checkNotNull(getVpcRequest.getVpcId(), "request vpcId should not be null."); InternalRequest internalRequest = this.createRequest( getVpcRequest, HttpMethodName...
java
public void modifyInstanceAttributes(String name, String vpcId) { ModifyVpcAttributesRequest request = new ModifyVpcAttributesRequest(); modifyInstanceAttributes(request.withName(name).withVpcId(vpcId)); }
java
public GetClusterResponse getCluster(GetClusterRequest request) { checkNotNull(request, "request should not be null."); checkStringNotEmpty(request.getClusterId(), "The parameter clusterId should not be null or empty string."); InternalRequest internalRequest = this.createRequest( ...
java
public void modifyInstanceGroups(ModifyInstanceGroupsRequest request) { checkNotNull(request, "request should not be null."); checkStringNotEmpty(request.getClusterId(), "The clusterId should not be null or empty string."); checkNotNull(request.getInstanceGroups(), "The instanceGroups should not...
java
public void terminateCluster(TerminateClusterRequest request) { checkNotNull(request, "request should not be null."); checkStringNotEmpty(request.getClusterId(), "The parameter clusterId should not be null or empty string."); InternalRequest internalRequest = this.createRequest( ...
java
public ListInstanceGroupsResponse listInstanceGroups(ListInstanceGroupsRequest request) { checkNotNull(request, "request should not be null."); checkStringNotEmpty(request.getClusterId(), "The parameter clusterId should not be null or empty string."); InternalRequest internalRequest = this.crea...
java
public ListInstancesResponse listInstances(ListInstancesRequest request) { checkNotNull(request, "request should not be null."); checkStringNotEmpty(request.getClusterId(), "The parameter clusterId should not be null or empty string."); checkStringNotEmpty(request.getInstanceGroupId(), ...
java
public ListInstancesResponse listInstances(String clusterId, String instanceGroupId) { return listInstances(new ListInstancesRequest().withClusterId(clusterId).withInstanceGroupId(instanceGroupId)); }
java
public AddStepsResponse addSteps(AddStepsRequest request) { checkNotNull(request, "request should not be null."); checkNotNull(request.getSteps(), "The parameter steps should not be null."); checkStringNotEmpty(request.getClusterId(), "The parameter clusterId should not be null or empty string."...
java
public GetDocumentImagesResponse getDocumentImages(String documentId) { checkNotNull(documentId, "documentId should not be null."); GetDocumentImagesRequest request = new GetDocumentImagesRequest(); request.setDocumentId(documentId); InternalRequest internalRequest = this.createRequest(H...
java
public ListDocumentsResponse listDocuments() { ListDocumentsRequest request = new ListDocumentsRequest(); InternalRequest internalRequest = this.createRequest(HttpMethodName.GET, request, DOC); ListDocumentsResponse response; try { response = this.invokeHttpClient(internalReq...
java
public GetDocumentDownloadResponse getDocumentDownload(String documentId) { checkNotNull(documentId, "documentId should not be null."); GetDocumentDownloadRequest request = new GetDocumentDownloadRequest(); request.setDocumentId(documentId); InternalRequest internalRequest = this.createR...
java
public void setMode(String mode) { checkNotNull(mode, "mode should not be null"); if (MODE_ASYNC.equals(mode) || MODE_SYNC.equals(mode)) { this.mode = mode; } else { throw new IllegalArgumentException("illegal mode: " + mode); } }
java
public AddStepsRequest withStep(StepConfig step) { if (this.steps == null) { this.steps = new ArrayList<StepConfig>(); } this.steps.add(step); return this; }
java
public static String generateHostHeader(URI uri) { String host = uri.getHost(); if (isUsingNonDefaultPort(uri)) { host += ":" + uri.getPort(); } return host; }
java
public Key withAttribute(String attributeName, AttributeValue value) { if (this.attributes == null) { this.attributes = new HashMap<String, AttributeValue>(); } attributes.put(attributeName, value); return this; }
java
private void initEngine() { engine = (NashornScriptEngine) new ScriptEngineManager().getEngineByName("nashorn"); try { engine.eval("(function(global){global.global = global})(this);"); engine.eval(NashornVueTemplateCompiler.NASHORN_VUE_TEMPLATE_COMPILER); } catch (ScriptException e) { e.p...
java
public VueTemplateCompilerResult compile(String htmlTemplate) throws VueTemplateCompilerException { ScriptObjectMirror templateCompilerResult; try { templateCompilerResult = (ScriptObjectMirror) engine.invokeFunction("compile", htmlTemplate); } catch (ScriptException | NoSuchMethodExce...
java
public static boolean isMethodVisibleInTemplate(ExecutableElement method) { return isMethodVisibleInJS(method) && !hasAnnotation(method, Computed.class) && !hasAnnotation(method, Watch.class) && !hasAnnotation(method, PropValidator.class) && !hasAnnotation(method, PropDefault.class) ...
java
public static int getSuperComponentCount(TypeElement component) { return getSuperComponentType(component) .map(superComponent -> getSuperComponentCount(superComponent) + 1) .orElse(0); }
java
public static boolean hasTemplate(ProcessingEnvironment processingEnvironment, TypeElement component) { Component annotation = component.getAnnotation(Component.class); if (annotation == null || !annotation.hasTemplate()) { return false; } if (component.getModifiers().contains(Modifier.ABST...
java
private void compileTemplateString(ComponentExposedTypeGenerator exposedTypeGenerator, TemplateParserResult templateParserResult) { VueTemplateCompilerResult compilerResult; try { VueTemplateCompiler vueTemplateCompiler = new VueTemplateCompiler(); compilerResult = vueTemplateCompiler.compile(...
java
private void generateGetRenderFunction(ComponentExposedTypeGenerator exposedTypeGenerator, VueTemplateCompilerResult result, TemplateParserResult templateParserResult) { MethodSpec.Builder getRenderFunctionBuilder = MethodSpec .methodBuilder("getRenderFunction") .addModifiers(Modifier.PR...
java
private void generateGetStaticRenderFunctions(ComponentExposedTypeGenerator exposedTypeGenerator, VueTemplateCompilerResult result) { CodeBlock.Builder staticFunctions = CodeBlock.builder(); boolean isFirst = true; for (String staticRenderFunction : result.getStaticRenderFunctions()) { if (!isF...
java
private void processTemplateExpressions(ComponentExposedTypeGenerator exposedTypeGenerator, TemplateParserResult templateParserResult) { for (TemplateExpression expression : templateParserResult.getExpressions()) { generateTemplateExpressionMethod(exposedTypeGenerator, expression, te...
java
private void generateTemplateExpressionMethod(ComponentExposedTypeGenerator exposedTypeGenerator, TemplateExpression expression, String templateName) { MethodSpec.Builder templateExpressionMethodBuilder = MethodSpec .methodBuilder(expression.getId()) .addModifiers(Modifier.PUBLIC) ...
java
public static String componentToTagName(Element componentElement) throws MissingComponentAnnotationException { Component componentAnnotation = componentElement.getAnnotation(Component.class); JsComponent jsComponentAnnotation = componentElement.getAnnotation(JsComponent.class); String annotationNameV...
java
public static String directiveToTagName(String directiveClassName) { // Drop "Component" at the end of the class name directiveClassName = directiveClassName.replaceAll("Directive$", ""); // Convert from CamelCase to kebab-case return CaseFormat.UPPER_CAMEL.to(CaseFormat.LOWER_HYPHEN, directiveClassName...
java
private void initLoopVariable(String type, String name, TemplateParserContext context) { this.loopVariableInfo = context.addLocalVariable(context.getFullyQualifiedNameForClassName(type.trim()), name.trim()); }
java
private void initIndexVariable(String name, TemplateParserContext context) { this.indexVariableInfo = context.addLocalVariable("int", name.trim()); }
java
private void initKeyVariable(String name, TemplateParserContext context) { this.keyVariableInfo = context.addLocalVariable("String", name.trim()); }
java
public String toTemplateString() { String[] parametersName = this.parameters.stream().map(VariableInfo::getName).toArray(String[]::new); return this.getId() + "(" + String.join(", ", parametersName) + ")"; }
java
public TemplateParserResult parseHtmlTemplate(String htmlTemplate, TemplateParserContext context, Elements elements, Messager messager, URI htmlTemplateUri) { this.context = context; this.elements = elements; this.messager = messager; this.logger = new TemplateParserLogger(context, messager); ...
java
private void processImports(Source doc) { doc .getAllElements() .stream() .filter(element -> "vue-gwt:import".equalsIgnoreCase(element.getName())) .peek(importElement -> { String classAttributeValue = importElement.getAttributeValue("class"); if (classAttributeVal...
java
private void processElement(Element element) { context.setCurrentSegment(element); currentProp = null; currentAttribute = null; // Process attributes boolean shouldPopContext = processElementAttributes(element); // Process text segments StreamSupport .stream(((Iterable<Segment>) el...
java
private TypeMirror getTypeFromDOMElement(Element element) { return DOMElementsUtil .getTypeForElementTag(element.getStartTag().getName()) .map(Class::getCanonicalName) .map(elements::getTypeElement) .map(TypeElement::asType) .orElse(null); }
java
private void registerMandatoryAttributes(Attributes attributes) { // see https://sourceforge.net/p/jerichohtml/discussion/350024/thread/501a7d05/ Map<String, String> attrs = context.getMandatoryAttributes(); if (!attrs.isEmpty()) { for (Entry<String, String> i : attrs.entrySet()) { String v = ...
java
private TypeName getExpressionReturnTypeForAttribute(Attribute attribute, Map<String, Class<?>> propertiesTypes) { String attributeName = attribute.getKey().toLowerCase(); if (attributeName.indexOf("@") == 0 || attributeName.indexOf("v-on:") == 0) { return TypeName.VOID; } if ("v-if".equal...
java
private String processVForValue(String vForValue) { VForDefinition vForDef = new VForDefinition(vForValue, context, logger); // Set return of the "in" expression currentExpressionReturnType = vForDef.getInExpressionType(); String inExpression = this.processExpression(vForDef.getInExpression()); /...
java
private String processSlotScopeValue(String value) { SlotScopeDefinition slotScopeDefinition = new SlotScopeDefinition(value, context, logger); return slotScopeDefinition.getSlotScopeVariableName(); }
java
private String processExpression(String expressionString) { expressionString = expressionString == null ? "" : expressionString.trim(); if (expressionString.isEmpty()) { if (isAttributeBinding(currentAttribute)) { logger.error( "Empty expression in template property binding. If you wan...
java
private boolean shouldSkipExpressionProcessing(String expressionString) { // We don't skip if it's a component prop as we want Java validation // We don't optimize String expression, as we want GWT to convert Java values // to String for us (Enums, wrapped primitives...) return currentProp == null && !S...
java
private TemplateExpression processJavaExpression(String expressionString) { Expression expression; try { expression = JavaParser.parseExpression(expressionString); } catch (ParseProblemException parseException) { logger.error("Couldn't parse Expression, make sure it is valid Java.", ex...
java
private void resolveTypesUsingImports(Expression expression) { if (expression instanceof NodeWithType) { NodeWithType<?, ?> nodeWithType = ((NodeWithType<?, ?>) expression); nodeWithType.setType(getQualifiedName(nodeWithType.getType())); } // Recurse downward in the expression expression ...
java
private void resolveStaticMethodsUsingImports(Expression expression) { if (expression instanceof MethodCallExpr) { MethodCallExpr methodCall = ((MethodCallExpr) expression); String methodName = methodCall.getName().getIdentifier(); if (!methodCall.getScope().isPresent() && context.hasStaticMethod(...
java
private void checkMethodNames(Expression expression) { if (expression instanceof MethodCallExpr) { MethodCallExpr methodCall = ((MethodCallExpr) expression); if (!methodCall.getScope().isPresent()) { String methodName = methodCall.getName().getIdentifier(); if (!context.hasMethod(methodN...
java
private void createStaticGetMethod(TypeElement component, ClassName vueFactoryClassName, Builder vueFactoryBuilder, List<CodeBlock> staticInitParameters) { MethodSpec.Builder getBuilder = MethodSpec .methodBuilder("get") .addModifiers(Modifier.STATIC, Modifier.PUBLIC) .returns(vueFacto...
java
public TemplateExpression addExpression(String expression, TypeName expressionType, boolean shouldCast, List<VariableInfo> parameters) { String id = "exp$" + this.expressions.size(); TemplateExpression templateExpression = new TemplateExpression(id, expression.trim(), expressionType, ...
java
public void addRef(String name, TypeMirror elementType, boolean isArray) { refs.add(new RefInfo(name, elementType, isArray)); }
java
public static String escapeStringForJsRegexp(String input) { JsString string = uncheckedCast(input); return string.replace(ESCAPE_JS_STRING_REGEXP, "\\$&"); }
java
private void registerLocalDirectives(Component annotation, MethodSpec.Builder initBuilder) { try { Class<?>[] componentsClass = annotation.directives(); if (componentsClass.length > 0) { addGetDirectivesStatement(initBuilder); } Stream .of(componentsClass) .forE...
java
@JsOverlay public final void initRenderFunctions(Function renderFunctionString, Function[] staticRenderFnsStrings) { this.setRender(renderFunctionString); this.setStaticRenderFns(cast(staticRenderFnsStrings)); }
java
@JsOverlay public final void initData(boolean useFactory, Set<String> fieldNames) { JsPropertyMap<Object> dataFields = JsPropertyMap.of(); dataFieldsToProxy = new HashSet<>(); for (String fieldName : fieldNames) { dataFields.set(fieldName, null); // If field name starts with $ or _ Vue.js won...
java
@JsOverlay public final void addJavaComputed(Function javaMethod, String computedPropertyName, ComputedKind kind) { ComputedOptions computedDefinition = getComputedOptions(computedPropertyName); if (computedDefinition == null) { computedDefinition = new ComputedOptions(); addComputedOptions(...
java
@JsOverlay public final void addJavaWatch(Function javaMethod, String watchedPropertyName, boolean isDeep, boolean isImmediate) { if (!isDeep && !isImmediate) { addWatch(watchedPropertyName, javaMethod); return; } JsPropertyMap<Object> watchDefinition = JsPropertyMap.of(); watchDefi...
java
@JsOverlay public final void addJavaProp(String propName, String fieldName, boolean required, String exposedTypeName) { if (propsToProxy == null) { propsToProxy = new HashSet<>(); } PropOptions propDefinition = new PropOptions(); propDefinition.required = required; if (exposedTypeNam...
java
private void findLocalComponentsForComponent(LocalComponents localComponents, TypeElement componentTypeElement) { Component componentAnnotation = componentTypeElement.getAnnotation(Component.class); if (componentAnnotation == null) { return; } processLocalComponentClass(localComponents, com...
java
public void customizeVueObserverPrototype(VueObserver vueObserver) { vueObserveArrayFunction = vueObserver.getObserveArray(); vueWalkFunction = vueObserver.getWalk(); vueObserver.setWalk(toObserve -> { if (observeJavaObject(toObserve)) { return; } vueWalkFunction.call(this, toObs...
java
public static boolean hasInjectAnnotation(Element element) { for (AnnotationMirror annotationMirror : element.getAnnotationMirrors()) { String annotationQualifiedName = annotationMirror.getAnnotationType().toString(); if (annotationQualifiedName.equals(Inject.class.getCanonicalName())) { return ...
java
public void generate(TypeElement directiveTypeElement) { ClassName optionsClassName = GeneratorsNameUtil.directiveOptionsName(directiveTypeElement); Builder componentClassBuilder = TypeSpec .classBuilder(optionsClassName) .addModifiers(Modifier.PUBLIC, Modifier.FINAL) .superclass(VueDir...
java
private void exposeExposedFieldsToJs() { if (fieldsWithNameExposed.isEmpty()) { return; } MethodSpec.Builder exposeFieldMethod = MethodSpec .methodBuilder("vg$ef") .addAnnotation(JsMethod.class); fieldsWithNameExposed .forEach(field -> exposeFieldMethod .addSt...
java
private void processComputed() { getMethodsWithAnnotation(component, Computed.class).forEach(method -> { ComputedKind kind = ComputedKind.GETTER; if ("void".equals(method.getReturnType().toString())) { kind = ComputedKind.SETTER; } String exposedMethodName = exposeExistingJavaMethod...
java
private void addFieldsForComputedMethod(TypeElement component, Set<String> alreadyDone) { getMethodsWithAnnotation(component, Computed.class).forEach(method -> { String propertyName = computedPropertyNameToFieldName(getComputedPropertyName(method)); if (alreadyDone.contains(propertyName)) { ret...
java
private void processWatchers(MethodSpec.Builder createdMethodBuilder) { createdMethodBuilder.addStatement("Proto p = __proto__"); getMethodsWithAnnotation(component, Watch.class) .forEach(method -> processWatcher(createdMethodBuilder, method)); }
java
private void processWatcher(MethodSpec.Builder createdMethodBuilder, ExecutableElement method) { Watch watch = method.getAnnotation(Watch.class); String exposedMethodName = exposeExistingJavaMethodToJs(method); String watcherTriggerMethodName = addNewMethodToProto(); MethodSpec.Builder watcherMethodBu...
java
private void processPropValidators() { getMethodsWithAnnotation(component, PropValidator.class).forEach(method -> { PropValidator propValidator = method.getAnnotation(PropValidator.class); if (!TypeName.get(method.getReturnType()).equals(TypeName.BOOLEAN)) { printError("Method " + m...
java
private void processPropDefaultValues() { getMethodsWithAnnotation(component, PropDefault.class).forEach(method -> { PropDefault propValidator = method.getAnnotation(PropDefault.class); String exposedMethodName = exposeExistingJavaMethodToJs(method); String propertyName = propValidator.value(); ...
java
private void processHooks(Set<ExecutableElement> hookMethodsFromInterfaces) { ElementFilter .methodsIn(component.getEnclosedElements()) .stream() .filter(method -> isHookMethod(component, method, hookMethodsFromInterfaces)) // Created hook is already added by createCreatedHook ...
java
private Set<ExecutableElement> getHookMethodsFromInterfaces() { return component .getInterfaces() .stream() .map(DeclaredType.class::cast) .map(DeclaredType::asElement) .map(TypeElement.class::cast) .flatMap(typeElement -> ElementFilter .methodsIn(typeElem...
java
private void processRenderFunction() { if (!hasInterface(processingEnv, component.asType(), HasRender.class)) { return; } componentExposedTypeBuilder.addMethod(MethodSpec .methodBuilder("vg$render") .addModifiers(Modifier.PUBLIC) .addAnnotation(JsMethod.class) .returns...
java
private void createCreatedHook(ComponentInjectedDependenciesBuilder dependenciesBuilder) { String hasRunCreatedFlagName = "vg$hrc_" + getSuperComponentCount(component); componentExposedTypeBuilder .addField( FieldSpec.builder(boolean.class, hasRunCreatedFlagName, Modifier.PUBLIC) ...
java
private void initFieldsValues(TypeElement component, MethodSpec.Builder createdMethodBuilder) { // Do not init instance fields for abstract components if (component.getModifiers().contains(Modifier.ABSTRACT)) { return; } createdMethodBuilder.addStatement( "$T.initComponentInstanceFields(t...
java