diff --git a/docs/_data/xpath_funs.yml b/docs/_data/xpath_funs.yml index 404e749726..07f70a472f 100644 --- a/docs/_data/xpath_funs.yml +++ b/docs/_data/xpath_funs.yml @@ -1,27 +1,36 @@ +aliases: + - &qname_param + name: javaQualifiedName + type: "xs:string" + description: "The qualified name of a class, possibly with pairs of brackets to indicate an array type. + Can also be a primitive type name." + - &needs_typenode "The context node must be a {% jdoc jast::TypeNode %}" + langs: - name: "Java" ns: "pmd-java" funs: - name: typeIs returnType: "xs:boolean" + shortDescription: "Tests a node's static type" description: "Returns true if the context node's static type is a subtype of the given type" - notes: "The context node must be a {% jdoc jast::TypeNode %}" + notes: *needs_typenode parameters: - - name: javaQualifiedName - type: "xs:string" - description: "the qualified name of a class, possibly with pairs of brackets to indicate an array type. - Can also be a primitive type name." + - *qname_param - name: typeIsExactly returnType: "xs:boolean" + shortDescription: "Tests a node's static type, ignoring subtypes" description: "Returns true if the context node's static type is exactly the given type. In particular, returns false if the context node's type is a subtype of the given type." - notes_are_same_as: typeIs - params_are_same_as: typeIs + notes: *needs_typenode + parameters: + - *qname_param - name: metric returnType: "xs:decimal?" + shortDescription: "Computes and returns the value of a metric" description: "Returns the value of the metric as evaluated on the context node" notes: "The context node must be a {% jdoc jast::ASTAnyTypeDeclaration %} or a {% jdoc jast::MethodLikeNode %}" parameters: @@ -35,4 +44,4 @@ langs: - code: '//VariableDeclaratorId[pmd-java:typeIs("java.lang.List")]' outcome: "Matches variable declarators of type `List` or any of its subtypes (including e.g. `ArrayList`)" - code: '//VariableDeclaratorId[pmd-java:typeIsExactly("java.lang.List")]' - outcome: "Matches variable declarators of type `List` (but not e.g. `ArrayList`)" \ No newline at end of file + outcome: "Matches variable declarators of type `List` (but not e.g. `ArrayList`)" diff --git a/docs/_includes/custom/xpath_fun_doc.html b/docs/_includes/custom/xpath_fun_doc.html index 1fe1ca896d..e56f97b9ef 100644 --- a/docs/_includes/custom/xpath_fun_doc.html +++ b/docs/_includes/custom/xpath_fun_doc.html @@ -6,57 +6,93 @@ {{ lang.name }} functions are in the namespace `{{ lang.ns }}`. -
Function name | -Parameters | Description | -Notes | +||
---|---|---|---|---|---|
{{ fun.name }} | +{{ fun.shortDescription }} |
- {% if fun.parameters.size == 0 %}
- None
- {% elsif fun.params_are_same_as %}
- (Same as for `{{ fun.params_are_same_as }}`)
- {% elsif fun.parameters.size == 1 %}
- 1: {{ fun.parameters[0].description }}
- {% else %}
-
|
- {{ fun.description }} | -- {% if fun.notes_are_same_as %} - (Same as for `{{ fun.notes_are_same_as }}`) - {% else %} - {{ fun.notes }} - {% endif %} + | |
-
- {{ fun.name }}-This is a fun function +
+
+
+
+
+ {{ lang.ns | append: ':' }}{{ fun.name }}{{ fun | xpath_fun_type }} ++ +
+
+
+
Examples+ +
|