Skip to content

Commit b79b7d7

Browse files
committed
dialect javadoc
1 parent 439b3db commit b79b7d7

File tree

3 files changed

+83
-24
lines changed

3 files changed

+83
-24
lines changed

src/main/java/edu/ucsb/nceas/mdqengine/model/Dialect.java

Lines changed: 40 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,19 +3,57 @@
33
import javax.xml.bind.annotation.XmlAccessType;
44
import javax.xml.bind.annotation.XmlAccessorType;
55

6+
/**
7+
* Dialect is used to conditionally apply the check or ensure Check is valid. They
8+
* contain a name, xpath and/or expression element which is used to extract an
9+
* element that can be used to verify the check should be run on the document.
10+
*/
11+
612
@XmlAccessorType(XmlAccessType.FIELD)
713
public interface Dialect {
8-
14+
/**
15+
* Gets the name of the dialect.
16+
*
17+
* @return the dialect name
18+
*/
919
public String getName();
1020

21+
/**
22+
* Sets the name of the dialect.
23+
*
24+
* @param name the dialect name to set
25+
*/
1126
public void setName(String name);
1227

28+
/**
29+
* Gets the xpath expression used to determine if this dialect applies to a
30+
* given metadata document.
31+
*
32+
* @return the xpath expression string
33+
*/
1334
public String getXpath();
1435

36+
/**
37+
* Sets the xpath for this dialect.
38+
*
39+
* @param xpath the xpath expression to set
40+
*/
1541
public void setXpath(String xpath);
1642

43+
/**
44+
* Gets the expression object used to evaluate the dialect condition. This can
45+
* be used instead of or in addition to xpath to support other expression
46+
* syntaxes.
47+
*
48+
* @return the Expression object
49+
*/
1750
public Expression getExpression();
1851

52+
/**
53+
* Sets the expression object. This can be used instead of or in addition to
54+
* xpath to support other expression syntaxes.
55+
*
56+
* @param expression the Expression to set
57+
*/
1958
public void setExpression(Expression expression);
20-
2159
}

src/main/java/edu/ucsb/nceas/mdqengine/model/DialectV1.java

Lines changed: 12 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -4,10 +4,17 @@
44
import javax.xml.bind.annotation.XmlAccessorType;
55
import javax.xml.bind.annotation.XmlElement;
66

7+
/**
8+
* Dialect is used to conditionally apply the check or ensure Check is valid. They
9+
* contain a name, xpath and/or expression element which is used to extract an
10+
* element that can be used to verify the check should be run on the document.
11+
*/
12+
713
@XmlAccessorType(XmlAccessType.FIELD)
814
public class DialectV1 implements Dialect {
915

10-
public DialectV1() {}
16+
public DialectV1() {
17+
}
1118

1219
/**
1320
* The name or label to associate with this dialect definition
@@ -17,10 +24,8 @@ public DialectV1() {}
1724

1825
/**
1926
* The XPath expression that is used to determine if a document is of this
20-
* dialect.
21-
* The expression should evaluate to a boolean value, where true indicates the
22-
* document
23-
* is of this dialect.
27+
* dialect. The expression should evaluate to a boolean value, where true
28+
* indicates the document is of this dialect.
2429
*/
2530
@XmlElement(required = false)
2631
private String xpath;
@@ -41,14 +46,14 @@ public void setXpath(String xpath) {
4146
this.xpath = xpath;
4247
}
4348

44-
@Override
49+
@Override
4550
public Expression getExpression() {
4651
return null;
4752
}
53+
4854
@Override
4955
public void setExpression(Expression expression) {
5056
return;
5157
}
5258

53-
5459
}

src/main/java/edu/ucsb/nceas/mdqengine/model/DialectV2.java

Lines changed: 31 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -4,45 +4,61 @@
44
import javax.xml.bind.annotation.XmlAccessorType;
55
import javax.xml.bind.annotation.XmlElement;
66

7+
/**
8+
* Dialect is used to conditionally apply the check or ensure Check is valid.
9+
* They
10+
* contain a name, xpath and/or expression element which is used to extract an
11+
* element that can be used to verify the check should be run on the document.
12+
*
13+
* DialectV2 optionally supports the expression element, which allows for more
14+
* options in syntax than the previously used xpath element.
15+
*/
16+
717
@XmlAccessorType(XmlAccessType.FIELD)
818
public class DialectV2 implements Dialect {
919

10-
public DialectV2() {}
20+
public DialectV2() {
21+
}
1122

1223
public static DialectV2 newDialect() {
13-
return new DialectV2();
14-
}
15-
24+
return new DialectV2();
25+
}
26+
1627
/**
1728
* The name or label to associate with this dialect definition
1829
*/
19-
@XmlElement(required = false)
30+
@XmlElement(required = false)
2031
private String name;
21-
32+
2233
/**
23-
* The XPath expression that is used to determine if a document is of this dialect.
24-
* The expression should evaluate to a boolean value, where true indicates the document
34+
* The XPath expression that is used to determine if a document is of this
35+
* dialect.
36+
* The expression should evaluate to a boolean value, where true indicates the
37+
* document
2538
* is of this dialect.
2639
*/
27-
@XmlElement(required = false)
28-
private String xpath;
29-
40+
@XmlElement(required = false)
41+
private String xpath;
42+
3043
@XmlElement(required = false)
3144
private Expression expression;
3245

33-
@Override
46+
@Override
3447
public String getName() {
3548
return name;
3649
}
37-
@Override
50+
51+
@Override
3852
public void setName(String name) {
3953
this.name = name;
4054
}
41-
@Override
55+
56+
@Override
4257
public String getXpath() {
4358
return xpath;
4459
}
45-
@Override
60+
61+
@Override
4662
public void setXpath(String xpath) {
4763
this.xpath = xpath;
4864
}

0 commit comments

Comments
 (0)