1+ /*
2+ * Copyright 2022 European Union
3+ *
4+ * Licensed under the EUPL, Version 1.2 or – as soon they will be approved by the European
5+ * Commission – subsequent versions of the EUPL (the "Licence"); You may not use this work except in
6+ * compliance with the Licence. You may obtain a copy of the Licence at:
7+ * https://joinup.ec.europa.eu/software/page/eupl
8+ *
9+ * Unless required by applicable law or agreed to in writing, software distributed under the Licence
10+ * is distributed on an "AS IS" basis, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express
11+ * or implied. See the Licence for the specific language governing permissions and limitations under
12+ * the Lic
13+ */
114package eu .europa .ted .efx .interfaces ;
215
316import java .util .List ;
417import eu .europa .ted .efx .model .Expression .PathExpression ;
518
619/**
7- * EFX expressions contain references to eForms fields and nodes. These references are in the form
8- * of field or node identifiers (a.k.a. symbols). The role of the {@link SymbolResolver} is to
9- * provide further information on these referenced fields or nodes by looking them up in a
10- * repository.
20+ * A SymbolResolver is a mechanism used by EFX translators to resolve symbols.
21+ *
22+ * EFX expressions contain references to eForms entities (fields, nodes or codelists). These
23+ * references are in the form of entity identifiers (a.k.a. symbols). The role of the
24+ * {@link SymbolResolver} is to provide further information on these referenced entities by looking
25+ * them up in a symbol dictionary (or repository). This symbol repository is typically the eForms
26+ * SDK itself.
1127 */
1228public interface SymbolResolver {
1329
1430 /**
1531 * Gets the identifier of the parent node of the given field.
1632 *
33+ * This information is typically retrieved directly from the eForms SDK.
34+ *
1735 * @param fieldId The identifier of the field to look for.
1836 * @return The identifier of the parent node of the given field.
1937 */
2038 public String getParentNodeOfField (final String fieldId );
2139
2240 /**
23- * Gets the path that can be used to locate the give field in the data source, relative to another
24- * given path.
41+ * Gets the path that can be used to locate the given field in the data source, relative to
42+ * another given path.
43+ *
44+ * The "path" points to a location in the data source. The path will be eventually used to retrieve
45+ * the data from the data source. Typically, the data source is an XML file, in which case the
46+ * path should be an XPath. If the data source is a JSON file, then the path should be a JsonPath.
47+ * If you intend to use a function call to retrieve the data from the data source then that is what
48+ * you should return as path. In general keep in mind that the path is used as target language script.
2549 *
2650 * @param fieldId The identifier of the field to look for.
2751 * @param contextPath The path relative to which we expect to find the return value.
28- * @return The path to the given field relative to the given context path .
52+ * @return The path to the given field relative to the given contextPath .
2953 */
3054 public PathExpression getRelativePathOfField (final String fieldId ,
3155 final PathExpression contextPath );
@@ -34,6 +58,8 @@ public PathExpression getRelativePathOfField(final String fieldId,
3458 * Gets the path that can be used to locate the given node in the data source, relative to another
3559 * given path.
3660 *
61+ * See {@link getRelativePathOfField} for a description of the concept of "path".
62+ *
3763 * @param nodeId The identifier of the node to look for.
3864 * @param contextPath The path relative to which we expect to find the return value.
3965 * @return The path to the given node relative to the given context path.
@@ -46,6 +72,8 @@ public PathExpression getRelativePathOfNode(final String nodeId,
4672 /**
4773 * Gets the absolute path that can be used to locate a field in the data source.
4874 *
75+ * See {@link getRelativePathOfField} for a description of the concept of "path".
76+ *
4977 * @param fieldId The identifier of the field to look for.
5078 * @return The absolute path to the field as a PathExpression.
5179 */
@@ -54,6 +82,8 @@ public PathExpression getRelativePathOfNode(final String nodeId,
5482 /**
5583 * Gets the absolute path the can be used to locate a node in the data source.
5684 *
85+ * See {@link getRelativePathOfField} for a description of the concept of "path".
86+ *
5787 * @param nodeId The identifier of the node to look for.
5888 * @return The absolute path to the node as a PathExpression.
5989 */
@@ -62,6 +92,8 @@ public PathExpression getRelativePathOfNode(final String nodeId,
6292 /**
6393 * Gets the type of the given field.
6494 *
95+ * This information is typically retrieved directly from the eForms SDK.
96+ *
6597 * @param fieldId The identifier of the field to look for.
6698 * @return The type of the field as a string.
6799 */
@@ -71,6 +103,8 @@ public PathExpression getRelativePathOfNode(final String nodeId,
71103 * Gets the codelist associated with the given field. If the codelist is a tailored codelist then
72104 * this method will return the identifier of its parent codelist.
73105 *
106+ * This information is typically retrieved directly from the eForms SDK.
107+ *
74108 * @param fieldId The identifier of the field to look for.
75109 * @return The "root" codelist associated ith the given field.
76110 */
@@ -79,6 +113,8 @@ public PathExpression getRelativePathOfNode(final String nodeId,
79113 /**
80114 * Gets the list of all codes in a given codelist as a list of strings.
81115 *
116+ * This information is typically retrieved directly from the eForms SDK.
117+ *
82118 * @param codelistId The identifier of the codelist to expand.
83119 * @return The list of codes in the given codelist.
84120 */
0 commit comments