id int32 0 165k | repo stringlengths 7 58 | path stringlengths 12 218 | func_name stringlengths 3 140 | original_string stringlengths 73 34.1k | language stringclasses 1
value | code stringlengths 73 34.1k | code_tokens list | docstring stringlengths 3 16k | docstring_tokens list | sha stringlengths 40 40 | url stringlengths 105 339 |
|---|---|---|---|---|---|---|---|---|---|---|---|
58,900 | baidubce/bce-sdk-java | src/main/java/com/baidubce/services/bmr/BmrClient.java | BmrClient.modifyInstanceGroups | 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 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... | [
"public",
"void",
"modifyInstanceGroups",
"(",
"ModifyInstanceGroupsRequest",
"request",
")",
"{",
"checkNotNull",
"(",
"request",
",",
"\"request should not be null.\"",
")",
";",
"checkStringNotEmpty",
"(",
"request",
".",
"getClusterId",
"(",
")",
",",
"\"The cluster... | Modify the instance groups of the target cluster.
@param request The request containing the ID of BMR cluster and the instance groups to be modified. | [
"Modify",
"the",
"instance",
"groups",
"of",
"the",
"target",
"cluster",
"."
] | f7140f28dd82121515c88ded7bfe769a37d0ec4a | https://github.com/baidubce/bce-sdk-java/blob/f7140f28dd82121515c88ded7bfe769a37d0ec4a/src/main/java/com/baidubce/services/bmr/BmrClient.java#L292-L332 |
58,901 | baidubce/bce-sdk-java | src/main/java/com/baidubce/services/bmr/BmrClient.java | BmrClient.terminateCluster | 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 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(
... | [
"public",
"void",
"terminateCluster",
"(",
"TerminateClusterRequest",
"request",
")",
"{",
"checkNotNull",
"(",
"request",
",",
"\"request should not be null.\"",
")",
";",
"checkStringNotEmpty",
"(",
"request",
".",
"getClusterId",
"(",
")",
",",
"\"The parameter clust... | Terminate a BMR cluster and release all the virtual machine instances.
@param request The request containing the ID of the cluster to be terminated. | [
"Terminate",
"a",
"BMR",
"cluster",
"and",
"release",
"all",
"the",
"virtual",
"machine",
"instances",
"."
] | f7140f28dd82121515c88ded7bfe769a37d0ec4a | https://github.com/baidubce/bce-sdk-java/blob/f7140f28dd82121515c88ded7bfe769a37d0ec4a/src/main/java/com/baidubce/services/bmr/BmrClient.java#L339-L347 |
58,902 | baidubce/bce-sdk-java | src/main/java/com/baidubce/services/bmr/BmrClient.java | BmrClient.listInstanceGroups | 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 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... | [
"public",
"ListInstanceGroupsResponse",
"listInstanceGroups",
"(",
"ListInstanceGroupsRequest",
"request",
")",
"{",
"checkNotNull",
"(",
"request",
",",
"\"request should not be null.\"",
")",
";",
"checkStringNotEmpty",
"(",
"request",
".",
"getClusterId",
"(",
")",
","... | List the instance groups of the target BMR cluster.
@param request containing the ID of target BMR cluster.
@return The response containing a list of InstanceGroup objects. | [
"List",
"the",
"instance",
"groups",
"of",
"the",
"target",
"BMR",
"cluster",
"."
] | f7140f28dd82121515c88ded7bfe769a37d0ec4a | https://github.com/baidubce/bce-sdk-java/blob/f7140f28dd82121515c88ded7bfe769a37d0ec4a/src/main/java/com/baidubce/services/bmr/BmrClient.java#L364-L372 |
58,903 | baidubce/bce-sdk-java | src/main/java/com/baidubce/services/bmr/BmrClient.java | BmrClient.listInstances | 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(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(),
... | [
"public",
"ListInstancesResponse",
"listInstances",
"(",
"ListInstancesRequest",
"request",
")",
"{",
"checkNotNull",
"(",
"request",
",",
"\"request should not be null.\"",
")",
";",
"checkStringNotEmpty",
"(",
"request",
".",
"getClusterId",
"(",
")",
",",
"\"The para... | List the instances belonging to the target instance group in the BMR cluster.
@param request containing the ID of target BMR cluster and the ID of the instance group.
@return The response containing a list of Instance objects. | [
"List",
"the",
"instances",
"belonging",
"to",
"the",
"target",
"instance",
"group",
"in",
"the",
"BMR",
"cluster",
"."
] | f7140f28dd82121515c88ded7bfe769a37d0ec4a | https://github.com/baidubce/bce-sdk-java/blob/f7140f28dd82121515c88ded7bfe769a37d0ec4a/src/main/java/com/baidubce/services/bmr/BmrClient.java#L390-L401 |
58,904 | baidubce/bce-sdk-java | src/main/java/com/baidubce/services/bmr/BmrClient.java | BmrClient.listInstances | public ListInstancesResponse listInstances(String clusterId, String instanceGroupId) {
return listInstances(new ListInstancesRequest().withClusterId(clusterId).withInstanceGroupId(instanceGroupId));
} | java | public ListInstancesResponse listInstances(String clusterId, String instanceGroupId) {
return listInstances(new ListInstancesRequest().withClusterId(clusterId).withInstanceGroupId(instanceGroupId));
} | [
"public",
"ListInstancesResponse",
"listInstances",
"(",
"String",
"clusterId",
",",
"String",
"instanceGroupId",
")",
"{",
"return",
"listInstances",
"(",
"new",
"ListInstancesRequest",
"(",
")",
".",
"withClusterId",
"(",
"clusterId",
")",
".",
"withInstanceGroupId"... | List the instances belonging to the target instance in the BMR cluster.
@param clusterId the ID of target BMR cluster.
@param instanceGroupId the ID of target instance group.
@return The response containing a list of Instance objects. | [
"List",
"the",
"instances",
"belonging",
"to",
"the",
"target",
"instance",
"in",
"the",
"BMR",
"cluster",
"."
] | f7140f28dd82121515c88ded7bfe769a37d0ec4a | https://github.com/baidubce/bce-sdk-java/blob/f7140f28dd82121515c88ded7bfe769a37d0ec4a/src/main/java/com/baidubce/services/bmr/BmrClient.java#L410-L412 |
58,905 | baidubce/bce-sdk-java | src/main/java/com/baidubce/services/bmr/BmrClient.java | BmrClient.addSteps | 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 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."... | [
"public",
"AddStepsResponse",
"addSteps",
"(",
"AddStepsRequest",
"request",
")",
"{",
"checkNotNull",
"(",
"request",
",",
"\"request should not be null.\"",
")",
";",
"checkNotNull",
"(",
"request",
".",
"getSteps",
"(",
")",
",",
"\"The parameter steps should not be ... | Add steps to a BMR cluster.
@param request containing the ID of target BMR cluster and several steps to be added.
@return The response containing a list of IDs of newly added steps. | [
"Add",
"steps",
"to",
"a",
"BMR",
"cluster",
"."
] | f7140f28dd82121515c88ded7bfe769a37d0ec4a | https://github.com/baidubce/bce-sdk-java/blob/f7140f28dd82121515c88ded7bfe769a37d0ec4a/src/main/java/com/baidubce/services/bmr/BmrClient.java#L419-L478 |
58,906 | baidubce/bce-sdk-java | src/main/java/com/baidubce/services/doc/DocClient.java | DocClient.getDocumentImages | 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 GetDocumentImagesResponse getDocumentImages(String documentId) {
checkNotNull(documentId, "documentId should not be null.");
GetDocumentImagesRequest request = new GetDocumentImagesRequest();
request.setDocumentId(documentId);
InternalRequest internalRequest = this.createRequest(H... | [
"public",
"GetDocumentImagesResponse",
"getDocumentImages",
"(",
"String",
"documentId",
")",
"{",
"checkNotNull",
"(",
"documentId",
",",
"\"documentId should not be null.\"",
")",
";",
"GetDocumentImagesRequest",
"request",
"=",
"new",
"GetDocumentImagesRequest",
"(",
")"... | get a Document Image list if Converted to image.
Make Sure the Document convert type is image, otherwise will throw BceServiceException
@param documentId the documentId need to get.
@return A GetDocumentImageResponse object containing the information returned by Document. | [
"get",
"a",
"Document",
"Image",
"list",
"if",
"Converted",
"to",
"image",
".",
"Make",
"Sure",
"the",
"Document",
"convert",
"type",
"is",
"image",
"otherwise",
"will",
"throw",
"BceServiceException"
] | f7140f28dd82121515c88ded7bfe769a37d0ec4a | https://github.com/baidubce/bce-sdk-java/blob/f7140f28dd82121515c88ded7bfe769a37d0ec4a/src/main/java/com/baidubce/services/doc/DocClient.java#L517-L535 |
58,907 | baidubce/bce-sdk-java | src/main/java/com/baidubce/services/doc/DocClient.java | DocClient.listDocuments | public ListDocumentsResponse listDocuments() {
ListDocumentsRequest request = new ListDocumentsRequest();
InternalRequest internalRequest = this.createRequest(HttpMethodName.GET, request, DOC);
ListDocumentsResponse response;
try {
response = this.invokeHttpClient(internalReq... | java | public ListDocumentsResponse listDocuments() {
ListDocumentsRequest request = new ListDocumentsRequest();
InternalRequest internalRequest = this.createRequest(HttpMethodName.GET, request, DOC);
ListDocumentsResponse response;
try {
response = this.invokeHttpClient(internalReq... | [
"public",
"ListDocumentsResponse",
"listDocuments",
"(",
")",
"{",
"ListDocumentsRequest",
"request",
"=",
"new",
"ListDocumentsRequest",
"(",
")",
";",
"InternalRequest",
"internalRequest",
"=",
"this",
".",
"createRequest",
"(",
"HttpMethodName",
".",
"GET",
",",
... | list all Document.
@return A ListDocumentsResponse object containing the information returned by Document. | [
"list",
"all",
"Document",
"."
] | f7140f28dd82121515c88ded7bfe769a37d0ec4a | https://github.com/baidubce/bce-sdk-java/blob/f7140f28dd82121515c88ded7bfe769a37d0ec4a/src/main/java/com/baidubce/services/doc/DocClient.java#L544-L559 |
58,908 | baidubce/bce-sdk-java | src/main/java/com/baidubce/services/doc/DocClient.java | DocClient.getDocumentDownload | 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 GetDocumentDownloadResponse getDocumentDownload(String documentId) {
checkNotNull(documentId, "documentId should not be null.");
GetDocumentDownloadRequest request = new GetDocumentDownloadRequest();
request.setDocumentId(documentId);
InternalRequest internalRequest = this.createR... | [
"public",
"GetDocumentDownloadResponse",
"getDocumentDownload",
"(",
"String",
"documentId",
")",
"{",
"checkNotNull",
"(",
"documentId",
",",
"\"documentId should not be null.\"",
")",
";",
"GetDocumentDownloadRequest",
"request",
"=",
"new",
"GetDocumentDownloadRequest",
"(... | get a Document Download link.
@param documentId the documentId need to download.
@return A GetDocumentDownloadResponse object containing the information returned by Document. | [
"get",
"a",
"Document",
"Download",
"link",
"."
] | f7140f28dd82121515c88ded7bfe769a37d0ec4a | https://github.com/baidubce/bce-sdk-java/blob/f7140f28dd82121515c88ded7bfe769a37d0ec4a/src/main/java/com/baidubce/services/doc/DocClient.java#L663-L681 |
58,909 | baidubce/bce-sdk-java | src/main/java/com/baidubce/services/bos/model/FetchObjectRequest.java | FetchObjectRequest.setMode | 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 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);
}
} | [
"public",
"void",
"setMode",
"(",
"String",
"mode",
")",
"{",
"checkNotNull",
"(",
"mode",
",",
"\"mode should not be null\"",
")",
";",
"if",
"(",
"MODE_ASYNC",
".",
"equals",
"(",
"mode",
")",
"||",
"MODE_SYNC",
".",
"equals",
"(",
"mode",
")",
")",
"{... | Sets the mode of this fetching job.
@param mode The mode of this fetching job. | [
"Sets",
"the",
"mode",
"of",
"this",
"fetching",
"job",
"."
] | f7140f28dd82121515c88ded7bfe769a37d0ec4a | https://github.com/baidubce/bce-sdk-java/blob/f7140f28dd82121515c88ded7bfe769a37d0ec4a/src/main/java/com/baidubce/services/bos/model/FetchObjectRequest.java#L103-L110 |
58,910 | baidubce/bce-sdk-java | src/main/java/com/baidubce/services/bmr/model/AddStepsRequest.java | AddStepsRequest.withStep | public AddStepsRequest withStep(StepConfig step) {
if (this.steps == null) {
this.steps = new ArrayList<StepConfig>();
}
this.steps.add(step);
return this;
} | java | public AddStepsRequest withStep(StepConfig step) {
if (this.steps == null) {
this.steps = new ArrayList<StepConfig>();
}
this.steps.add(step);
return this;
} | [
"public",
"AddStepsRequest",
"withStep",
"(",
"StepConfig",
"step",
")",
"{",
"if",
"(",
"this",
".",
"steps",
"==",
"null",
")",
"{",
"this",
".",
"steps",
"=",
"new",
"ArrayList",
"<",
"StepConfig",
">",
"(",
")",
";",
"}",
"this",
".",
"steps",
".... | Configure the step to be added.
@param step a StepConfig object to be added.
@return AddStepsRequest | [
"Configure",
"the",
"step",
"to",
"be",
"added",
"."
] | f7140f28dd82121515c88ded7bfe769a37d0ec4a | https://github.com/baidubce/bce-sdk-java/blob/f7140f28dd82121515c88ded7bfe769a37d0ec4a/src/main/java/com/baidubce/services/bmr/model/AddStepsRequest.java#L73-L79 |
58,911 | baidubce/bce-sdk-java | src/main/java/com/baidubce/util/HttpUtils.java | HttpUtils.generateHostHeader | public static String generateHostHeader(URI uri) {
String host = uri.getHost();
if (isUsingNonDefaultPort(uri)) {
host += ":" + uri.getPort();
}
return host;
} | java | public static String generateHostHeader(URI uri) {
String host = uri.getHost();
if (isUsingNonDefaultPort(uri)) {
host += ":" + uri.getPort();
}
return host;
} | [
"public",
"static",
"String",
"generateHostHeader",
"(",
"URI",
"uri",
")",
"{",
"String",
"host",
"=",
"uri",
".",
"getHost",
"(",
")",
";",
"if",
"(",
"isUsingNonDefaultPort",
"(",
"uri",
")",
")",
"{",
"host",
"+=",
"\":\"",
"+",
"uri",
".",
"getPor... | Returns a host header according to the specified URI. The host header is generated with the same logic used by
apache http client, that is, append the port to hostname only if it is not the default port.
@param uri the URI
@return a host header according to the specified URI. | [
"Returns",
"a",
"host",
"header",
"according",
"to",
"the",
"specified",
"URI",
".",
"The",
"host",
"header",
"is",
"generated",
"with",
"the",
"same",
"logic",
"used",
"by",
"apache",
"http",
"client",
"that",
"is",
"append",
"the",
"port",
"to",
"hostnam... | f7140f28dd82121515c88ded7bfe769a37d0ec4a | https://github.com/baidubce/bce-sdk-java/blob/f7140f28dd82121515c88ded7bfe769a37d0ec4a/src/main/java/com/baidubce/util/HttpUtils.java#L169-L175 |
58,912 | baidubce/bce-sdk-java | src/main/java/com/baidubce/services/moladb/model/Key.java | Key.withAttribute | public Key withAttribute(String attributeName, AttributeValue value) {
if (this.attributes == null) {
this.attributes = new HashMap<String, AttributeValue>();
}
attributes.put(attributeName, value);
return this;
} | java | public Key withAttribute(String attributeName, AttributeValue value) {
if (this.attributes == null) {
this.attributes = new HashMap<String, AttributeValue>();
}
attributes.put(attributeName, value);
return this;
} | [
"public",
"Key",
"withAttribute",
"(",
"String",
"attributeName",
",",
"AttributeValue",
"value",
")",
"{",
"if",
"(",
"this",
".",
"attributes",
"==",
"null",
")",
"{",
"this",
".",
"attributes",
"=",
"new",
"HashMap",
"<",
"String",
",",
"AttributeValue",
... | The method set attribute name and attribute value with input parameters for a key.
Returns a reference to this object so that method calls can be chained together.
@param attributeName The attribute name to set for a key.
@param value The attribute value to set for a key.
@return A reference to this object so that met... | [
"The",
"method",
"set",
"attribute",
"name",
"and",
"attribute",
"value",
"with",
"input",
"parameters",
"for",
"a",
"key",
".",
"Returns",
"a",
"reference",
"to",
"this",
"object",
"so",
"that",
"method",
"calls",
"can",
"be",
"chained",
"together",
"."
] | f7140f28dd82121515c88ded7bfe769a37d0ec4a | https://github.com/baidubce/bce-sdk-java/blob/f7140f28dd82121515c88ded7bfe769a37d0ec4a/src/main/java/com/baidubce/services/moladb/model/Key.java#L79-L85 |
58,913 | VueGWT/vue-gwt | processors/src/main/java/com/axellience/vuegwt/processors/component/template/builder/compiler/VueTemplateCompiler.java | VueTemplateCompiler.initEngine | 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 | 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... | [
"private",
"void",
"initEngine",
"(",
")",
"{",
"engine",
"=",
"(",
"NashornScriptEngine",
")",
"new",
"ScriptEngineManager",
"(",
")",
".",
"getEngineByName",
"(",
"\"nashorn\"",
")",
";",
"try",
"{",
"engine",
".",
"eval",
"(",
"\"(function(global){global.glob... | Init the Nashorn engine and load the Vue compiler in it. | [
"Init",
"the",
"Nashorn",
"engine",
"and",
"load",
"the",
"Vue",
"compiler",
"in",
"it",
"."
] | 961cd83aed6fe8e2dd80c279847f1b3f62918a1f | https://github.com/VueGWT/vue-gwt/blob/961cd83aed6fe8e2dd80c279847f1b3f62918a1f/processors/src/main/java/com/axellience/vuegwt/processors/component/template/builder/compiler/VueTemplateCompiler.java#L27-L36 |
58,914 | VueGWT/vue-gwt | processors/src/main/java/com/axellience/vuegwt/processors/component/template/builder/compiler/VueTemplateCompiler.java | VueTemplateCompiler.compile | public VueTemplateCompilerResult compile(String htmlTemplate)
throws VueTemplateCompilerException {
ScriptObjectMirror templateCompilerResult;
try {
templateCompilerResult =
(ScriptObjectMirror) engine.invokeFunction("compile", htmlTemplate);
} catch (ScriptException | NoSuchMethodExce... | java | public VueTemplateCompilerResult compile(String htmlTemplate)
throws VueTemplateCompilerException {
ScriptObjectMirror templateCompilerResult;
try {
templateCompilerResult =
(ScriptObjectMirror) engine.invokeFunction("compile", htmlTemplate);
} catch (ScriptException | NoSuchMethodExce... | [
"public",
"VueTemplateCompilerResult",
"compile",
"(",
"String",
"htmlTemplate",
")",
"throws",
"VueTemplateCompilerException",
"{",
"ScriptObjectMirror",
"templateCompilerResult",
";",
"try",
"{",
"templateCompilerResult",
"=",
"(",
"ScriptObjectMirror",
")",
"engine",
"."... | Compile the given HTML template to JS functions using vue-template-compiler.
@param htmlTemplate The HTML Component template to compile
@return An object containing the render functions
@throws VueTemplateCompilerException If the compilation fails | [
"Compile",
"the",
"given",
"HTML",
"template",
"to",
"JS",
"functions",
"using",
"vue",
"-",
"template",
"-",
"compiler",
"."
] | 961cd83aed6fe8e2dd80c279847f1b3f62918a1f | https://github.com/VueGWT/vue-gwt/blob/961cd83aed6fe8e2dd80c279847f1b3f62918a1f/processors/src/main/java/com/axellience/vuegwt/processors/component/template/builder/compiler/VueTemplateCompiler.java#L45-L65 |
58,915 | VueGWT/vue-gwt | processors/src/main/java/com/axellience/vuegwt/processors/utils/ComponentGeneratorsUtil.java | ComponentGeneratorsUtil.isMethodVisibleInTemplate | 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 boolean isMethodVisibleInTemplate(ExecutableElement method) {
return isMethodVisibleInJS(method)
&& !hasAnnotation(method, Computed.class)
&& !hasAnnotation(method, Watch.class)
&& !hasAnnotation(method, PropValidator.class)
&& !hasAnnotation(method, PropDefault.class)
... | [
"public",
"static",
"boolean",
"isMethodVisibleInTemplate",
"(",
"ExecutableElement",
"method",
")",
"{",
"return",
"isMethodVisibleInJS",
"(",
"method",
")",
"&&",
"!",
"hasAnnotation",
"(",
"method",
",",
"Computed",
".",
"class",
")",
"&&",
"!",
"hasAnnotation"... | Check if a given method is usable in the template
@param method The method we are checking
@return true if visible, false otherwise | [
"Check",
"if",
"a",
"given",
"method",
"is",
"usable",
"in",
"the",
"template"
] | 961cd83aed6fe8e2dd80c279847f1b3f62918a1f | https://github.com/VueGWT/vue-gwt/blob/961cd83aed6fe8e2dd80c279847f1b3f62918a1f/processors/src/main/java/com/axellience/vuegwt/processors/utils/ComponentGeneratorsUtil.java#L140-L148 |
58,916 | VueGWT/vue-gwt | processors/src/main/java/com/axellience/vuegwt/processors/utils/ComponentGeneratorsUtil.java | ComponentGeneratorsUtil.getSuperComponentCount | public static int getSuperComponentCount(TypeElement component) {
return getSuperComponentType(component)
.map(superComponent -> getSuperComponentCount(superComponent) + 1)
.orElse(0);
} | java | public static int getSuperComponentCount(TypeElement component) {
return getSuperComponentType(component)
.map(superComponent -> getSuperComponentCount(superComponent) + 1)
.orElse(0);
} | [
"public",
"static",
"int",
"getSuperComponentCount",
"(",
"TypeElement",
"component",
")",
"{",
"return",
"getSuperComponentType",
"(",
"component",
")",
".",
"map",
"(",
"superComponent",
"->",
"getSuperComponentCount",
"(",
"superComponent",
")",
"+",
"1",
")",
... | Return the number of super component in the chain of parents
@param component The {@link IsVueComponent} to count the super type of
@return The number of super components | [
"Return",
"the",
"number",
"of",
"super",
"component",
"in",
"the",
"chain",
"of",
"parents"
] | 961cd83aed6fe8e2dd80c279847f1b3f62918a1f | https://github.com/VueGWT/vue-gwt/blob/961cd83aed6fe8e2dd80c279847f1b3f62918a1f/processors/src/main/java/com/axellience/vuegwt/processors/utils/ComponentGeneratorsUtil.java#L202-L206 |
58,917 | VueGWT/vue-gwt | processors/src/main/java/com/axellience/vuegwt/processors/utils/ComponentGeneratorsUtil.java | ComponentGeneratorsUtil.hasTemplate | 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 | 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... | [
"public",
"static",
"boolean",
"hasTemplate",
"(",
"ProcessingEnvironment",
"processingEnvironment",
",",
"TypeElement",
"component",
")",
"{",
"Component",
"annotation",
"=",
"component",
".",
"getAnnotation",
"(",
"Component",
".",
"class",
")",
";",
"if",
"(",
... | Check if the given Component has a Template. It doesn't have a template if the class is
abstract, if it implements render function or if it has the flag "hasTemplate" to false on the
component annotation.
@param processingEnvironment Environment of the Annotation processor
@param component The component to check
@retu... | [
"Check",
"if",
"the",
"given",
"Component",
"has",
"a",
"Template",
".",
"It",
"doesn",
"t",
"have",
"a",
"template",
"if",
"the",
"class",
"is",
"abstract",
"if",
"it",
"implements",
"render",
"function",
"or",
"if",
"it",
"has",
"the",
"flag",
"hasTemp... | 961cd83aed6fe8e2dd80c279847f1b3f62918a1f | https://github.com/VueGWT/vue-gwt/blob/961cd83aed6fe8e2dd80c279847f1b3f62918a1f/processors/src/main/java/com/axellience/vuegwt/processors/utils/ComponentGeneratorsUtil.java#L217-L229 |
58,918 | VueGWT/vue-gwt | processors/src/main/java/com/axellience/vuegwt/processors/component/template/builder/TemplateMethodsBuilder.java | TemplateMethodsBuilder.compileTemplateString | private void compileTemplateString(ComponentExposedTypeGenerator exposedTypeGenerator,
TemplateParserResult templateParserResult) {
VueTemplateCompilerResult compilerResult;
try {
VueTemplateCompiler vueTemplateCompiler = new VueTemplateCompiler();
compilerResult = vueTemplateCompiler.compile(... | java | private void compileTemplateString(ComponentExposedTypeGenerator exposedTypeGenerator,
TemplateParserResult templateParserResult) {
VueTemplateCompilerResult compilerResult;
try {
VueTemplateCompiler vueTemplateCompiler = new VueTemplateCompiler();
compilerResult = vueTemplateCompiler.compile(... | [
"private",
"void",
"compileTemplateString",
"(",
"ComponentExposedTypeGenerator",
"exposedTypeGenerator",
",",
"TemplateParserResult",
"templateParserResult",
")",
"{",
"VueTemplateCompilerResult",
"compilerResult",
";",
"try",
"{",
"VueTemplateCompiler",
"vueTemplateCompiler",
"... | Compile the HTML template and transform it to a JS render function.
@param exposedTypeGenerator Class generating the ExposedType
@param templateParserResult The result of the HTML template parsed by {@link TemplateParser} | [
"Compile",
"the",
"HTML",
"template",
"and",
"transform",
"it",
"to",
"a",
"JS",
"render",
"function",
"."
] | 961cd83aed6fe8e2dd80c279847f1b3f62918a1f | https://github.com/VueGWT/vue-gwt/blob/961cd83aed6fe8e2dd80c279847f1b3f62918a1f/processors/src/main/java/com/axellience/vuegwt/processors/component/template/builder/TemplateMethodsBuilder.java#L51-L64 |
58,919 | VueGWT/vue-gwt | processors/src/main/java/com/axellience/vuegwt/processors/component/template/builder/TemplateMethodsBuilder.java | TemplateMethodsBuilder.generateGetRenderFunction | private void generateGetRenderFunction(ComponentExposedTypeGenerator exposedTypeGenerator,
VueTemplateCompilerResult result,
TemplateParserResult templateParserResult) {
MethodSpec.Builder getRenderFunctionBuilder = MethodSpec
.methodBuilder("getRenderFunction")
.addModifiers(Modifier.PR... | java | private void generateGetRenderFunction(ComponentExposedTypeGenerator exposedTypeGenerator,
VueTemplateCompilerResult result,
TemplateParserResult templateParserResult) {
MethodSpec.Builder getRenderFunctionBuilder = MethodSpec
.methodBuilder("getRenderFunction")
.addModifiers(Modifier.PR... | [
"private",
"void",
"generateGetRenderFunction",
"(",
"ComponentExposedTypeGenerator",
"exposedTypeGenerator",
",",
"VueTemplateCompilerResult",
"result",
",",
"TemplateParserResult",
"templateParserResult",
")",
"{",
"MethodSpec",
".",
"Builder",
"getRenderFunctionBuilder",
"=",
... | Generate the method that returns the body of the render function.
@param exposedTypeGenerator Class generating the ExposedType
@param result The result from compilation using vue-template-compiler
@param templateParserResult The result of the HTML template parsed by {@link TemplateParser} | [
"Generate",
"the",
"method",
"that",
"returns",
"the",
"body",
"of",
"the",
"render",
"function",
"."
] | 961cd83aed6fe8e2dd80c279847f1b3f62918a1f | https://github.com/VueGWT/vue-gwt/blob/961cd83aed6fe8e2dd80c279847f1b3f62918a1f/processors/src/main/java/com/axellience/vuegwt/processors/component/template/builder/TemplateMethodsBuilder.java#L73-L103 |
58,920 | VueGWT/vue-gwt | processors/src/main/java/com/axellience/vuegwt/processors/component/template/builder/TemplateMethodsBuilder.java | TemplateMethodsBuilder.generateGetStaticRenderFunctions | 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 generateGetStaticRenderFunctions(ComponentExposedTypeGenerator exposedTypeGenerator,
VueTemplateCompilerResult result) {
CodeBlock.Builder staticFunctions = CodeBlock.builder();
boolean isFirst = true;
for (String staticRenderFunction : result.getStaticRenderFunctions()) {
if (!isF... | [
"private",
"void",
"generateGetStaticRenderFunctions",
"(",
"ComponentExposedTypeGenerator",
"exposedTypeGenerator",
",",
"VueTemplateCompilerResult",
"result",
")",
"{",
"CodeBlock",
".",
"Builder",
"staticFunctions",
"=",
"CodeBlock",
".",
"builder",
"(",
")",
";",
"boo... | Generate the method that returns the body of the static render functions.
@param exposedTypeGenerator Class generating the ExposedType
@param result The result from compilation using vue-template-compiler | [
"Generate",
"the",
"method",
"that",
"returns",
"the",
"body",
"of",
"the",
"static",
"render",
"functions",
"."
] | 961cd83aed6fe8e2dd80c279847f1b3f62918a1f | https://github.com/VueGWT/vue-gwt/blob/961cd83aed6fe8e2dd80c279847f1b3f62918a1f/processors/src/main/java/com/axellience/vuegwt/processors/component/template/builder/TemplateMethodsBuilder.java#L111-L133 |
58,921 | VueGWT/vue-gwt | processors/src/main/java/com/axellience/vuegwt/processors/component/template/builder/TemplateMethodsBuilder.java | TemplateMethodsBuilder.processTemplateExpressions | private void processTemplateExpressions(ComponentExposedTypeGenerator exposedTypeGenerator,
TemplateParserResult templateParserResult) {
for (TemplateExpression expression : templateParserResult.getExpressions()) {
generateTemplateExpressionMethod(exposedTypeGenerator,
expression,
te... | java | private void processTemplateExpressions(ComponentExposedTypeGenerator exposedTypeGenerator,
TemplateParserResult templateParserResult) {
for (TemplateExpression expression : templateParserResult.getExpressions()) {
generateTemplateExpressionMethod(exposedTypeGenerator,
expression,
te... | [
"private",
"void",
"processTemplateExpressions",
"(",
"ComponentExposedTypeGenerator",
"exposedTypeGenerator",
",",
"TemplateParserResult",
"templateParserResult",
")",
"{",
"for",
"(",
"TemplateExpression",
"expression",
":",
"templateParserResult",
".",
"getExpressions",
"(",... | Process the expressions found in the HTML template
@param exposedTypeGenerator Class generating the ExposedType
@param templateParserResult Result from the parsing of the HTML Template | [
"Process",
"the",
"expressions",
"found",
"in",
"the",
"HTML",
"template"
] | 961cd83aed6fe8e2dd80c279847f1b3f62918a1f | https://github.com/VueGWT/vue-gwt/blob/961cd83aed6fe8e2dd80c279847f1b3f62918a1f/processors/src/main/java/com/axellience/vuegwt/processors/component/template/builder/TemplateMethodsBuilder.java#L141-L157 |
58,922 | VueGWT/vue-gwt | processors/src/main/java/com/axellience/vuegwt/processors/component/template/builder/TemplateMethodsBuilder.java | TemplateMethodsBuilder.generateTemplateExpressionMethod | private void generateTemplateExpressionMethod(ComponentExposedTypeGenerator exposedTypeGenerator,
TemplateExpression expression,
String templateName) {
MethodSpec.Builder templateExpressionMethodBuilder = MethodSpec
.methodBuilder(expression.getId())
.addModifiers(Modifier.PUBLIC)
... | java | private void generateTemplateExpressionMethod(ComponentExposedTypeGenerator exposedTypeGenerator,
TemplateExpression expression,
String templateName) {
MethodSpec.Builder templateExpressionMethodBuilder = MethodSpec
.methodBuilder(expression.getId())
.addModifiers(Modifier.PUBLIC)
... | [
"private",
"void",
"generateTemplateExpressionMethod",
"(",
"ComponentExposedTypeGenerator",
"exposedTypeGenerator",
",",
"TemplateExpression",
"expression",
",",
"String",
"templateName",
")",
"{",
"MethodSpec",
".",
"Builder",
"templateExpressionMethodBuilder",
"=",
"MethodSp... | Generate the Java method for an expression in the Template
@param exposedTypeGenerator Class generating the ExposedType
@param templateName The name of the Template the expression is from | [
"Generate",
"the",
"Java",
"method",
"for",
"an",
"expression",
"in",
"the",
"Template"
] | 961cd83aed6fe8e2dd80c279847f1b3f62918a1f | https://github.com/VueGWT/vue-gwt/blob/961cd83aed6fe8e2dd80c279847f1b3f62918a1f/processors/src/main/java/com/axellience/vuegwt/processors/component/template/builder/TemplateMethodsBuilder.java#L165-L207 |
58,923 | VueGWT/vue-gwt | processors/src/main/java/com/axellience/vuegwt/processors/utils/GeneratorsNameUtil.java | GeneratorsNameUtil.componentToTagName | 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 componentToTagName(Element componentElement)
throws MissingComponentAnnotationException {
Component componentAnnotation = componentElement.getAnnotation(Component.class);
JsComponent jsComponentAnnotation = componentElement.getAnnotation(JsComponent.class);
String annotationNameV... | [
"public",
"static",
"String",
"componentToTagName",
"(",
"Element",
"componentElement",
")",
"throws",
"MissingComponentAnnotationException",
"{",
"Component",
"componentAnnotation",
"=",
"componentElement",
".",
"getAnnotation",
"(",
"Component",
".",
"class",
")",
";",
... | Return the default name to register a component based on it's class name. The name of the tag
is the name of the component converted to kebab-case. If the component class ends with
"Component", this part is ignored.
@param componentElement The Element for the {@link IsVueComponent} we want the name of
@return The name... | [
"Return",
"the",
"default",
"name",
"to",
"register",
"a",
"component",
"based",
"on",
"it",
"s",
"class",
"name",
".",
"The",
"name",
"of",
"the",
"tag",
"is",
"the",
"name",
"of",
"the",
"component",
"converted",
"to",
"kebab",
"-",
"case",
".",
"If"... | 961cd83aed6fe8e2dd80c279847f1b3f62918a1f | https://github.com/VueGWT/vue-gwt/blob/961cd83aed6fe8e2dd80c279847f1b3f62918a1f/processors/src/main/java/com/axellience/vuegwt/processors/utils/GeneratorsNameUtil.java#L114-L140 |
58,924 | VueGWT/vue-gwt | processors/src/main/java/com/axellience/vuegwt/processors/utils/GeneratorsNameUtil.java | GeneratorsNameUtil.directiveToTagName | 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 | 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... | [
"public",
"static",
"String",
"directiveToTagName",
"(",
"String",
"directiveClassName",
")",
"{",
"// Drop \"Component\" at the end of the class name",
"directiveClassName",
"=",
"directiveClassName",
".",
"replaceAll",
"(",
"\"Directive$\"",
",",
"\"\"",
")",
";",
"// Con... | Return the default name to register a directive based on it's class name The name of the tag is
the name of the component converted to kebab-case If the component class ends with "Directive",
this part is ignored
@param directiveClassName The class name of the {@link VueDirective}
@return The name of the directive as ... | [
"Return",
"the",
"default",
"name",
"to",
"register",
"a",
"directive",
"based",
"on",
"it",
"s",
"class",
"name",
"The",
"name",
"of",
"the",
"tag",
"is",
"the",
"name",
"of",
"the",
"component",
"converted",
"to",
"kebab",
"-",
"case",
"If",
"the",
"... | 961cd83aed6fe8e2dd80c279847f1b3f62918a1f | https://github.com/VueGWT/vue-gwt/blob/961cd83aed6fe8e2dd80c279847f1b3f62918a1f/processors/src/main/java/com/axellience/vuegwt/processors/utils/GeneratorsNameUtil.java#L150-L155 |
58,925 | VueGWT/vue-gwt | processors/src/main/java/com/axellience/vuegwt/processors/component/template/parser/VForDefinition.java | VForDefinition.initLoopVariable | private void initLoopVariable(String type, String name, TemplateParserContext context) {
this.loopVariableInfo =
context.addLocalVariable(context.getFullyQualifiedNameForClassName(type.trim()),
name.trim());
} | java | private void initLoopVariable(String type, String name, TemplateParserContext context) {
this.loopVariableInfo =
context.addLocalVariable(context.getFullyQualifiedNameForClassName(type.trim()),
name.trim());
} | [
"private",
"void",
"initLoopVariable",
"(",
"String",
"type",
",",
"String",
"name",
",",
"TemplateParserContext",
"context",
")",
"{",
"this",
".",
"loopVariableInfo",
"=",
"context",
".",
"addLocalVariable",
"(",
"context",
".",
"getFullyQualifiedNameForClassName",
... | Init the loop variable and add it to the parser context
@param type Java type of the variable, will look for qualified class name in the context
@param name Name of the variable
@param context Context of the template parser | [
"Init",
"the",
"loop",
"variable",
"and",
"add",
"it",
"to",
"the",
"parser",
"context"
] | 961cd83aed6fe8e2dd80c279847f1b3f62918a1f | https://github.com/VueGWT/vue-gwt/blob/961cd83aed6fe8e2dd80c279847f1b3f62918a1f/processors/src/main/java/com/axellience/vuegwt/processors/component/template/parser/VForDefinition.java#L157-L161 |
58,926 | VueGWT/vue-gwt | processors/src/main/java/com/axellience/vuegwt/processors/component/template/parser/VForDefinition.java | VForDefinition.initIndexVariable | private void initIndexVariable(String name, TemplateParserContext context) {
this.indexVariableInfo = context.addLocalVariable("int", name.trim());
} | java | private void initIndexVariable(String name, TemplateParserContext context) {
this.indexVariableInfo = context.addLocalVariable("int", name.trim());
} | [
"private",
"void",
"initIndexVariable",
"(",
"String",
"name",
",",
"TemplateParserContext",
"context",
")",
"{",
"this",
".",
"indexVariableInfo",
"=",
"context",
".",
"addLocalVariable",
"(",
"\"int\"",
",",
"name",
".",
"trim",
"(",
")",
")",
";",
"}"
] | Init the index variable and add it to the parser context
@param name Name of the variable
@param context Context of the template parser | [
"Init",
"the",
"index",
"variable",
"and",
"add",
"it",
"to",
"the",
"parser",
"context"
] | 961cd83aed6fe8e2dd80c279847f1b3f62918a1f | https://github.com/VueGWT/vue-gwt/blob/961cd83aed6fe8e2dd80c279847f1b3f62918a1f/processors/src/main/java/com/axellience/vuegwt/processors/component/template/parser/VForDefinition.java#L169-L171 |
58,927 | VueGWT/vue-gwt | processors/src/main/java/com/axellience/vuegwt/processors/component/template/parser/VForDefinition.java | VForDefinition.initKeyVariable | private void initKeyVariable(String name, TemplateParserContext context) {
this.keyVariableInfo = context.addLocalVariable("String", name.trim());
} | java | private void initKeyVariable(String name, TemplateParserContext context) {
this.keyVariableInfo = context.addLocalVariable("String", name.trim());
} | [
"private",
"void",
"initKeyVariable",
"(",
"String",
"name",
",",
"TemplateParserContext",
"context",
")",
"{",
"this",
".",
"keyVariableInfo",
"=",
"context",
".",
"addLocalVariable",
"(",
"\"String\"",
",",
"name",
".",
"trim",
"(",
")",
")",
";",
"}"
] | Init the key variable and add it to the parser context
@param name Name of the variable
@param context Context of the template parser | [
"Init",
"the",
"key",
"variable",
"and",
"add",
"it",
"to",
"the",
"parser",
"context"
] | 961cd83aed6fe8e2dd80c279847f1b3f62918a1f | https://github.com/VueGWT/vue-gwt/blob/961cd83aed6fe8e2dd80c279847f1b3f62918a1f/processors/src/main/java/com/axellience/vuegwt/processors/component/template/parser/VForDefinition.java#L179-L181 |
58,928 | VueGWT/vue-gwt | processors/src/main/java/com/axellience/vuegwt/processors/component/template/parser/result/TemplateExpression.java | TemplateExpression.toTemplateString | public String toTemplateString() {
String[] parametersName =
this.parameters.stream().map(VariableInfo::getName).toArray(String[]::new);
return this.getId() + "(" + String.join(", ", parametersName) + ")";
} | java | public String toTemplateString() {
String[] parametersName =
this.parameters.stream().map(VariableInfo::getName).toArray(String[]::new);
return this.getId() + "(" + String.join(", ", parametersName) + ")";
} | [
"public",
"String",
"toTemplateString",
"(",
")",
"{",
"String",
"[",
"]",
"parametersName",
"=",
"this",
".",
"parameters",
".",
"stream",
"(",
")",
".",
"map",
"(",
"VariableInfo",
"::",
"getName",
")",
".",
"toArray",
"(",
"String",
"[",
"]",
"::",
... | Return this expression as a string that can be placed in the template as a replacement of the
Java expression.
@return An expression that can be interpreted by Vue.js | [
"Return",
"this",
"expression",
"as",
"a",
"string",
"that",
"can",
"be",
"placed",
"in",
"the",
"template",
"as",
"a",
"replacement",
"of",
"the",
"Java",
"expression",
"."
] | 961cd83aed6fe8e2dd80c279847f1b3f62918a1f | https://github.com/VueGWT/vue-gwt/blob/961cd83aed6fe8e2dd80c279847f1b3f62918a1f/processors/src/main/java/com/axellience/vuegwt/processors/component/template/parser/result/TemplateExpression.java#L93-L98 |
58,929 | VueGWT/vue-gwt | processors/src/main/java/com/axellience/vuegwt/processors/component/template/parser/TemplateParser.java | TemplateParser.parseHtmlTemplate | 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 | 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);
... | [
"public",
"TemplateParserResult",
"parseHtmlTemplate",
"(",
"String",
"htmlTemplate",
",",
"TemplateParserContext",
"context",
",",
"Elements",
"elements",
",",
"Messager",
"messager",
",",
"URI",
"htmlTemplateUri",
")",
"{",
"this",
".",
"context",
"=",
"context",
... | Parse a given HTML template and return the a result object containing the expressions and a
transformed HTML.
@param htmlTemplate The HTML template to process, as a String
@param context Context of the Component we are currently processing
@param messager Used to report errors in template during Annotation Processing
... | [
"Parse",
"a",
"given",
"HTML",
"template",
"and",
"return",
"the",
"a",
"result",
"object",
"containing",
"the",
"expressions",
"and",
"a",
"transformed",
"HTML",
"."
] | 961cd83aed6fe8e2dd80c279847f1b3f62918a1f | https://github.com/VueGWT/vue-gwt/blob/961cd83aed6fe8e2dd80c279847f1b3f62918a1f/processors/src/main/java/com/axellience/vuegwt/processors/component/template/parser/TemplateParser.java#L101-L121 |
58,930 | VueGWT/vue-gwt | processors/src/main/java/com/axellience/vuegwt/processors/component/template/parser/TemplateParser.java | TemplateParser.processImports | 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 processImports(Source doc) {
doc
.getAllElements()
.stream()
.filter(element -> "vue-gwt:import".equalsIgnoreCase(element.getName()))
.peek(importElement -> {
String classAttributeValue = importElement.getAttributeValue("class");
if (classAttributeVal... | [
"private",
"void",
"processImports",
"(",
"Source",
"doc",
")",
"{",
"doc",
".",
"getAllElements",
"(",
")",
".",
"stream",
"(",
")",
".",
"filter",
"(",
"element",
"->",
"\"vue-gwt:import\"",
".",
"equalsIgnoreCase",
"(",
"element",
".",
"getName",
"(",
"... | Add java imports in the template to the context.
@param doc The document to process | [
"Add",
"java",
"imports",
"in",
"the",
"template",
"to",
"the",
"context",
"."
] | 961cd83aed6fe8e2dd80c279847f1b3f62918a1f | https://github.com/VueGWT/vue-gwt/blob/961cd83aed6fe8e2dd80c279847f1b3f62918a1f/processors/src/main/java/com/axellience/vuegwt/processors/component/template/parser/TemplateParser.java#L137-L154 |
58,931 | VueGWT/vue-gwt | processors/src/main/java/com/axellience/vuegwt/processors/component/template/parser/TemplateParser.java | TemplateParser.processElement | 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 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... | [
"private",
"void",
"processElement",
"(",
"Element",
"element",
")",
"{",
"context",
".",
"setCurrentSegment",
"(",
"element",
")",
";",
"currentProp",
"=",
"null",
";",
"currentAttribute",
"=",
"null",
";",
"// Process attributes",
"boolean",
"shouldPopContext",
... | Recursive method that will process the whole template DOM tree.
@param element Current element being processed | [
"Recursive",
"method",
"that",
"will",
"process",
"the",
"whole",
"template",
"DOM",
"tree",
"."
] | 961cd83aed6fe8e2dd80c279847f1b3f62918a1f | https://github.com/VueGWT/vue-gwt/blob/961cd83aed6fe8e2dd80c279847f1b3f62918a1f/processors/src/main/java/com/axellience/vuegwt/processors/component/template/parser/TemplateParser.java#L206-L237 |
58,932 | VueGWT/vue-gwt | processors/src/main/java/com/axellience/vuegwt/processors/component/template/parser/TemplateParser.java | TemplateParser.getTypeFromDOMElement | private TypeMirror getTypeFromDOMElement(Element element) {
return DOMElementsUtil
.getTypeForElementTag(element.getStartTag().getName())
.map(Class::getCanonicalName)
.map(elements::getTypeElement)
.map(TypeElement::asType)
.orElse(null);
} | java | private TypeMirror getTypeFromDOMElement(Element element) {
return DOMElementsUtil
.getTypeForElementTag(element.getStartTag().getName())
.map(Class::getCanonicalName)
.map(elements::getTypeElement)
.map(TypeElement::asType)
.orElse(null);
} | [
"private",
"TypeMirror",
"getTypeFromDOMElement",
"(",
"Element",
"element",
")",
"{",
"return",
"DOMElementsUtil",
".",
"getTypeForElementTag",
"(",
"element",
".",
"getStartTag",
"(",
")",
".",
"getName",
"(",
")",
")",
".",
"map",
"(",
"Class",
"::",
"getCa... | Find the corresponding TypeMirror from Elemental2 for a given DOM Element
@param element The element we want the TypeMirror of
@return The type mirror | [
"Find",
"the",
"corresponding",
"TypeMirror",
"from",
"Elemental2",
"for",
"a",
"given",
"DOM",
"Element"
] | 961cd83aed6fe8e2dd80c279847f1b3f62918a1f | https://github.com/VueGWT/vue-gwt/blob/961cd83aed6fe8e2dd80c279847f1b3f62918a1f/processors/src/main/java/com/axellience/vuegwt/processors/component/template/parser/TemplateParser.java#L333-L340 |
58,933 | VueGWT/vue-gwt | processors/src/main/java/com/axellience/vuegwt/processors/component/template/parser/TemplateParser.java | TemplateParser.registerMandatoryAttributes | 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 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 = ... | [
"private",
"void",
"registerMandatoryAttributes",
"(",
"Attributes",
"attributes",
")",
"{",
"// see https://sourceforge.net/p/jerichohtml/discussion/350024/thread/501a7d05/",
"Map",
"<",
"String",
",",
"String",
">",
"attrs",
"=",
"context",
".",
"getMandatoryAttributes",
"(... | Register mandatory attributes for Scoped CSS | [
"Register",
"mandatory",
"attributes",
"for",
"Scoped",
"CSS"
] | 961cd83aed6fe8e2dd80c279847f1b3f62918a1f | https://github.com/VueGWT/vue-gwt/blob/961cd83aed6fe8e2dd80c279847f1b3f62918a1f/processors/src/main/java/com/axellience/vuegwt/processors/component/template/parser/TemplateParser.java#L351-L364 |
58,934 | VueGWT/vue-gwt | processors/src/main/java/com/axellience/vuegwt/processors/component/template/parser/TemplateParser.java | TemplateParser.getExpressionReturnTypeForAttribute | 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 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... | [
"private",
"TypeName",
"getExpressionReturnTypeForAttribute",
"(",
"Attribute",
"attribute",
",",
"Map",
"<",
"String",
",",
"Class",
"<",
"?",
">",
">",
"propertiesTypes",
")",
"{",
"String",
"attributeName",
"=",
"attribute",
".",
"getKey",
"(",
")",
".",
"t... | Guess the type of the expression based on where it is used. The guessed type can be overridden
by adding a Cast to the desired type at the beginning of the expression.
@param attribute The attribute the expression is in | [
"Guess",
"the",
"type",
"of",
"the",
"expression",
"based",
"on",
"where",
"it",
"is",
"used",
".",
"The",
"guessed",
"type",
"can",
"be",
"overridden",
"by",
"adding",
"a",
"Cast",
"to",
"the",
"desired",
"type",
"at",
"the",
"beginning",
"of",
"the",
... | 961cd83aed6fe8e2dd80c279847f1b3f62918a1f | https://github.com/VueGWT/vue-gwt/blob/961cd83aed6fe8e2dd80c279847f1b3f62918a1f/processors/src/main/java/com/axellience/vuegwt/processors/component/template/parser/TemplateParser.java#L485-L514 |
58,935 | VueGWT/vue-gwt | processors/src/main/java/com/axellience/vuegwt/processors/component/template/parser/TemplateParser.java | TemplateParser.processVForValue | 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 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());
/... | [
"private",
"String",
"processVForValue",
"(",
"String",
"vForValue",
")",
"{",
"VForDefinition",
"vForDef",
"=",
"new",
"VForDefinition",
"(",
"vForValue",
",",
"context",
",",
"logger",
")",
";",
"// Set return of the \"in\" expression",
"currentExpressionReturnType",
... | Process a v-for value. It will register the loop variables as a local variable in the context
stack.
@param vForValue The value of the v-for attribute
@return A processed v-for value, should be placed in the HTML in place of the original v-for
value | [
"Process",
"a",
"v",
"-",
"for",
"value",
".",
"It",
"will",
"register",
"the",
"loop",
"variables",
"as",
"a",
"local",
"variable",
"in",
"the",
"context",
"stack",
"."
] | 961cd83aed6fe8e2dd80c279847f1b3f62918a1f | https://github.com/VueGWT/vue-gwt/blob/961cd83aed6fe8e2dd80c279847f1b3f62918a1f/processors/src/main/java/com/axellience/vuegwt/processors/component/template/parser/TemplateParser.java#L524-L534 |
58,936 | VueGWT/vue-gwt | processors/src/main/java/com/axellience/vuegwt/processors/component/template/parser/TemplateParser.java | TemplateParser.processSlotScopeValue | private String processSlotScopeValue(String value) {
SlotScopeDefinition slotScopeDefinition = new SlotScopeDefinition(value, context, logger);
return slotScopeDefinition.getSlotScopeVariableName();
} | java | private String processSlotScopeValue(String value) {
SlotScopeDefinition slotScopeDefinition = new SlotScopeDefinition(value, context, logger);
return slotScopeDefinition.getSlotScopeVariableName();
} | [
"private",
"String",
"processSlotScopeValue",
"(",
"String",
"value",
")",
"{",
"SlotScopeDefinition",
"slotScopeDefinition",
"=",
"new",
"SlotScopeDefinition",
"(",
"value",
",",
"context",
",",
"logger",
")",
";",
"return",
"slotScopeDefinition",
".",
"getSlotScopeV... | Process a scoped-slot value. | [
"Process",
"a",
"scoped",
"-",
"slot",
"value",
"."
] | 961cd83aed6fe8e2dd80c279847f1b3f62918a1f | https://github.com/VueGWT/vue-gwt/blob/961cd83aed6fe8e2dd80c279847f1b3f62918a1f/processors/src/main/java/com/axellience/vuegwt/processors/component/template/parser/TemplateParser.java#L539-L542 |
58,937 | VueGWT/vue-gwt | processors/src/main/java/com/axellience/vuegwt/processors/component/template/parser/TemplateParser.java | TemplateParser.processExpression | 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 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... | [
"private",
"String",
"processExpression",
"(",
"String",
"expressionString",
")",
"{",
"expressionString",
"=",
"expressionString",
"==",
"null",
"?",
"\"\"",
":",
"expressionString",
".",
"trim",
"(",
")",
";",
"if",
"(",
"expressionString",
".",
"isEmpty",
"("... | Process a given template expression
@param expressionString Should be either empty or a valid Java expression
@return The processed expression | [
"Process",
"a",
"given",
"template",
"expression"
] | 961cd83aed6fe8e2dd80c279847f1b3f62918a1f | https://github.com/VueGWT/vue-gwt/blob/961cd83aed6fe8e2dd80c279847f1b3f62918a1f/processors/src/main/java/com/axellience/vuegwt/processors/component/template/parser/TemplateParser.java#L550-L582 |
58,938 | VueGWT/vue-gwt | processors/src/main/java/com/axellience/vuegwt/processors/component/template/parser/TemplateParser.java | TemplateParser.shouldSkipExpressionProcessing | 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 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... | [
"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 primi... | In some cases we want to skip expression processing for optimization. This is when we are sure
the expression is valid and there is no need to create a Java method for it.
@param expressionString The expression to asses
@return true if we can skip the expression | [
"In",
"some",
"cases",
"we",
"want",
"to",
"skip",
"expression",
"processing",
"for",
"optimization",
".",
"This",
"is",
"when",
"we",
"are",
"sure",
"the",
"expression",
"is",
"valid",
"and",
"there",
"is",
"no",
"need",
"to",
"create",
"a",
"Java",
"me... | 961cd83aed6fe8e2dd80c279847f1b3f62918a1f | https://github.com/VueGWT/vue-gwt/blob/961cd83aed6fe8e2dd80c279847f1b3f62918a1f/processors/src/main/java/com/axellience/vuegwt/processors/component/template/parser/TemplateParser.java#L591-L599 |
58,939 | VueGWT/vue-gwt | processors/src/main/java/com/axellience/vuegwt/processors/component/template/parser/TemplateParser.java | TemplateParser.processJavaExpression | 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 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... | [
"private",
"TemplateExpression",
"processJavaExpression",
"(",
"String",
"expressionString",
")",
"{",
"Expression",
"expression",
";",
"try",
"{",
"expression",
"=",
"JavaParser",
".",
"parseExpression",
"(",
"expressionString",
")",
";",
"}",
"catch",
"(",
"ParseP... | Process the given string as a Java expression.
@param expressionString A valid Java expression
@return A processed expression, should be placed in the HTML in place of the original
expression | [
"Process",
"the",
"given",
"string",
"as",
"a",
"Java",
"expression",
"."
] | 961cd83aed6fe8e2dd80c279847f1b3f62918a1f | https://github.com/VueGWT/vue-gwt/blob/961cd83aed6fe8e2dd80c279847f1b3f62918a1f/processors/src/main/java/com/axellience/vuegwt/processors/component/template/parser/TemplateParser.java#L635-L667 |
58,940 | VueGWT/vue-gwt | processors/src/main/java/com/axellience/vuegwt/processors/component/template/parser/TemplateParser.java | TemplateParser.resolveTypesUsingImports | 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 resolveTypesUsingImports(Expression expression) {
if (expression instanceof NodeWithType) {
NodeWithType<?, ?> nodeWithType = ((NodeWithType<?, ?>) expression);
nodeWithType.setType(getQualifiedName(nodeWithType.getType()));
}
// Recurse downward in the expression
expression
... | [
"private",
"void",
"resolveTypesUsingImports",
"(",
"Expression",
"expression",
")",
"{",
"if",
"(",
"expression",
"instanceof",
"NodeWithType",
")",
"{",
"NodeWithType",
"<",
"?",
",",
"?",
">",
"nodeWithType",
"=",
"(",
"(",
"NodeWithType",
"<",
"?",
",",
... | Resolve all the types in the expression. This will replace the Class with the full qualified
name using the template imports.
@param expression A Java expression from the Template | [
"Resolve",
"all",
"the",
"types",
"in",
"the",
"expression",
".",
"This",
"will",
"replace",
"the",
"Class",
"with",
"the",
"full",
"qualified",
"name",
"using",
"the",
"template",
"imports",
"."
] | 961cd83aed6fe8e2dd80c279847f1b3f62918a1f | https://github.com/VueGWT/vue-gwt/blob/961cd83aed6fe8e2dd80c279847f1b3f62918a1f/processors/src/main/java/com/axellience/vuegwt/processors/component/template/parser/TemplateParser.java#L708-L721 |
58,941 | VueGWT/vue-gwt | processors/src/main/java/com/axellience/vuegwt/processors/component/template/parser/TemplateParser.java | TemplateParser.resolveStaticMethodsUsingImports | 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 resolveStaticMethodsUsingImports(Expression expression) {
if (expression instanceof MethodCallExpr) {
MethodCallExpr methodCall = ((MethodCallExpr) expression);
String methodName = methodCall.getName().getIdentifier();
if (!methodCall.getScope().isPresent() && context.hasStaticMethod(... | [
"private",
"void",
"resolveStaticMethodsUsingImports",
"(",
"Expression",
"expression",
")",
"{",
"if",
"(",
"expression",
"instanceof",
"MethodCallExpr",
")",
"{",
"MethodCallExpr",
"methodCall",
"=",
"(",
"(",
"MethodCallExpr",
")",
"expression",
")",
";",
"String... | Resolve static method calls using static imports
@param expression The expression to resolve | [
"Resolve",
"static",
"method",
"calls",
"using",
"static",
"imports"
] | 961cd83aed6fe8e2dd80c279847f1b3f62918a1f | https://github.com/VueGWT/vue-gwt/blob/961cd83aed6fe8e2dd80c279847f1b3f62918a1f/processors/src/main/java/com/axellience/vuegwt/processors/component/template/parser/TemplateParser.java#L728-L744 |
58,942 | VueGWT/vue-gwt | processors/src/main/java/com/axellience/vuegwt/processors/component/template/parser/TemplateParser.java | TemplateParser.checkMethodNames | 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 checkMethodNames(Expression expression) {
if (expression instanceof MethodCallExpr) {
MethodCallExpr methodCall = ((MethodCallExpr) expression);
if (!methodCall.getScope().isPresent()) {
String methodName = methodCall.getName().getIdentifier();
if (!context.hasMethod(methodN... | [
"private",
"void",
"checkMethodNames",
"(",
"Expression",
"expression",
")",
"{",
"if",
"(",
"expression",
"instanceof",
"MethodCallExpr",
")",
"{",
"MethodCallExpr",
"methodCall",
"=",
"(",
"(",
"MethodCallExpr",
")",
"expression",
")",
";",
"if",
"(",
"!",
"... | Check the expression for component method calls. This will check that the methods used in the
template exist in the Component. It throws an exception if we use a method that is not declared
in our Component. This will not check for the type or number of parameters, we leave that to
the Java Compiler.
@param expression... | [
"Check",
"the",
"expression",
"for",
"component",
"method",
"calls",
".",
"This",
"will",
"check",
"that",
"the",
"methods",
"used",
"in",
"the",
"template",
"exist",
"in",
"the",
"Component",
".",
"It",
"throws",
"an",
"exception",
"if",
"we",
"use",
"a",... | 961cd83aed6fe8e2dd80c279847f1b3f62918a1f | https://github.com/VueGWT/vue-gwt/blob/961cd83aed6fe8e2dd80c279847f1b3f62918a1f/processors/src/main/java/com/axellience/vuegwt/processors/component/template/parser/TemplateParser.java#L754-L776 |
58,943 | VueGWT/vue-gwt | processors/src/main/java/com/axellience/vuegwt/processors/component/factory/AbstractVueComponentFactoryGenerator.java | AbstractVueComponentFactoryGenerator.createStaticGetMethod | 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 | 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... | [
"private",
"void",
"createStaticGetMethod",
"(",
"TypeElement",
"component",
",",
"ClassName",
"vueFactoryClassName",
",",
"Builder",
"vueFactoryBuilder",
",",
"List",
"<",
"CodeBlock",
">",
"staticInitParameters",
")",
"{",
"MethodSpec",
".",
"Builder",
"getBuilder",
... | Create a static get method that can be used to retrieve an instance of our Factory. Factory
retrieved using this method do NOT support injection.
@param component The Component we generate for
@param vueFactoryClassName The type name of our generated {@link VueComponentFactory}
@param vueFactoryBuilder The builder to ... | [
"Create",
"a",
"static",
"get",
"method",
"that",
"can",
"be",
"used",
"to",
"retrieve",
"an",
"instance",
"of",
"our",
"Factory",
".",
"Factory",
"retrieved",
"using",
"this",
"method",
"do",
"NOT",
"support",
"injection",
"."
] | 961cd83aed6fe8e2dd80c279847f1b3f62918a1f | https://github.com/VueGWT/vue-gwt/blob/961cd83aed6fe8e2dd80c279847f1b3f62918a1f/processors/src/main/java/com/axellience/vuegwt/processors/component/factory/AbstractVueComponentFactoryGenerator.java#L164-L197 |
58,944 | VueGWT/vue-gwt | processors/src/main/java/com/axellience/vuegwt/processors/component/template/parser/result/TemplateParserResult.java | TemplateParserResult.addExpression | 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 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,
... | [
"public",
"TemplateExpression",
"addExpression",
"(",
"String",
"expression",
",",
"TypeName",
"expressionType",
",",
"boolean",
"shouldCast",
",",
"List",
"<",
"VariableInfo",
">",
"parameters",
")",
"{",
"String",
"id",
"=",
"\"exp$\"",
"+",
"this",
".",
"expr... | Add an expression to the result. All the Java methods from the template will be added here so
we can add them to our Vue.js component.
@param expression The Java expression
@param expressionType The type of the expression, determined depending on the context it is
used in.
@param shouldCast Should the expression be ca... | [
"Add",
"an",
"expression",
"to",
"the",
"result",
".",
"All",
"the",
"Java",
"methods",
"from",
"the",
"template",
"will",
"be",
"added",
"here",
"so",
"we",
"can",
"add",
"them",
"to",
"our",
"Vue",
".",
"js",
"component",
"."
] | 961cd83aed6fe8e2dd80c279847f1b3f62918a1f | https://github.com/VueGWT/vue-gwt/blob/961cd83aed6fe8e2dd80c279847f1b3f62918a1f/processors/src/main/java/com/axellience/vuegwt/processors/component/template/parser/result/TemplateParserResult.java#L68-L81 |
58,945 | VueGWT/vue-gwt | processors/src/main/java/com/axellience/vuegwt/processors/component/template/parser/result/TemplateParserResult.java | TemplateParserResult.addRef | public void addRef(String name, TypeMirror elementType, boolean isArray) {
refs.add(new RefInfo(name, elementType, isArray));
} | java | public void addRef(String name, TypeMirror elementType, boolean isArray) {
refs.add(new RefInfo(name, elementType, isArray));
} | [
"public",
"void",
"addRef",
"(",
"String",
"name",
",",
"TypeMirror",
"elementType",
",",
"boolean",
"isArray",
")",
"{",
"refs",
".",
"add",
"(",
"new",
"RefInfo",
"(",
"name",
",",
"elementType",
",",
"isArray",
")",
")",
";",
"}"
] | Register a ref found in the template
@param name The name of the ref
@param elementType The type of the element the Ref is on
@param isArray Whether the ref is in a v-for (should be an array) | [
"Register",
"a",
"ref",
"found",
"in",
"the",
"template"
] | 961cd83aed6fe8e2dd80c279847f1b3f62918a1f | https://github.com/VueGWT/vue-gwt/blob/961cd83aed6fe8e2dd80c279847f1b3f62918a1f/processors/src/main/java/com/axellience/vuegwt/processors/component/template/parser/result/TemplateParserResult.java#L97-L99 |
58,946 | VueGWT/vue-gwt | core/src/main/java/com/axellience/vuegwt/core/client/tools/VueGWTTools.java | VueGWTTools.escapeStringForJsRegexp | public static String escapeStringForJsRegexp(String input) {
JsString string = uncheckedCast(input);
return string.replace(ESCAPE_JS_STRING_REGEXP, "\\$&");
} | java | public static String escapeStringForJsRegexp(String input) {
JsString string = uncheckedCast(input);
return string.replace(ESCAPE_JS_STRING_REGEXP, "\\$&");
} | [
"public",
"static",
"String",
"escapeStringForJsRegexp",
"(",
"String",
"input",
")",
"{",
"JsString",
"string",
"=",
"uncheckedCast",
"(",
"input",
")",
";",
"return",
"string",
".",
"replace",
"(",
"ESCAPE_JS_STRING_REGEXP",
",",
"\"\\\\$&\"",
")",
";",
"}"
] | Escape a String to be used in a JsRegexp as a String literal
@param input The String we want to escape
@return The escaped String | [
"Escape",
"a",
"String",
"to",
"be",
"used",
"in",
"a",
"JsRegexp",
"as",
"a",
"String",
"literal"
] | 961cd83aed6fe8e2dd80c279847f1b3f62918a1f | https://github.com/VueGWT/vue-gwt/blob/961cd83aed6fe8e2dd80c279847f1b3f62918a1f/core/src/main/java/com/axellience/vuegwt/core/client/tools/VueGWTTools.java#L218-L221 |
58,947 | VueGWT/vue-gwt | processors/src/main/java/com/axellience/vuegwt/processors/component/factory/VueComponentFactoryGenerator.java | VueComponentFactoryGenerator.registerLocalDirectives | private void registerLocalDirectives(Component annotation, MethodSpec.Builder initBuilder) {
try {
Class<?>[] componentsClass = annotation.directives();
if (componentsClass.length > 0) {
addGetDirectivesStatement(initBuilder);
}
Stream
.of(componentsClass)
.forE... | java | private void registerLocalDirectives(Component annotation, MethodSpec.Builder initBuilder) {
try {
Class<?>[] componentsClass = annotation.directives();
if (componentsClass.length > 0) {
addGetDirectivesStatement(initBuilder);
}
Stream
.of(componentsClass)
.forE... | [
"private",
"void",
"registerLocalDirectives",
"(",
"Component",
"annotation",
",",
"MethodSpec",
".",
"Builder",
"initBuilder",
")",
"{",
"try",
"{",
"Class",
"<",
"?",
">",
"[",
"]",
"componentsClass",
"=",
"annotation",
".",
"directives",
"(",
")",
";",
"i... | Register directives passed to the annotation.
@param annotation The Component annotation on the Component we generate for
@param initBuilder The builder for the init method | [
"Register",
"directives",
"passed",
"to",
"the",
"annotation",
"."
] | 961cd83aed6fe8e2dd80c279847f1b3f62918a1f | https://github.com/VueGWT/vue-gwt/blob/961cd83aed6fe8e2dd80c279847f1b3f62918a1f/processors/src/main/java/com/axellience/vuegwt/processors/component/factory/VueComponentFactoryGenerator.java#L179-L206 |
58,948 | VueGWT/vue-gwt | core/src/main/java/com/axellience/vuegwt/core/client/component/options/VueComponentOptions.java | VueComponentOptions.initRenderFunctions | @JsOverlay
public final void initRenderFunctions(Function renderFunctionString,
Function[] staticRenderFnsStrings) {
this.setRender(renderFunctionString);
this.setStaticRenderFns(cast(staticRenderFnsStrings));
} | java | @JsOverlay
public final void initRenderFunctions(Function renderFunctionString,
Function[] staticRenderFnsStrings) {
this.setRender(renderFunctionString);
this.setStaticRenderFns(cast(staticRenderFnsStrings));
} | [
"@",
"JsOverlay",
"public",
"final",
"void",
"initRenderFunctions",
"(",
"Function",
"renderFunctionString",
",",
"Function",
"[",
"]",
"staticRenderFnsStrings",
")",
"{",
"this",
".",
"setRender",
"(",
"renderFunctionString",
")",
";",
"this",
".",
"setStaticRender... | Initialise the render functions from our template.
@param renderFunctionString The render function
@param staticRenderFnsStrings The static render functions | [
"Initialise",
"the",
"render",
"functions",
"from",
"our",
"template",
"."
] | 961cd83aed6fe8e2dd80c279847f1b3f62918a1f | https://github.com/VueGWT/vue-gwt/blob/961cd83aed6fe8e2dd80c279847f1b3f62918a1f/core/src/main/java/com/axellience/vuegwt/core/client/component/options/VueComponentOptions.java#L68-L73 |
58,949 | VueGWT/vue-gwt | core/src/main/java/com/axellience/vuegwt/core/client/component/options/VueComponentOptions.java | VueComponentOptions.initData | @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 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... | [
"@",
"JsOverlay",
"public",
"final",
"void",
"initData",
"(",
"boolean",
"useFactory",
",",
"Set",
"<",
"String",
">",
"fieldNames",
")",
"{",
"JsPropertyMap",
"<",
"Object",
">",
"dataFields",
"=",
"JsPropertyMap",
".",
"of",
"(",
")",
";",
"dataFieldsToPro... | Initialise the data structure, then set it to either a Factory or directly on the Component.
@param useFactory Boolean representing whether or not to use a Factory.
@param fieldNames Name of the data fields in the object | [
"Initialise",
"the",
"data",
"structure",
"then",
"set",
"it",
"to",
"either",
"a",
"Factory",
"or",
"directly",
"on",
"the",
"Component",
"."
] | 961cd83aed6fe8e2dd80c279847f1b3f62918a1f | https://github.com/VueGWT/vue-gwt/blob/961cd83aed6fe8e2dd80c279847f1b3f62918a1f/core/src/main/java/com/axellience/vuegwt/core/client/component/options/VueComponentOptions.java#L81-L100 |
58,950 | VueGWT/vue-gwt | core/src/main/java/com/axellience/vuegwt/core/client/component/options/VueComponentOptions.java | VueComponentOptions.addJavaComputed | @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 addJavaComputed(Function javaMethod, String computedPropertyName,
ComputedKind kind) {
ComputedOptions computedDefinition = getComputedOptions(computedPropertyName);
if (computedDefinition == null) {
computedDefinition = new ComputedOptions();
addComputedOptions(... | [
"@",
"JsOverlay",
"public",
"final",
"void",
"addJavaComputed",
"(",
"Function",
"javaMethod",
",",
"String",
"computedPropertyName",
",",
"ComputedKind",
"kind",
")",
"{",
"ComputedOptions",
"computedDefinition",
"=",
"getComputedOptions",
"(",
"computedPropertyName",
... | Add a computed property to this ComponentOptions. If the computed has both a getter and a
setter, this will be called twice, once for each.
@param javaMethod Function pointer to the method in the {@link IsVueComponent}
@param computedPropertyName Name of the computed property in the Template and the
ComponentOptions
@... | [
"Add",
"a",
"computed",
"property",
"to",
"this",
"ComponentOptions",
".",
"If",
"the",
"computed",
"has",
"both",
"a",
"getter",
"and",
"a",
"setter",
"this",
"will",
"be",
"called",
"twice",
"once",
"for",
"each",
"."
] | 961cd83aed6fe8e2dd80c279847f1b3f62918a1f | https://github.com/VueGWT/vue-gwt/blob/961cd83aed6fe8e2dd80c279847f1b3f62918a1f/core/src/main/java/com/axellience/vuegwt/core/client/component/options/VueComponentOptions.java#L111-L125 |
58,951 | VueGWT/vue-gwt | core/src/main/java/com/axellience/vuegwt/core/client/component/options/VueComponentOptions.java | VueComponentOptions.addJavaWatch | @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 addJavaWatch(Function javaMethod, String watchedPropertyName,
boolean isDeep, boolean isImmediate) {
if (!isDeep && !isImmediate) {
addWatch(watchedPropertyName, javaMethod);
return;
}
JsPropertyMap<Object> watchDefinition = JsPropertyMap.of();
watchDefi... | [
"@",
"JsOverlay",
"public",
"final",
"void",
"addJavaWatch",
"(",
"Function",
"javaMethod",
",",
"String",
"watchedPropertyName",
",",
"boolean",
"isDeep",
",",
"boolean",
"isImmediate",
")",
"{",
"if",
"(",
"!",
"isDeep",
"&&",
"!",
"isImmediate",
")",
"{",
... | Add a watch property to this Component Definition
@param javaMethod Function pointer to the method in the {@link IsVueComponent}
@param watchedPropertyName Name of the property name to watch in the data model
@param isDeep Is the watcher deep (will watch child properties)
@param isImmediate Is the watcher immediate (w... | [
"Add",
"a",
"watch",
"property",
"to",
"this",
"Component",
"Definition"
] | 961cd83aed6fe8e2dd80c279847f1b3f62918a1f | https://github.com/VueGWT/vue-gwt/blob/961cd83aed6fe8e2dd80c279847f1b3f62918a1f/core/src/main/java/com/axellience/vuegwt/core/client/component/options/VueComponentOptions.java#L135-L148 |
58,952 | VueGWT/vue-gwt | core/src/main/java/com/axellience/vuegwt/core/client/component/options/VueComponentOptions.java | VueComponentOptions.addJavaProp | @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 | @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... | [
"@",
"JsOverlay",
"public",
"final",
"void",
"addJavaProp",
"(",
"String",
"propName",
",",
"String",
"fieldName",
",",
"boolean",
"required",
",",
"String",
"exposedTypeName",
")",
"{",
"if",
"(",
"propsToProxy",
"==",
"null",
")",
"{",
"propsToProxy",
"=",
... | Add a prop to our ComponentOptions. This will allow to receive data from the outside of our
Component.
@param propName The name of the prop
@param fieldName The name of the java field for that prop
@param required Is the property required (mandatory)
@param exposedTypeName JS name of the type of this property, if not ... | [
"Add",
"a",
"prop",
"to",
"our",
"ComponentOptions",
".",
"This",
"will",
"allow",
"to",
"receive",
"data",
"from",
"the",
"outside",
"of",
"our",
"Component",
"."
] | 961cd83aed6fe8e2dd80c279847f1b3f62918a1f | https://github.com/VueGWT/vue-gwt/blob/961cd83aed6fe8e2dd80c279847f1b3f62918a1f/core/src/main/java/com/axellience/vuegwt/core/client/component/options/VueComponentOptions.java#L171-L187 |
58,953 | VueGWT/vue-gwt | processors/src/main/java/com/axellience/vuegwt/processors/component/template/ComponentTemplateProcessor.java | ComponentTemplateProcessor.findLocalComponentsForComponent | private void findLocalComponentsForComponent(LocalComponents localComponents,
TypeElement componentTypeElement) {
Component componentAnnotation = componentTypeElement.getAnnotation(Component.class);
if (componentAnnotation == null) {
return;
}
processLocalComponentClass(localComponents, com... | java | private void findLocalComponentsForComponent(LocalComponents localComponents,
TypeElement componentTypeElement) {
Component componentAnnotation = componentTypeElement.getAnnotation(Component.class);
if (componentAnnotation == null) {
return;
}
processLocalComponentClass(localComponents, com... | [
"private",
"void",
"findLocalComponentsForComponent",
"(",
"LocalComponents",
"localComponents",
",",
"TypeElement",
"componentTypeElement",
")",
"{",
"Component",
"componentAnnotation",
"=",
"componentTypeElement",
".",
"getAnnotation",
"(",
"Component",
".",
"class",
")",... | Register all locally declared components.
@param localComponents The {@link LocalComponents} where we register our local components
@param componentTypeElement The class to process | [
"Register",
"all",
"locally",
"declared",
"components",
"."
] | 961cd83aed6fe8e2dd80c279847f1b3f62918a1f | https://github.com/VueGWT/vue-gwt/blob/961cd83aed6fe8e2dd80c279847f1b3f62918a1f/processors/src/main/java/com/axellience/vuegwt/processors/component/template/ComponentTemplateProcessor.java#L186-L206 |
58,954 | VueGWT/vue-gwt | core/src/main/java/com/axellience/vuegwt/core/client/observer/VueGWTObserverManager.java | VueGWTObserverManager.customizeVueObserverPrototype | public void customizeVueObserverPrototype(VueObserver vueObserver) {
vueObserveArrayFunction = vueObserver.getObserveArray();
vueWalkFunction = vueObserver.getWalk();
vueObserver.setWalk(toObserve -> {
if (observeJavaObject(toObserve)) {
return;
}
vueWalkFunction.call(this, toObs... | java | public void customizeVueObserverPrototype(VueObserver vueObserver) {
vueObserveArrayFunction = vueObserver.getObserveArray();
vueWalkFunction = vueObserver.getWalk();
vueObserver.setWalk(toObserve -> {
if (observeJavaObject(toObserve)) {
return;
}
vueWalkFunction.call(this, toObs... | [
"public",
"void",
"customizeVueObserverPrototype",
"(",
"VueObserver",
"vueObserver",
")",
"{",
"vueObserveArrayFunction",
"=",
"vueObserver",
".",
"getObserveArray",
"(",
")",
";",
"vueWalkFunction",
"=",
"vueObserver",
".",
"getWalk",
"(",
")",
";",
"vueObserver",
... | Customize the VueObserver instance. We get in between to be warned whenever an object is
observed and observe it using our Java observers if necessary.
@param vueObserver A {@link VueObserver} | [
"Customize",
"the",
"VueObserver",
"instance",
".",
"We",
"get",
"in",
"between",
"to",
"be",
"warned",
"whenever",
"an",
"object",
"is",
"observed",
"and",
"observe",
"it",
"using",
"our",
"Java",
"observers",
"if",
"necessary",
"."
] | 961cd83aed6fe8e2dd80c279847f1b3f62918a1f | https://github.com/VueGWT/vue-gwt/blob/961cd83aed6fe8e2dd80c279847f1b3f62918a1f/core/src/main/java/com/axellience/vuegwt/core/client/observer/VueGWTObserverManager.java#L135-L146 |
58,955 | VueGWT/vue-gwt | processors/src/main/java/com/axellience/vuegwt/processors/utils/InjectedDependenciesUtil.java | InjectedDependenciesUtil.hasInjectAnnotation | 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 static boolean hasInjectAnnotation(Element element) {
for (AnnotationMirror annotationMirror : element.getAnnotationMirrors()) {
String annotationQualifiedName = annotationMirror.getAnnotationType().toString();
if (annotationQualifiedName.equals(Inject.class.getCanonicalName())) {
return ... | [
"public",
"static",
"boolean",
"hasInjectAnnotation",
"(",
"Element",
"element",
")",
"{",
"for",
"(",
"AnnotationMirror",
"annotationMirror",
":",
"element",
".",
"getAnnotationMirrors",
"(",
")",
")",
"{",
"String",
"annotationQualifiedName",
"=",
"annotationMirror"... | Check if the given element has an Inject annotation. Either the one from Google Gin, or the
javax one. We don't want to depend on Gin, so we check the google one based on qualifiedName
@param element The element we want to check
@return True if has an Inject annotation, false otherwise | [
"Check",
"if",
"the",
"given",
"element",
"has",
"an",
"Inject",
"annotation",
".",
"Either",
"the",
"one",
"from",
"Google",
"Gin",
"or",
"the",
"javax",
"one",
".",
"We",
"don",
"t",
"want",
"to",
"depend",
"on",
"Gin",
"so",
"we",
"check",
"the",
... | 961cd83aed6fe8e2dd80c279847f1b3f62918a1f | https://github.com/VueGWT/vue-gwt/blob/961cd83aed6fe8e2dd80c279847f1b3f62918a1f/processors/src/main/java/com/axellience/vuegwt/processors/utils/InjectedDependenciesUtil.java#L38-L49 |
58,956 | VueGWT/vue-gwt | processors/src/main/java/com/axellience/vuegwt/processors/directive/VueDirectiveOptionsGenerator.java | VueDirectiveOptionsGenerator.generate | public void generate(TypeElement directiveTypeElement) {
ClassName optionsClassName = GeneratorsNameUtil.directiveOptionsName(directiveTypeElement);
Builder componentClassBuilder = TypeSpec
.classBuilder(optionsClassName)
.addModifiers(Modifier.PUBLIC, Modifier.FINAL)
.superclass(VueDir... | java | public void generate(TypeElement directiveTypeElement) {
ClassName optionsClassName = GeneratorsNameUtil.directiveOptionsName(directiveTypeElement);
Builder componentClassBuilder = TypeSpec
.classBuilder(optionsClassName)
.addModifiers(Modifier.PUBLIC, Modifier.FINAL)
.superclass(VueDir... | [
"public",
"void",
"generate",
"(",
"TypeElement",
"directiveTypeElement",
")",
"{",
"ClassName",
"optionsClassName",
"=",
"GeneratorsNameUtil",
".",
"directiveOptionsName",
"(",
"directiveTypeElement",
")",
";",
"Builder",
"componentClassBuilder",
"=",
"TypeSpec",
".",
... | Generate and save the Java file for the typeElement passed to the constructor
@param directiveTypeElement The {@link VueDirective} class to generate {@link
VueDirectiveOptions} from | [
"Generate",
"and",
"save",
"the",
"Java",
"file",
"for",
"the",
"typeElement",
"passed",
"to",
"the",
"constructor"
] | 961cd83aed6fe8e2dd80c279847f1b3f62918a1f | https://github.com/VueGWT/vue-gwt/blob/961cd83aed6fe8e2dd80c279847f1b3f62918a1f/processors/src/main/java/com/axellience/vuegwt/processors/directive/VueDirectiveOptionsGenerator.java#L40-L71 |
58,957 | VueGWT/vue-gwt | processors/src/main/java/com/axellience/vuegwt/processors/component/ComponentExposedTypeGenerator.java | ComponentExposedTypeGenerator.exposeExposedFieldsToJs | 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 exposeExposedFieldsToJs() {
if (fieldsWithNameExposed.isEmpty()) {
return;
}
MethodSpec.Builder exposeFieldMethod = MethodSpec
.methodBuilder("vg$ef")
.addAnnotation(JsMethod.class);
fieldsWithNameExposed
.forEach(field -> exposeFieldMethod
.addSt... | [
"private",
"void",
"exposeExposedFieldsToJs",
"(",
")",
"{",
"if",
"(",
"fieldsWithNameExposed",
".",
"isEmpty",
"(",
")",
")",
"{",
"return",
";",
"}",
"MethodSpec",
".",
"Builder",
"exposeFieldMethod",
"=",
"MethodSpec",
".",
"methodBuilder",
"(",
"\"vg$ef\"",... | Generate a method that use all the fields we want to determine the name of at runtime. This is
to avoid GWT optimizing away assignation on those fields. | [
"Generate",
"a",
"method",
"that",
"use",
"all",
"the",
"fields",
"we",
"want",
"to",
"determine",
"the",
"name",
"of",
"at",
"runtime",
".",
"This",
"is",
"to",
"avoid",
"GWT",
"optimizing",
"away",
"assignation",
"on",
"those",
"fields",
"."
] | 961cd83aed6fe8e2dd80c279847f1b3f62918a1f | https://github.com/VueGWT/vue-gwt/blob/961cd83aed6fe8e2dd80c279847f1b3f62918a1f/processors/src/main/java/com/axellience/vuegwt/processors/component/ComponentExposedTypeGenerator.java#L290-L318 |
58,958 | VueGWT/vue-gwt | processors/src/main/java/com/axellience/vuegwt/processors/component/ComponentExposedTypeGenerator.java | ComponentExposedTypeGenerator.processComputed | 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 processComputed() {
getMethodsWithAnnotation(component, Computed.class).forEach(method -> {
ComputedKind kind = ComputedKind.GETTER;
if ("void".equals(method.getReturnType().toString())) {
kind = ComputedKind.SETTER;
}
String exposedMethodName = exposeExistingJavaMethod... | [
"private",
"void",
"processComputed",
"(",
")",
"{",
"getMethodsWithAnnotation",
"(",
"component",
",",
"Computed",
".",
"class",
")",
".",
"forEach",
"(",
"method",
"->",
"{",
"ComputedKind",
"kind",
"=",
"ComputedKind",
".",
"GETTER",
";",
"if",
"(",
"\"vo... | Process computed properties from the Component Class. | [
"Process",
"computed",
"properties",
"from",
"the",
"Component",
"Class",
"."
] | 961cd83aed6fe8e2dd80c279847f1b3f62918a1f | https://github.com/VueGWT/vue-gwt/blob/961cd83aed6fe8e2dd80c279847f1b3f62918a1f/processors/src/main/java/com/axellience/vuegwt/processors/component/ComponentExposedTypeGenerator.java#L351-L374 |
58,959 | VueGWT/vue-gwt | processors/src/main/java/com/axellience/vuegwt/processors/component/ComponentExposedTypeGenerator.java | ComponentExposedTypeGenerator.addFieldsForComputedMethod | 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 addFieldsForComputedMethod(TypeElement component, Set<String> alreadyDone) {
getMethodsWithAnnotation(component, Computed.class).forEach(method -> {
String propertyName = computedPropertyNameToFieldName(getComputedPropertyName(method));
if (alreadyDone.contains(propertyName)) {
ret... | [
"private",
"void",
"addFieldsForComputedMethod",
"(",
"TypeElement",
"component",
",",
"Set",
"<",
"String",
">",
"alreadyDone",
")",
"{",
"getMethodsWithAnnotation",
"(",
"component",
",",
"Computed",
".",
"class",
")",
".",
"forEach",
"(",
"method",
"->",
"{",... | Add fields for computed methods so they are visible in the template
@param component Component we are currently processing
@param alreadyDone Already processed computed properties (in case there is a getter and a | [
"Add",
"fields",
"for",
"computed",
"methods",
"so",
"they",
"are",
"visible",
"in",
"the",
"template"
] | 961cd83aed6fe8e2dd80c279847f1b3f62918a1f | https://github.com/VueGWT/vue-gwt/blob/961cd83aed6fe8e2dd80c279847f1b3f62918a1f/processors/src/main/java/com/axellience/vuegwt/processors/component/ComponentExposedTypeGenerator.java#L415-L436 |
58,960 | VueGWT/vue-gwt | processors/src/main/java/com/axellience/vuegwt/processors/component/ComponentExposedTypeGenerator.java | ComponentExposedTypeGenerator.processWatchers | private void processWatchers(MethodSpec.Builder createdMethodBuilder) {
createdMethodBuilder.addStatement("Proto p = __proto__");
getMethodsWithAnnotation(component, Watch.class)
.forEach(method -> processWatcher(createdMethodBuilder, method));
} | java | private void processWatchers(MethodSpec.Builder createdMethodBuilder) {
createdMethodBuilder.addStatement("Proto p = __proto__");
getMethodsWithAnnotation(component, Watch.class)
.forEach(method -> processWatcher(createdMethodBuilder, method));
} | [
"private",
"void",
"processWatchers",
"(",
"MethodSpec",
".",
"Builder",
"createdMethodBuilder",
")",
"{",
"createdMethodBuilder",
".",
"addStatement",
"(",
"\"Proto p = __proto__\"",
")",
";",
"getMethodsWithAnnotation",
"(",
"component",
",",
"Watch",
".",
"class",
... | Process watchers from the Component Class.
@param createdMethodBuilder Builder for the created hook method | [
"Process",
"watchers",
"from",
"the",
"Component",
"Class",
"."
] | 961cd83aed6fe8e2dd80c279847f1b3f62918a1f | https://github.com/VueGWT/vue-gwt/blob/961cd83aed6fe8e2dd80c279847f1b3f62918a1f/processors/src/main/java/com/axellience/vuegwt/processors/component/ComponentExposedTypeGenerator.java#L453-L457 |
58,961 | VueGWT/vue-gwt | processors/src/main/java/com/axellience/vuegwt/processors/component/ComponentExposedTypeGenerator.java | ComponentExposedTypeGenerator.processWatcher | 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 processWatcher(MethodSpec.Builder createdMethodBuilder, ExecutableElement method) {
Watch watch = method.getAnnotation(Watch.class);
String exposedMethodName = exposeExistingJavaMethodToJs(method);
String watcherTriggerMethodName = addNewMethodToProto();
MethodSpec.Builder watcherMethodBu... | [
"private",
"void",
"processWatcher",
"(",
"MethodSpec",
".",
"Builder",
"createdMethodBuilder",
",",
"ExecutableElement",
"method",
")",
"{",
"Watch",
"watch",
"=",
"method",
".",
"getAnnotation",
"(",
"Watch",
".",
"class",
")",
";",
"String",
"exposedMethodName"... | Process a watcher from the Component Class.
@param createdMethodBuilder Builder for the created hook method
@param method The method we are currently processing | [
"Process",
"a",
"watcher",
"from",
"the",
"Component",
"Class",
"."
] | 961cd83aed6fe8e2dd80c279847f1b3f62918a1f | https://github.com/VueGWT/vue-gwt/blob/961cd83aed6fe8e2dd80c279847f1b3f62918a1f/processors/src/main/java/com/axellience/vuegwt/processors/component/ComponentExposedTypeGenerator.java#L465-L494 |
58,962 | VueGWT/vue-gwt | processors/src/main/java/com/axellience/vuegwt/processors/component/ComponentExposedTypeGenerator.java | ComponentExposedTypeGenerator.processPropValidators | 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 processPropValidators() {
getMethodsWithAnnotation(component, PropValidator.class).forEach(method -> {
PropValidator propValidator = method.getAnnotation(PropValidator.class);
if (!TypeName.get(method.getReturnType()).equals(TypeName.BOOLEAN)) {
printError("Method "
+ m... | [
"private",
"void",
"processPropValidators",
"(",
")",
"{",
"getMethodsWithAnnotation",
"(",
"component",
",",
"PropValidator",
".",
"class",
")",
".",
"forEach",
"(",
"method",
"->",
"{",
"PropValidator",
"propValidator",
"=",
"method",
".",
"getAnnotation",
"(",
... | Process prop validators from the Component Class. | [
"Process",
"prop",
"validators",
"from",
"the",
"Component",
"Class",
"."
] | 961cd83aed6fe8e2dd80c279847f1b3f62918a1f | https://github.com/VueGWT/vue-gwt/blob/961cd83aed6fe8e2dd80c279847f1b3f62918a1f/processors/src/main/java/com/axellience/vuegwt/processors/component/ComponentExposedTypeGenerator.java#L499-L515 |
58,963 | VueGWT/vue-gwt | processors/src/main/java/com/axellience/vuegwt/processors/component/ComponentExposedTypeGenerator.java | ComponentExposedTypeGenerator.processPropDefaultValues | 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 processPropDefaultValues() {
getMethodsWithAnnotation(component, PropDefault.class).forEach(method -> {
PropDefault propValidator = method.getAnnotation(PropDefault.class);
String exposedMethodName = exposeExistingJavaMethodToJs(method);
String propertyName = propValidator.value();
... | [
"private",
"void",
"processPropDefaultValues",
"(",
")",
"{",
"getMethodsWithAnnotation",
"(",
"component",
",",
"PropDefault",
".",
"class",
")",
".",
"forEach",
"(",
"method",
"->",
"{",
"PropDefault",
"propValidator",
"=",
"method",
".",
"getAnnotation",
"(",
... | Process prop default values from the Component Class. | [
"Process",
"prop",
"default",
"values",
"from",
"the",
"Component",
"Class",
"."
] | 961cd83aed6fe8e2dd80c279847f1b3f62918a1f | https://github.com/VueGWT/vue-gwt/blob/961cd83aed6fe8e2dd80c279847f1b3f62918a1f/processors/src/main/java/com/axellience/vuegwt/processors/component/ComponentExposedTypeGenerator.java#L520-L530 |
58,964 | VueGWT/vue-gwt | processors/src/main/java/com/axellience/vuegwt/processors/component/ComponentExposedTypeGenerator.java | ComponentExposedTypeGenerator.processHooks | 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 void processHooks(Set<ExecutableElement> hookMethodsFromInterfaces) {
ElementFilter
.methodsIn(component.getEnclosedElements())
.stream()
.filter(method -> isHookMethod(component, method, hookMethodsFromInterfaces))
// Created hook is already added by createCreatedHook
... | [
"private",
"void",
"processHooks",
"(",
"Set",
"<",
"ExecutableElement",
">",
"hookMethodsFromInterfaces",
")",
"{",
"ElementFilter",
".",
"methodsIn",
"(",
"component",
".",
"getEnclosedElements",
"(",
")",
")",
".",
"stream",
"(",
")",
".",
"filter",
"(",
"m... | Process hook methods from the Component Class.
@param hookMethodsFromInterfaces Hook methods from the interface the {@link IsVueComponent}
implements | [
"Process",
"hook",
"methods",
"from",
"the",
"Component",
"Class",
"."
] | 961cd83aed6fe8e2dd80c279847f1b3f62918a1f | https://github.com/VueGWT/vue-gwt/blob/961cd83aed6fe8e2dd80c279847f1b3f62918a1f/processors/src/main/java/com/axellience/vuegwt/processors/component/ComponentExposedTypeGenerator.java#L538-L551 |
58,965 | VueGWT/vue-gwt | processors/src/main/java/com/axellience/vuegwt/processors/component/ComponentExposedTypeGenerator.java | ComponentExposedTypeGenerator.getHookMethodsFromInterfaces | 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 Set<ExecutableElement> getHookMethodsFromInterfaces() {
return component
.getInterfaces()
.stream()
.map(DeclaredType.class::cast)
.map(DeclaredType::asElement)
.map(TypeElement.class::cast)
.flatMap(typeElement -> ElementFilter
.methodsIn(typeElem... | [
"private",
"Set",
"<",
"ExecutableElement",
">",
"getHookMethodsFromInterfaces",
"(",
")",
"{",
"return",
"component",
".",
"getInterfaces",
"(",
")",
".",
"stream",
"(",
")",
".",
"map",
"(",
"DeclaredType",
".",
"class",
"::",
"cast",
")",
".",
"map",
"(... | Return all hook methods from the implemented interfaces
@return Hook methods that must be overridden in the Component | [
"Return",
"all",
"hook",
"methods",
"from",
"the",
"implemented",
"interfaces"
] | 961cd83aed6fe8e2dd80c279847f1b3f62918a1f | https://github.com/VueGWT/vue-gwt/blob/961cd83aed6fe8e2dd80c279847f1b3f62918a1f/processors/src/main/java/com/axellience/vuegwt/processors/component/ComponentExposedTypeGenerator.java#L558-L571 |
58,966 | VueGWT/vue-gwt | processors/src/main/java/com/axellience/vuegwt/processors/component/ComponentExposedTypeGenerator.java | ComponentExposedTypeGenerator.processRenderFunction | 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 processRenderFunction() {
if (!hasInterface(processingEnv, component.asType(), HasRender.class)) {
return;
}
componentExposedTypeBuilder.addMethod(MethodSpec
.methodBuilder("vg$render")
.addModifiers(Modifier.PUBLIC)
.addAnnotation(JsMethod.class)
.returns... | [
"private",
"void",
"processRenderFunction",
"(",
")",
"{",
"if",
"(",
"!",
"hasInterface",
"(",
"processingEnv",
",",
"component",
".",
"asType",
"(",
")",
",",
"HasRender",
".",
"class",
")",
")",
"{",
"return",
";",
"}",
"componentExposedTypeBuilder",
".",... | Process the render function from the Component Class if it has one. | [
"Process",
"the",
"render",
"function",
"from",
"the",
"Component",
"Class",
"if",
"it",
"has",
"one",
"."
] | 961cd83aed6fe8e2dd80c279847f1b3f62918a1f | https://github.com/VueGWT/vue-gwt/blob/961cd83aed6fe8e2dd80c279847f1b3f62918a1f/processors/src/main/java/com/axellience/vuegwt/processors/component/ComponentExposedTypeGenerator.java#L584-L602 |
58,967 | VueGWT/vue-gwt | processors/src/main/java/com/axellience/vuegwt/processors/component/ComponentExposedTypeGenerator.java | ComponentExposedTypeGenerator.createCreatedHook | private void createCreatedHook(ComponentInjectedDependenciesBuilder dependenciesBuilder) {
String hasRunCreatedFlagName = "vg$hrc_" + getSuperComponentCount(component);
componentExposedTypeBuilder
.addField(
FieldSpec.builder(boolean.class, hasRunCreatedFlagName, Modifier.PUBLIC)
... | java | private void createCreatedHook(ComponentInjectedDependenciesBuilder dependenciesBuilder) {
String hasRunCreatedFlagName = "vg$hrc_" + getSuperComponentCount(component);
componentExposedTypeBuilder
.addField(
FieldSpec.builder(boolean.class, hasRunCreatedFlagName, Modifier.PUBLIC)
... | [
"private",
"void",
"createCreatedHook",
"(",
"ComponentInjectedDependenciesBuilder",
"dependenciesBuilder",
")",
"{",
"String",
"hasRunCreatedFlagName",
"=",
"\"vg$hrc_\"",
"+",
"getSuperComponentCount",
"(",
"component",
")",
";",
"componentExposedTypeBuilder",
".",
"addFiel... | Create the "created" hook method. This method will be called on each Component when it's
created. It will inject dependencies if any.
@param dependenciesBuilder Builder for our component dependencies, needed here to inject the
dependencies in the instance | [
"Create",
"the",
"created",
"hook",
"method",
".",
"This",
"method",
"will",
"be",
"called",
"on",
"each",
"Component",
"when",
"it",
"s",
"created",
".",
"It",
"will",
"inject",
"dependencies",
"if",
"any",
"."
] | 961cd83aed6fe8e2dd80c279847f1b3f62918a1f | https://github.com/VueGWT/vue-gwt/blob/961cd83aed6fe8e2dd80c279847f1b3f62918a1f/processors/src/main/java/com/axellience/vuegwt/processors/component/ComponentExposedTypeGenerator.java#L631-L667 |
58,968 | VueGWT/vue-gwt | processors/src/main/java/com/axellience/vuegwt/processors/component/ComponentExposedTypeGenerator.java | ComponentExposedTypeGenerator.initFieldsValues | 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 | 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... | [
"private",
"void",
"initFieldsValues",
"(",
"TypeElement",
"component",
",",
"MethodSpec",
".",
"Builder",
"createdMethodBuilder",
")",
"{",
"// Do not init instance fields for abstract components",
"if",
"(",
"component",
".",
"getModifiers",
"(",
")",
".",
"contains",
... | Init fields at creation by using an instance of the Java class
@param component {@link IsVueComponent} to process
@param createdMethodBuilder Builder for our Create method | [
"Init",
"fields",
"at",
"creation",
"by",
"using",
"an",
"instance",
"of",
"the",
"Java",
"class"
] | 961cd83aed6fe8e2dd80c279847f1b3f62918a1f | https://github.com/VueGWT/vue-gwt/blob/961cd83aed6fe8e2dd80c279847f1b3f62918a1f/processors/src/main/java/com/axellience/vuegwt/processors/component/ComponentExposedTypeGenerator.java#L736-L746 |
58,969 | VueGWT/vue-gwt | processors/src/main/java/com/axellience/vuegwt/processors/component/ComponentExposedTypeGenerator.java | ComponentExposedTypeGenerator.getSuperMethodCallParameters | private String getSuperMethodCallParameters(ExecutableElement sourceMethod) {
return sourceMethod
.getParameters()
.stream()
.map(parameter -> parameter.getSimpleName().toString())
.collect(Collectors.joining(", "));
} | java | private String getSuperMethodCallParameters(ExecutableElement sourceMethod) {
return sourceMethod
.getParameters()
.stream()
.map(parameter -> parameter.getSimpleName().toString())
.collect(Collectors.joining(", "));
} | [
"private",
"String",
"getSuperMethodCallParameters",
"(",
"ExecutableElement",
"sourceMethod",
")",
"{",
"return",
"sourceMethod",
".",
"getParameters",
"(",
")",
".",
"stream",
"(",
")",
".",
"map",
"(",
"parameter",
"->",
"parameter",
".",
"getSimpleName",
"(",
... | Return the list of parameters name to pass to the super call on proxy methods.
@param sourceMethod The source method
@return A string which is the list of parameters name joined by ", " | [
"Return",
"the",
"list",
"of",
"parameters",
"name",
"to",
"pass",
"to",
"the",
"super",
"call",
"on",
"proxy",
"methods",
"."
] | 961cd83aed6fe8e2dd80c279847f1b3f62918a1f | https://github.com/VueGWT/vue-gwt/blob/961cd83aed6fe8e2dd80c279847f1b3f62918a1f/processors/src/main/java/com/axellience/vuegwt/processors/component/ComponentExposedTypeGenerator.java#L854-L860 |
58,970 | VueGWT/vue-gwt | processors/src/main/java/com/axellience/vuegwt/processors/component/ComponentExposedTypeGenerator.java | ComponentExposedTypeGenerator.addEmitEventCall | private void addEmitEventCall(ExecutableElement originalMethod,
MethodSpec.Builder proxyMethodBuilder, String methodCallParameters) {
String methodName = "$emit";
if (methodCallParameters != null && !"".equals(methodCallParameters)) {
proxyMethodBuilder.addStatement("vue().$L($S, $L)",
met... | java | private void addEmitEventCall(ExecutableElement originalMethod,
MethodSpec.Builder proxyMethodBuilder, String methodCallParameters) {
String methodName = "$emit";
if (methodCallParameters != null && !"".equals(methodCallParameters)) {
proxyMethodBuilder.addStatement("vue().$L($S, $L)",
met... | [
"private",
"void",
"addEmitEventCall",
"(",
"ExecutableElement",
"originalMethod",
",",
"MethodSpec",
".",
"Builder",
"proxyMethodBuilder",
",",
"String",
"methodCallParameters",
")",
"{",
"String",
"methodName",
"=",
"\"$emit\"",
";",
"if",
"(",
"methodCallParameters",... | Add a call to emit an event at the end of the function
@param originalMethod Method we are emitting an event for
@param proxyMethodBuilder Method we are building
@param methodCallParameters Chained parameters name of the method | [
"Add",
"a",
"call",
"to",
"emit",
"an",
"event",
"at",
"the",
"end",
"of",
"the",
"function"
] | 961cd83aed6fe8e2dd80c279847f1b3f62918a1f | https://github.com/VueGWT/vue-gwt/blob/961cd83aed6fe8e2dd80c279847f1b3f62918a1f/processors/src/main/java/com/axellience/vuegwt/processors/component/ComponentExposedTypeGenerator.java#L869-L882 |
58,971 | VueGWT/vue-gwt | processors/src/main/java/com/axellience/vuegwt/processors/component/ComponentExposedTypeGenerator.java | ComponentExposedTypeGenerator.isHookMethod | private boolean isHookMethod(TypeElement component, ExecutableElement method,
Set<ExecutableElement> hookMethodsFromInterfaces) {
if (hasAnnotation(method, HookMethod.class)) {
validateHookMethod(method);
return true;
}
for (ExecutableElement hookMethodsFromInterface : hookMethodsFromInte... | java | private boolean isHookMethod(TypeElement component, ExecutableElement method,
Set<ExecutableElement> hookMethodsFromInterfaces) {
if (hasAnnotation(method, HookMethod.class)) {
validateHookMethod(method);
return true;
}
for (ExecutableElement hookMethodsFromInterface : hookMethodsFromInte... | [
"private",
"boolean",
"isHookMethod",
"(",
"TypeElement",
"component",
",",
"ExecutableElement",
"method",
",",
"Set",
"<",
"ExecutableElement",
">",
"hookMethodsFromInterfaces",
")",
"{",
"if",
"(",
"hasAnnotation",
"(",
"method",
",",
"HookMethod",
".",
"class",
... | Return true of the given method is a proxy method
@param component {@link IsVueComponent} this method belongs to
@param method The java method to check
@param hookMethodsFromInterfaces All the hook methods in the implement interfaces
@return True if this method is a hook method, false otherwise | [
"Return",
"true",
"of",
"the",
"given",
"method",
"is",
"a",
"proxy",
"method"
] | 961cd83aed6fe8e2dd80c279847f1b3f62918a1f | https://github.com/VueGWT/vue-gwt/blob/961cd83aed6fe8e2dd80c279847f1b3f62918a1f/processors/src/main/java/com/axellience/vuegwt/processors/component/ComponentExposedTypeGenerator.java#L892-L906 |
58,972 | VueGWT/vue-gwt | processors/src/main/java/com/axellience/vuegwt/processors/component/ComponentExposedTypeGenerator.java | ComponentExposedTypeGenerator.getNativeNameForJavaType | private String getNativeNameForJavaType(TypeMirror typeMirror) {
TypeName typeName = TypeName.get(typeMirror);
if (typeName.equals(TypeName.INT)
|| typeName.equals(TypeName.BYTE)
|| typeName.equals(TypeName.SHORT)
|| typeName.equals(TypeName.LONG)
|| typeName.equals(TypeName.FLO... | java | private String getNativeNameForJavaType(TypeMirror typeMirror) {
TypeName typeName = TypeName.get(typeMirror);
if (typeName.equals(TypeName.INT)
|| typeName.equals(TypeName.BYTE)
|| typeName.equals(TypeName.SHORT)
|| typeName.equals(TypeName.LONG)
|| typeName.equals(TypeName.FLO... | [
"private",
"String",
"getNativeNameForJavaType",
"(",
"TypeMirror",
"typeMirror",
")",
"{",
"TypeName",
"typeName",
"=",
"TypeName",
".",
"get",
"(",
"typeMirror",
")",
";",
"if",
"(",
"typeName",
".",
"equals",
"(",
"TypeName",
".",
"INT",
")",
"||",
"typeN... | Transform a Java type name into a JavaScript type name. Takes care of primitive types.
@param typeMirror A type to convert
@return A String representing the JavaScript type name | [
"Transform",
"a",
"Java",
"type",
"name",
"into",
"a",
"JavaScript",
"type",
"name",
".",
"Takes",
"care",
"of",
"primitive",
"types",
"."
] | 961cd83aed6fe8e2dd80c279847f1b3f62918a1f | https://github.com/VueGWT/vue-gwt/blob/961cd83aed6fe8e2dd80c279847f1b3f62918a1f/processors/src/main/java/com/axellience/vuegwt/processors/component/ComponentExposedTypeGenerator.java#L922-L941 |
58,973 | VueGWT/vue-gwt | processors/src/main/java/com/axellience/vuegwt/processors/component/ComponentInjectedDependenciesBuilder.java | ComponentInjectedDependenciesBuilder.processInjectedFields | private void processInjectedFields(TypeElement component) {
getInjectedFields(component).stream().peek(this::validateField).forEach(field -> {
String fieldName = field.getSimpleName().toString();
addInjectedVariable(field, fieldName);
injectedFieldsName.add(fieldName);
});
} | java | private void processInjectedFields(TypeElement component) {
getInjectedFields(component).stream().peek(this::validateField).forEach(field -> {
String fieldName = field.getSimpleName().toString();
addInjectedVariable(field, fieldName);
injectedFieldsName.add(fieldName);
});
} | [
"private",
"void",
"processInjectedFields",
"(",
"TypeElement",
"component",
")",
"{",
"getInjectedFields",
"(",
"component",
")",
".",
"stream",
"(",
")",
".",
"peek",
"(",
"this",
"::",
"validateField",
")",
".",
"forEach",
"(",
"field",
"->",
"{",
"String... | Process all the injected fields from our Component.
@param component The {@link IsVueComponent} we are processing | [
"Process",
"all",
"the",
"injected",
"fields",
"from",
"our",
"Component",
"."
] | 961cd83aed6fe8e2dd80c279847f1b3f62918a1f | https://github.com/VueGWT/vue-gwt/blob/961cd83aed6fe8e2dd80c279847f1b3f62918a1f/processors/src/main/java/com/axellience/vuegwt/processors/component/ComponentInjectedDependenciesBuilder.java#L88-L94 |
58,974 | VueGWT/vue-gwt | processors/src/main/java/com/axellience/vuegwt/processors/component/ComponentInjectedDependenciesBuilder.java | ComponentInjectedDependenciesBuilder.processInjectedMethods | private void processInjectedMethods(TypeElement component) {
getInjectedMethods(component)
.stream()
.peek(this::validateMethod)
.forEach(this::processInjectedMethod);
} | java | private void processInjectedMethods(TypeElement component) {
getInjectedMethods(component)
.stream()
.peek(this::validateMethod)
.forEach(this::processInjectedMethod);
} | [
"private",
"void",
"processInjectedMethods",
"(",
"TypeElement",
"component",
")",
"{",
"getInjectedMethods",
"(",
"component",
")",
".",
"stream",
"(",
")",
".",
"peek",
"(",
"this",
"::",
"validateMethod",
")",
".",
"forEach",
"(",
"this",
"::",
"processInje... | Process all the injected methods from our Component.
@param component The {@link IsVueComponent} we are processing | [
"Process",
"all",
"the",
"injected",
"methods",
"from",
"our",
"Component",
"."
] | 961cd83aed6fe8e2dd80c279847f1b3f62918a1f | https://github.com/VueGWT/vue-gwt/blob/961cd83aed6fe8e2dd80c279847f1b3f62918a1f/processors/src/main/java/com/axellience/vuegwt/processors/component/ComponentInjectedDependenciesBuilder.java#L101-L106 |
58,975 | VueGWT/vue-gwt | processors/src/main/java/com/axellience/vuegwt/processors/component/ComponentInjectedDependenciesBuilder.java | ComponentInjectedDependenciesBuilder.addInjectedVariable | private void addInjectedVariable(VariableElement element, String fieldName) {
TypeName typeName = resolveVariableTypeName(element, messager);
// Create field
FieldSpec.Builder fieldBuilder = FieldSpec.builder(typeName, fieldName, Modifier.PUBLIC);
// Copy field annotations
element
.getAnno... | java | private void addInjectedVariable(VariableElement element, String fieldName) {
TypeName typeName = resolveVariableTypeName(element, messager);
// Create field
FieldSpec.Builder fieldBuilder = FieldSpec.builder(typeName, fieldName, Modifier.PUBLIC);
// Copy field annotations
element
.getAnno... | [
"private",
"void",
"addInjectedVariable",
"(",
"VariableElement",
"element",
",",
"String",
"fieldName",
")",
"{",
"TypeName",
"typeName",
"=",
"resolveVariableTypeName",
"(",
"element",
",",
"messager",
")",
";",
"// Create field",
"FieldSpec",
".",
"Builder",
"fie... | Add an injected variable to our component
@param element The {@link VariableElement} that was injected
@param fieldName The name of the field | [
"Add",
"an",
"injected",
"variable",
"to",
"our",
"component"
] | 961cd83aed6fe8e2dd80c279847f1b3f62918a1f | https://github.com/VueGWT/vue-gwt/blob/961cd83aed6fe8e2dd80c279847f1b3f62918a1f/processors/src/main/java/com/axellience/vuegwt/processors/component/ComponentInjectedDependenciesBuilder.java#L176-L196 |
58,976 | VueGWT/vue-gwt | processors/src/main/java/com/axellience/vuegwt/processors/component/template/parser/context/TemplateParserContext.java | TemplateParserContext.addLocalVariable | public LocalVariableInfo addLocalVariable(String typeQualifiedName, String name) {
return contextLayers.getFirst().addLocalVariable(typeQualifiedName, name);
} | java | public LocalVariableInfo addLocalVariable(String typeQualifiedName, String name) {
return contextLayers.getFirst().addLocalVariable(typeQualifiedName, name);
} | [
"public",
"LocalVariableInfo",
"addLocalVariable",
"(",
"String",
"typeQualifiedName",
",",
"String",
"name",
")",
"{",
"return",
"contextLayers",
".",
"getFirst",
"(",
")",
".",
"addLocalVariable",
"(",
"typeQualifiedName",
",",
"name",
")",
";",
"}"
] | Add a local variable in the current context.
@param typeQualifiedName The type of the variable
@param name The name of the variable
@return {@link LocalVariableInfo} for the added variable | [
"Add",
"a",
"local",
"variable",
"in",
"the",
"current",
"context",
"."
] | 961cd83aed6fe8e2dd80c279847f1b3f62918a1f | https://github.com/VueGWT/vue-gwt/blob/961cd83aed6fe8e2dd80c279847f1b3f62918a1f/processors/src/main/java/com/axellience/vuegwt/processors/component/template/parser/context/TemplateParserContext.java#L117-L119 |
58,977 | VueGWT/vue-gwt | processors/src/main/java/com/axellience/vuegwt/processors/component/template/parser/context/TemplateParserContext.java | TemplateParserContext.addDestructuredProperty | public DestructuredPropertyInfo addDestructuredProperty(String propertyType,
String propertyName,
LocalVariableInfo destructuredVariable) {
return contextLayers.getFirst()
.addDestructuredProperty(propertyType, propertyName, destructuredVariable);
} | java | public DestructuredPropertyInfo addDestructuredProperty(String propertyType,
String propertyName,
LocalVariableInfo destructuredVariable) {
return contextLayers.getFirst()
.addDestructuredProperty(propertyType, propertyName, destructuredVariable);
} | [
"public",
"DestructuredPropertyInfo",
"addDestructuredProperty",
"(",
"String",
"propertyType",
",",
"String",
"propertyName",
",",
"LocalVariableInfo",
"destructuredVariable",
")",
"{",
"return",
"contextLayers",
".",
"getFirst",
"(",
")",
".",
"addDestructuredProperty",
... | Add a local variable coming from a Variable destructuring to the current context.
@param propertyType The type of the property on the destructured variable
@param propertyName The name of the property on the destructured variable
@param destructuredVariable The local variable that is getting destructured
@return {@lin... | [
"Add",
"a",
"local",
"variable",
"coming",
"from",
"a",
"Variable",
"destructuring",
"to",
"the",
"current",
"context",
"."
] | 961cd83aed6fe8e2dd80c279847f1b3f62918a1f | https://github.com/VueGWT/vue-gwt/blob/961cd83aed6fe8e2dd80c279847f1b3f62918a1f/processors/src/main/java/com/axellience/vuegwt/processors/component/template/parser/context/TemplateParserContext.java#L129-L134 |
58,978 | VueGWT/vue-gwt | processors/src/main/java/com/axellience/vuegwt/processors/component/template/parser/context/TemplateParserContext.java | TemplateParserContext.findVariable | public VariableInfo findVariable(String name) {
for (ContextLayer contextLayer : contextLayers) {
VariableInfo variableInfo = contextLayer.getVariableInfo(name);
if (variableInfo != null) {
return variableInfo;
}
}
return null;
} | java | public VariableInfo findVariable(String name) {
for (ContextLayer contextLayer : contextLayers) {
VariableInfo variableInfo = contextLayer.getVariableInfo(name);
if (variableInfo != null) {
return variableInfo;
}
}
return null;
} | [
"public",
"VariableInfo",
"findVariable",
"(",
"String",
"name",
")",
"{",
"for",
"(",
"ContextLayer",
"contextLayer",
":",
"contextLayers",
")",
"{",
"VariableInfo",
"variableInfo",
"=",
"contextLayer",
".",
"getVariableInfo",
"(",
"name",
")",
";",
"if",
"(",
... | Find a variable in the context stack.
@param name Name of the variable to get
@return Information about the variable | [
"Find",
"a",
"variable",
"in",
"the",
"context",
"stack",
"."
] | 961cd83aed6fe8e2dd80c279847f1b3f62918a1f | https://github.com/VueGWT/vue-gwt/blob/961cd83aed6fe8e2dd80c279847f1b3f62918a1f/processors/src/main/java/com/axellience/vuegwt/processors/component/template/parser/context/TemplateParserContext.java#L152-L161 |
58,979 | VueGWT/vue-gwt | processors/src/main/java/com/axellience/vuegwt/processors/component/template/parser/context/TemplateParserContext.java | TemplateParserContext.addImport | public void addImport(String fullyQualifiedName) {
String[] importSplit = fullyQualifiedName.split("\\.");
String className = importSplit[importSplit.length - 1];
classNameToFullyQualifiedName.put(className, fullyQualifiedName);
} | java | public void addImport(String fullyQualifiedName) {
String[] importSplit = fullyQualifiedName.split("\\.");
String className = importSplit[importSplit.length - 1];
classNameToFullyQualifiedName.put(className, fullyQualifiedName);
} | [
"public",
"void",
"addImport",
"(",
"String",
"fullyQualifiedName",
")",
"{",
"String",
"[",
"]",
"importSplit",
"=",
"fullyQualifiedName",
".",
"split",
"(",
"\"\\\\.\"",
")",
";",
"String",
"className",
"=",
"importSplit",
"[",
"importSplit",
".",
"length",
... | Add a Java Import to the context.
@param fullyQualifiedName The fully qualified name of the class to import | [
"Add",
"a",
"Java",
"Import",
"to",
"the",
"context",
"."
] | 961cd83aed6fe8e2dd80c279847f1b3f62918a1f | https://github.com/VueGWT/vue-gwt/blob/961cd83aed6fe8e2dd80c279847f1b3f62918a1f/processors/src/main/java/com/axellience/vuegwt/processors/component/template/parser/context/TemplateParserContext.java#L193-L198 |
58,980 | VueGWT/vue-gwt | processors/src/main/java/com/axellience/vuegwt/processors/component/template/parser/context/TemplateParserContext.java | TemplateParserContext.getFullyQualifiedNameForClassName | public String getFullyQualifiedNameForClassName(String className) {
if (!classNameToFullyQualifiedName.containsKey(className)) {
return className;
}
return classNameToFullyQualifiedName.get(className);
} | java | public String getFullyQualifiedNameForClassName(String className) {
if (!classNameToFullyQualifiedName.containsKey(className)) {
return className;
}
return classNameToFullyQualifiedName.get(className);
} | [
"public",
"String",
"getFullyQualifiedNameForClassName",
"(",
"String",
"className",
")",
"{",
"if",
"(",
"!",
"classNameToFullyQualifiedName",
".",
"containsKey",
"(",
"className",
")",
")",
"{",
"return",
"className",
";",
"}",
"return",
"classNameToFullyQualifiedNa... | Return the fully qualified name for a given class. Only works if the class has been imported.
@param className The name of the class to get the fully qualified name of
@return The fully qualified name, or the className if it's unknown | [
"Return",
"the",
"fully",
"qualified",
"name",
"for",
"a",
"given",
"class",
".",
"Only",
"works",
"if",
"the",
"class",
"has",
"been",
"imported",
"."
] | 961cd83aed6fe8e2dd80c279847f1b3f62918a1f | https://github.com/VueGWT/vue-gwt/blob/961cd83aed6fe8e2dd80c279847f1b3f62918a1f/processors/src/main/java/com/axellience/vuegwt/processors/component/template/parser/context/TemplateParserContext.java#L206-L212 |
58,981 | VueGWT/vue-gwt | processors/src/main/java/com/axellience/vuegwt/processors/component/template/parser/context/TemplateParserContext.java | TemplateParserContext.addStaticImport | public void addStaticImport(String fullyQualifiedName) {
String[] importSplit = fullyQualifiedName.split("\\.");
String symbolName = importSplit[importSplit.length - 1];
methodNameToFullyQualifiedName.put(symbolName, fullyQualifiedName);
propertyNameToFullyQualifiedName.put(symbolName, fullyQualifiedNa... | java | public void addStaticImport(String fullyQualifiedName) {
String[] importSplit = fullyQualifiedName.split("\\.");
String symbolName = importSplit[importSplit.length - 1];
methodNameToFullyQualifiedName.put(symbolName, fullyQualifiedName);
propertyNameToFullyQualifiedName.put(symbolName, fullyQualifiedNa... | [
"public",
"void",
"addStaticImport",
"(",
"String",
"fullyQualifiedName",
")",
"{",
"String",
"[",
"]",
"importSplit",
"=",
"fullyQualifiedName",
".",
"split",
"(",
"\"\\\\.\"",
")",
";",
"String",
"symbolName",
"=",
"importSplit",
"[",
"importSplit",
".",
"leng... | Add a Java Static Import to the context.
@param fullyQualifiedName The fully qualified name of the method to import | [
"Add",
"a",
"Java",
"Static",
"Import",
"to",
"the",
"context",
"."
] | 961cd83aed6fe8e2dd80c279847f1b3f62918a1f | https://github.com/VueGWT/vue-gwt/blob/961cd83aed6fe8e2dd80c279847f1b3f62918a1f/processors/src/main/java/com/axellience/vuegwt/processors/component/template/parser/context/TemplateParserContext.java#L229-L235 |
58,982 | VueGWT/vue-gwt | processors/src/main/java/com/axellience/vuegwt/processors/component/template/parser/context/TemplateParserContext.java | TemplateParserContext.getFullyQualifiedNameForMethodName | public String getFullyQualifiedNameForMethodName(String methodName) {
if (!methodNameToFullyQualifiedName.containsKey(methodName)) {
return methodName;
}
return methodNameToFullyQualifiedName.get(methodName);
} | java | public String getFullyQualifiedNameForMethodName(String methodName) {
if (!methodNameToFullyQualifiedName.containsKey(methodName)) {
return methodName;
}
return methodNameToFullyQualifiedName.get(methodName);
} | [
"public",
"String",
"getFullyQualifiedNameForMethodName",
"(",
"String",
"methodName",
")",
"{",
"if",
"(",
"!",
"methodNameToFullyQualifiedName",
".",
"containsKey",
"(",
"methodName",
")",
")",
"{",
"return",
"methodName",
";",
"}",
"return",
"methodNameToFullyQuali... | Return the fully qualified name for a given method. Only works if the method has been
statically imported.
@param methodName The name of the method to get the fully qualified name of
@return The fully qualified name, or the method name if it's unknown | [
"Return",
"the",
"fully",
"qualified",
"name",
"for",
"a",
"given",
"method",
".",
"Only",
"works",
"if",
"the",
"method",
"has",
"been",
"statically",
"imported",
"."
] | 961cd83aed6fe8e2dd80c279847f1b3f62918a1f | https://github.com/VueGWT/vue-gwt/blob/961cd83aed6fe8e2dd80c279847f1b3f62918a1f/processors/src/main/java/com/axellience/vuegwt/processors/component/template/parser/context/TemplateParserContext.java#L244-L250 |
58,983 | VueGWT/vue-gwt | processors/src/main/java/com/axellience/vuegwt/processors/component/template/parser/context/TemplateParserContext.java | TemplateParserContext.getFullyQualifiedNameForPropertyName | public String getFullyQualifiedNameForPropertyName(String propertyName) {
if (!propertyNameToFullyQualifiedName.containsKey(propertyName)) {
return propertyName;
}
return propertyNameToFullyQualifiedName.get(propertyName);
} | java | public String getFullyQualifiedNameForPropertyName(String propertyName) {
if (!propertyNameToFullyQualifiedName.containsKey(propertyName)) {
return propertyName;
}
return propertyNameToFullyQualifiedName.get(propertyName);
} | [
"public",
"String",
"getFullyQualifiedNameForPropertyName",
"(",
"String",
"propertyName",
")",
"{",
"if",
"(",
"!",
"propertyNameToFullyQualifiedName",
".",
"containsKey",
"(",
"propertyName",
")",
")",
"{",
"return",
"propertyName",
";",
"}",
"return",
"propertyName... | Return the fully qualified name for a given property. Only works if the property has been
statically imported.
@param propertyName The name of the property to get the fully qualified name of
@return The fully qualified name, or the property name if it's unknown | [
"Return",
"the",
"fully",
"qualified",
"name",
"for",
"a",
"given",
"property",
".",
"Only",
"works",
"if",
"the",
"property",
"has",
"been",
"statically",
"imported",
"."
] | 961cd83aed6fe8e2dd80c279847f1b3f62918a1f | https://github.com/VueGWT/vue-gwt/blob/961cd83aed6fe8e2dd80c279847f1b3f62918a1f/processors/src/main/java/com/axellience/vuegwt/processors/component/template/parser/context/TemplateParserContext.java#L259-L265 |
58,984 | VueGWT/vue-gwt | processors/src/main/java/com/axellience/vuegwt/processors/component/template/parser/context/TemplateParserContext.java | TemplateParserContext.getCurrentLine | public Optional<Integer> getCurrentLine() {
if (currentSegment == null) {
return Optional.empty();
}
return Optional.of(currentSegment.getSource().getRow(currentSegment.getBegin()));
} | java | public Optional<Integer> getCurrentLine() {
if (currentSegment == null) {
return Optional.empty();
}
return Optional.of(currentSegment.getSource().getRow(currentSegment.getBegin()));
} | [
"public",
"Optional",
"<",
"Integer",
">",
"getCurrentLine",
"(",
")",
"{",
"if",
"(",
"currentSegment",
"==",
"null",
")",
"{",
"return",
"Optional",
".",
"empty",
"(",
")",
";",
"}",
"return",
"Optional",
".",
"of",
"(",
"currentSegment",
".",
"getSour... | Return the number of the line currently processed in the HTML
@return The number of the current line being processed or empty | [
"Return",
"the",
"number",
"of",
"the",
"line",
"currently",
"processed",
"in",
"the",
"HTML"
] | 961cd83aed6fe8e2dd80c279847f1b3f62918a1f | https://github.com/VueGWT/vue-gwt/blob/961cd83aed6fe8e2dd80c279847f1b3f62918a1f/processors/src/main/java/com/axellience/vuegwt/processors/component/template/parser/context/TemplateParserContext.java#L307-L313 |
58,985 | VueGWT/vue-gwt | core/src/main/java/com/axellience/vuegwt/core/client/VueGWT.java | VueGWT.initWithoutVueLib | @JsIgnore
public static void initWithoutVueLib() {
if (!isVueLibInjected()) {
throw new RuntimeException(
"Couldn't find Vue.js on init. Either include it Vue.js in your index.html or call VueGWT.init() instead of initWithoutVueLib.");
}
// Register custom observers for Collection and Map... | java | @JsIgnore
public static void initWithoutVueLib() {
if (!isVueLibInjected()) {
throw new RuntimeException(
"Couldn't find Vue.js on init. Either include it Vue.js in your index.html or call VueGWT.init() instead of initWithoutVueLib.");
}
// Register custom observers for Collection and Map... | [
"@",
"JsIgnore",
"public",
"static",
"void",
"initWithoutVueLib",
"(",
")",
"{",
"if",
"(",
"!",
"isVueLibInjected",
"(",
")",
")",
"{",
"throw",
"new",
"RuntimeException",
"(",
"\"Couldn't find Vue.js on init. Either include it Vue.js in your index.html or call VueGWT.init... | Inject scripts necessary for Vue GWT to work Requires Vue to be defined in Window. | [
"Inject",
"scripts",
"necessary",
"for",
"Vue",
"GWT",
"to",
"work",
"Requires",
"Vue",
"to",
"be",
"defined",
"in",
"Window",
"."
] | 961cd83aed6fe8e2dd80c279847f1b3f62918a1f | https://github.com/VueGWT/vue-gwt/blob/961cd83aed6fe8e2dd80c279847f1b3f62918a1f/core/src/main/java/com/axellience/vuegwt/core/client/VueGWT.java#L45-L63 |
58,986 | VueGWT/vue-gwt | core/src/main/java/com/axellience/vuegwt/core/client/VueGWT.java | VueGWT.onReady | @JsIgnore
public static void onReady(Runnable callback) {
if (isReady) {
callback.run();
return;
}
onReadyCallbacks.push(callback);
} | java | @JsIgnore
public static void onReady(Runnable callback) {
if (isReady) {
callback.run();
return;
}
onReadyCallbacks.push(callback);
} | [
"@",
"JsIgnore",
"public",
"static",
"void",
"onReady",
"(",
"Runnable",
"callback",
")",
"{",
"if",
"(",
"isReady",
")",
"{",
"callback",
".",
"run",
"(",
")",
";",
"return",
";",
"}",
"onReadyCallbacks",
".",
"push",
"(",
"callback",
")",
";",
"}"
] | Ask to be warned when Vue GWT is ready. If Vue GWT is ready, the callback is called
immediately.
@param callback The callback to call when Vue GWT is ready. | [
"Ask",
"to",
"be",
"warned",
"when",
"Vue",
"GWT",
"is",
"ready",
".",
"If",
"Vue",
"GWT",
"is",
"ready",
"the",
"callback",
"is",
"called",
"immediately",
"."
] | 961cd83aed6fe8e2dd80c279847f1b3f62918a1f | https://github.com/VueGWT/vue-gwt/blob/961cd83aed6fe8e2dd80c279847f1b3f62918a1f/core/src/main/java/com/axellience/vuegwt/core/client/VueGWT.java#L71-L79 |
58,987 | contentful/contentful.java | src/main/java/com/contentful/java/cda/rich/RichTextFactory.java | RichTextFactory.resolveRichTextField | public static void resolveRichTextField(ArrayResource array, CDAClient client) {
for (CDAEntry entry : array.entries().values()) {
ensureContentType(entry, client);
for (CDAField field : entry.contentType().fields()) {
if ("RichText".equals(field.type())) {
resolveRichDocument(entry, f... | java | public static void resolveRichTextField(ArrayResource array, CDAClient client) {
for (CDAEntry entry : array.entries().values()) {
ensureContentType(entry, client);
for (CDAField field : entry.contentType().fields()) {
if ("RichText".equals(field.type())) {
resolveRichDocument(entry, f... | [
"public",
"static",
"void",
"resolveRichTextField",
"(",
"ArrayResource",
"array",
",",
"CDAClient",
"client",
")",
"{",
"for",
"(",
"CDAEntry",
"entry",
":",
"array",
".",
"entries",
"(",
")",
".",
"values",
"(",
")",
")",
"{",
"ensureContentType",
"(",
"... | Walk through the given array and resolve all rich text fields.
@param array the array to be walked.
@param client the client to be used if updating of types is needed. | [
"Walk",
"through",
"the",
"given",
"array",
"and",
"resolve",
"all",
"rich",
"text",
"fields",
"."
] | 6ecc2ace454c674b218b99489dc50697b1dbffcb | https://github.com/contentful/contentful.java/blob/6ecc2ace454c674b218b99489dc50697b1dbffcb/src/main/java/com/contentful/java/cda/rich/RichTextFactory.java#L267-L277 |
58,988 | contentful/contentful.java | src/main/java/com/contentful/java/cda/rich/RichTextFactory.java | RichTextFactory.resolveRichDocument | private static void resolveRichDocument(CDAEntry entry, CDAField field) {
final Map<String, Object> rawValue = (Map<String, Object>) entry.rawFields().get(field.id());
if (rawValue == null) {
return;
}
for (final String locale : rawValue.keySet()) {
final Object raw = rawValue.get(locale);
... | java | private static void resolveRichDocument(CDAEntry entry, CDAField field) {
final Map<String, Object> rawValue = (Map<String, Object>) entry.rawFields().get(field.id());
if (rawValue == null) {
return;
}
for (final String locale : rawValue.keySet()) {
final Object raw = rawValue.get(locale);
... | [
"private",
"static",
"void",
"resolveRichDocument",
"(",
"CDAEntry",
"entry",
",",
"CDAField",
"field",
")",
"{",
"final",
"Map",
"<",
"String",
",",
"Object",
">",
"rawValue",
"=",
"(",
"Map",
"<",
"String",
",",
"Object",
">",
")",
"entry",
".",
"rawFi... | Resolve all children of the top most document block.
@param entry the entry to contain the field to be walked
@param field the id of the field to be walked. | [
"Resolve",
"all",
"children",
"of",
"the",
"top",
"most",
"document",
"block",
"."
] | 6ecc2ace454c674b218b99489dc50697b1dbffcb | https://github.com/contentful/contentful.java/blob/6ecc2ace454c674b218b99489dc50697b1dbffcb/src/main/java/com/contentful/java/cda/rich/RichTextFactory.java#L285-L301 |
58,989 | contentful/contentful.java | src/main/java/com/contentful/java/cda/rich/RichTextFactory.java | RichTextFactory.resolveRichLink | private static void resolveRichLink(ArrayResource array, CDAEntry entry, CDAField field) {
final Map<String, Object> rawValue = (Map<String, Object>) entry.rawFields().get(field.id());
if (rawValue == null) {
return;
}
for (final String locale : rawValue.keySet()) {
final CDARichDocument do... | java | private static void resolveRichLink(ArrayResource array, CDAEntry entry, CDAField field) {
final Map<String, Object> rawValue = (Map<String, Object>) entry.rawFields().get(field.id());
if (rawValue == null) {
return;
}
for (final String locale : rawValue.keySet()) {
final CDARichDocument do... | [
"private",
"static",
"void",
"resolveRichLink",
"(",
"ArrayResource",
"array",
",",
"CDAEntry",
"entry",
",",
"CDAField",
"field",
")",
"{",
"final",
"Map",
"<",
"String",
",",
"Object",
">",
"rawValue",
"=",
"(",
"Map",
"<",
"String",
",",
"Object",
">",
... | Resolve all links if possible. If linked to entry is not found, null it's field.
@param array the array containing the complete response
@param entry the entry to be completed.
@param field the field pointing to a link. | [
"Resolve",
"all",
"links",
"if",
"possible",
".",
"If",
"linked",
"to",
"entry",
"is",
"not",
"found",
"null",
"it",
"s",
"field",
"."
] | 6ecc2ace454c674b218b99489dc50697b1dbffcb | https://github.com/contentful/contentful.java/blob/6ecc2ace454c674b218b99489dc50697b1dbffcb/src/main/java/com/contentful/java/cda/rich/RichTextFactory.java#L350-L362 |
58,990 | contentful/contentful.java | src/main/java/com/contentful/java/cda/rich/RichTextFactory.java | RichTextFactory.resolveOneLink | private static void resolveOneLink(ArrayResource array, CDAField field, String locale,
CDARichNode node) {
if (node instanceof CDARichHyperLink
&& ((CDARichHyperLink) node).data instanceof Map) {
final CDARichHyperLink link = (CDARichHyperLink) node;
final Ma... | java | private static void resolveOneLink(ArrayResource array, CDAField field, String locale,
CDARichNode node) {
if (node instanceof CDARichHyperLink
&& ((CDARichHyperLink) node).data instanceof Map) {
final CDARichHyperLink link = (CDARichHyperLink) node;
final Ma... | [
"private",
"static",
"void",
"resolveOneLink",
"(",
"ArrayResource",
"array",
",",
"CDAField",
"field",
",",
"String",
"locale",
",",
"CDARichNode",
"node",
")",
"{",
"if",
"(",
"node",
"instanceof",
"CDARichHyperLink",
"&&",
"(",
"(",
"CDARichHyperLink",
")",
... | Link found, resolve it.
@param array the complete response from Contentful.
@param field the field containing a link.
@param locale the locale of the link to be updated.
@param node the node build from the response. | [
"Link",
"found",
"resolve",
"it",
"."
] | 6ecc2ace454c674b218b99489dc50697b1dbffcb | https://github.com/contentful/contentful.java/blob/6ecc2ace454c674b218b99489dc50697b1dbffcb/src/main/java/com/contentful/java/cda/rich/RichTextFactory.java#L372-L406 |
58,991 | contentful/contentful.java | src/main/java/com/contentful/java/cda/rich/RichTextFactory.java | RichTextFactory.isLink | private static boolean isLink(Object data) {
try {
final Map<String, Object> map = (Map<String, Object>) data;
final Map<String, Object> sys = (Map<String, Object>) map.get("sys");
final String type = (String) sys.get("type");
final String linkType = (String) sys.get("linkType");
final... | java | private static boolean isLink(Object data) {
try {
final Map<String, Object> map = (Map<String, Object>) data;
final Map<String, Object> sys = (Map<String, Object>) map.get("sys");
final String type = (String) sys.get("type");
final String linkType = (String) sys.get("linkType");
final... | [
"private",
"static",
"boolean",
"isLink",
"(",
"Object",
"data",
")",
"{",
"try",
"{",
"final",
"Map",
"<",
"String",
",",
"Object",
">",
"map",
"=",
"(",
"Map",
"<",
"String",
",",
"Object",
">",
")",
"data",
";",
"final",
"Map",
"<",
"String",
",... | Is the give object a link of any kind? | [
"Is",
"the",
"give",
"object",
"a",
"link",
"of",
"any",
"kind?"
] | 6ecc2ace454c674b218b99489dc50697b1dbffcb | https://github.com/contentful/contentful.java/blob/6ecc2ace454c674b218b99489dc50697b1dbffcb/src/main/java/com/contentful/java/cda/rich/RichTextFactory.java#L411-L428 |
58,992 | contentful/contentful.java | src/main/java/com/contentful/java/cda/LocalizedResource.java | LocalizedResource.getField | public <T> T getField(String locale, String key) {
return localize(locale).getField(key);
} | java | public <T> T getField(String locale, String key) {
return localize(locale).getField(key);
} | [
"public",
"<",
"T",
">",
"T",
"getField",
"(",
"String",
"locale",
",",
"String",
"key",
")",
"{",
"return",
"localize",
"(",
"locale",
")",
".",
"getField",
"(",
"key",
")",
";",
"}"
] | Extracts a field from the fields set of the active locale, result type is inferred.
@param locale locale to be used.
@param key field key.
@param <T> type.
@return field value, null if it doesn't exist. | [
"Extracts",
"a",
"field",
"from",
"the",
"fields",
"set",
"of",
"the",
"active",
"locale",
"result",
"type",
"is",
"inferred",
"."
] | 6ecc2ace454c674b218b99489dc50697b1dbffcb | https://github.com/contentful/contentful.java/blob/6ecc2ace454c674b218b99489dc50697b1dbffcb/src/main/java/com/contentful/java/cda/LocalizedResource.java#L87-L89 |
58,993 | contentful/contentful.java | src/main/java/com/contentful/java/cda/TransformQuery.java | TransformQuery.one | public Flowable<Transformed> one(String id) {
try {
return baseQuery()
.one(id)
.filter(new Predicate<CDAEntry>() {
@Override
public boolean test(CDAEntry entry) {
return entry.contentType().id()
.equals(contentTypeId);
}
... | java | public Flowable<Transformed> one(String id) {
try {
return baseQuery()
.one(id)
.filter(new Predicate<CDAEntry>() {
@Override
public boolean test(CDAEntry entry) {
return entry.contentType().id()
.equals(contentTypeId);
}
... | [
"public",
"Flowable",
"<",
"Transformed",
">",
"one",
"(",
"String",
"id",
")",
"{",
"try",
"{",
"return",
"baseQuery",
"(",
")",
".",
"one",
"(",
"id",
")",
".",
"filter",
"(",
"new",
"Predicate",
"<",
"CDAEntry",
">",
"(",
")",
"{",
"@",
"Overrid... | Retrieve the transformed entry from Contentful.
@param id the id of the entry of type Transformed.
@return the Transformed entry.
@throws CDAResourceNotFoundException if no such resource was found.
@throws IllegalStateException if the transformed class could not be created.
@throws IllegalStateException ... | [
"Retrieve",
"the",
"transformed",
"entry",
"from",
"Contentful",
"."
] | 6ecc2ace454c674b218b99489dc50697b1dbffcb | https://github.com/contentful/contentful.java/blob/6ecc2ace454c674b218b99489dc50697b1dbffcb/src/main/java/com/contentful/java/cda/TransformQuery.java#L148-L168 |
58,994 | contentful/contentful.java | src/main/java/com/contentful/java/cda/TransformQuery.java | TransformQuery.one | public CDACallback<Transformed> one(String id, CDACallback<Transformed> callback) {
return Callbacks.subscribeAsync(
baseQuery()
.one(id)
.filter(new Predicate<CDAEntry>() {
@Override
public boolean test(CDAEntry entry) {
return entry.conte... | java | public CDACallback<Transformed> one(String id, CDACallback<Transformed> callback) {
return Callbacks.subscribeAsync(
baseQuery()
.one(id)
.filter(new Predicate<CDAEntry>() {
@Override
public boolean test(CDAEntry entry) {
return entry.conte... | [
"public",
"CDACallback",
"<",
"Transformed",
">",
"one",
"(",
"String",
"id",
",",
"CDACallback",
"<",
"Transformed",
">",
"callback",
")",
"{",
"return",
"Callbacks",
".",
"subscribeAsync",
"(",
"baseQuery",
"(",
")",
".",
"one",
"(",
"id",
")",
".",
"f... | Retrieve the transformed entry from Contentful by using the given callback.
@param id the id of the entry of type transformed.
@return the input callback for chaining.
@throws CDAResourceNotFoundException if no such resource was found.
@throws IllegalStateException if the transformed class could not be created.... | [
"Retrieve",
"the",
"transformed",
"entry",
"from",
"Contentful",
"by",
"using",
"the",
"given",
"callback",
"."
] | 6ecc2ace454c674b218b99489dc50697b1dbffcb | https://github.com/contentful/contentful.java/blob/6ecc2ace454c674b218b99489dc50697b1dbffcb/src/main/java/com/contentful/java/cda/TransformQuery.java#L179-L192 |
58,995 | contentful/contentful.java | src/main/java/com/contentful/java/cda/TransformQuery.java | TransformQuery.all | public Flowable<Collection<Transformed>> all() {
return baseQuery()
.all()
.map(
new Function<CDAArray, Collection<Transformed>>() {
@Override
public Collection<Transformed> apply(CDAArray array) {
final ArrayList<Transformed> result = new Arra... | java | public Flowable<Collection<Transformed>> all() {
return baseQuery()
.all()
.map(
new Function<CDAArray, Collection<Transformed>>() {
@Override
public Collection<Transformed> apply(CDAArray array) {
final ArrayList<Transformed> result = new Arra... | [
"public",
"Flowable",
"<",
"Collection",
"<",
"Transformed",
">",
">",
"all",
"(",
")",
"{",
"return",
"baseQuery",
"(",
")",
".",
"all",
"(",
")",
".",
"map",
"(",
"new",
"Function",
"<",
"CDAArray",
",",
"Collection",
"<",
"Transformed",
">",
">",
... | Retrieve all transformed entries from Contentful.
@return a collection of transformed entry.
@throws CDAResourceNotFoundException if no such resource was found.
@throws IllegalStateException if the transformed class could not be created.
@throws IllegalStateException if the transformed class could not be... | [
"Retrieve",
"all",
"transformed",
"entries",
"from",
"Contentful",
"."
] | 6ecc2ace454c674b218b99489dc50697b1dbffcb | https://github.com/contentful/contentful.java/blob/6ecc2ace454c674b218b99489dc50697b1dbffcb/src/main/java/com/contentful/java/cda/TransformQuery.java#L202-L221 |
58,996 | contentful/contentful.java | src/main/java/com/contentful/java/cda/TransformQuery.java | TransformQuery.all | public CDACallback<Collection<Transformed>> all(CDACallback<Collection<Transformed>> callback) {
return Callbacks.subscribeAsync(
baseQuery()
.all()
.map(
new Function<CDAArray, List<Transformed>>() {
@Override
public List<Transform... | java | public CDACallback<Collection<Transformed>> all(CDACallback<Collection<Transformed>> callback) {
return Callbacks.subscribeAsync(
baseQuery()
.all()
.map(
new Function<CDAArray, List<Transformed>>() {
@Override
public List<Transform... | [
"public",
"CDACallback",
"<",
"Collection",
"<",
"Transformed",
">",
">",
"all",
"(",
"CDACallback",
"<",
"Collection",
"<",
"Transformed",
">",
">",
"callback",
")",
"{",
"return",
"Callbacks",
".",
"subscribeAsync",
"(",
"baseQuery",
"(",
")",
".",
"all",
... | Retrieve all transformed entries from Contentful by the use of a callback.
@return a callback containing a collection of transformed entries.
@throws CDAResourceNotFoundException if no such resource was found.
@throws IllegalStateException if the transformed class could not be created.
@throws IllegalStateExcep... | [
"Retrieve",
"all",
"transformed",
"entries",
"from",
"Contentful",
"by",
"the",
"use",
"of",
"a",
"callback",
"."
] | 6ecc2ace454c674b218b99489dc50697b1dbffcb | https://github.com/contentful/contentful.java/blob/6ecc2ace454c674b218b99489dc50697b1dbffcb/src/main/java/com/contentful/java/cda/TransformQuery.java#L231-L253 |
58,997 | contentful/contentful.java | src/main/java/com/contentful/java/cda/CDAResource.java | CDAResource.getAttribute | @SuppressWarnings("unchecked")
public <T> T getAttribute(String key) {
return (T) attrs.get(key);
} | java | @SuppressWarnings("unchecked")
public <T> T getAttribute(String key) {
return (T) attrs.get(key);
} | [
"@",
"SuppressWarnings",
"(",
"\"unchecked\"",
")",
"public",
"<",
"T",
">",
"T",
"getAttribute",
"(",
"String",
"key",
")",
"{",
"return",
"(",
"T",
")",
"attrs",
".",
"get",
"(",
"key",
")",
";",
"}"
] | Retrieve a specific attribute of this resource.
@param key a string key associated with the value to be retrieved.
@param <T> the type of the attribute to be retrieved.
@return the actual value of the attribute, or null, if there the key was not found. | [
"Retrieve",
"a",
"specific",
"attribute",
"of",
"this",
"resource",
"."
] | 6ecc2ace454c674b218b99489dc50697b1dbffcb | https://github.com/contentful/contentful.java/blob/6ecc2ace454c674b218b99489dc50697b1dbffcb/src/main/java/com/contentful/java/cda/CDAResource.java#L48-L51 |
58,998 | contentful/contentful.java | src/main/java/com/contentful/java/cda/ObserveQuery.java | ObserveQuery.all | public Flowable<CDAArray> all() {
return client.cacheAll(false)
.flatMap(
new Function<Cache, Publisher<Response<CDAArray>>>() {
@Override
public Publisher<Response<CDAArray>> apply(Cache cache) {
return client.service.array(client.spaceId, client.envi... | java | public Flowable<CDAArray> all() {
return client.cacheAll(false)
.flatMap(
new Function<Cache, Publisher<Response<CDAArray>>>() {
@Override
public Publisher<Response<CDAArray>> apply(Cache cache) {
return client.service.array(client.spaceId, client.envi... | [
"public",
"Flowable",
"<",
"CDAArray",
">",
"all",
"(",
")",
"{",
"return",
"client",
".",
"cacheAll",
"(",
"false",
")",
".",
"flatMap",
"(",
"new",
"Function",
"<",
"Cache",
",",
"Publisher",
"<",
"Response",
"<",
"CDAArray",
">",
">",
">",
"(",
")... | Observe an array of all resources matching the type of this query.
@return {@link Flowable} instance. | [
"Observe",
"an",
"array",
"of",
"all",
"resources",
"matching",
"the",
"type",
"of",
"this",
"query",
"."
] | 6ecc2ace454c674b218b99489dc50697b1dbffcb | https://github.com/contentful/contentful.java/blob/6ecc2ace454c674b218b99489dc50697b1dbffcb/src/main/java/com/contentful/java/cda/ObserveQuery.java#L93-L108 |
58,999 | contentful/contentful.java | src/main/java/com/contentful/java/cda/image/ImageOption.java | ImageOption.jpegQualityOf | public static ImageOption jpegQualityOf(int quality) {
if (quality < 1 || quality > 100) {
throw new IllegalArgumentException("Quality has to be in the range from 1 to 100.");
}
return new ImageOption("q", Integer.toString(quality));
} | java | public static ImageOption jpegQualityOf(int quality) {
if (quality < 1 || quality > 100) {
throw new IllegalArgumentException("Quality has to be in the range from 1 to 100.");
}
return new ImageOption("q", Integer.toString(quality));
} | [
"public",
"static",
"ImageOption",
"jpegQualityOf",
"(",
"int",
"quality",
")",
"{",
"if",
"(",
"quality",
"<",
"1",
"||",
"quality",
">",
"100",
")",
"{",
"throw",
"new",
"IllegalArgumentException",
"(",
"\"Quality has to be in the range from 1 to 100.\"",
")",
"... | Define the quality of the jpg image to be returned.
@param quality an positive integer between 1 and 100.
@return an image option for updating the url.
@throws IllegalArgumentException if quality is not between 1 and 100. | [
"Define",
"the",
"quality",
"of",
"the",
"jpg",
"image",
"to",
"be",
"returned",
"."
] | 6ecc2ace454c674b218b99489dc50697b1dbffcb | https://github.com/contentful/contentful.java/blob/6ecc2ace454c674b218b99489dc50697b1dbffcb/src/main/java/com/contentful/java/cda/image/ImageOption.java#L161-L167 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.