Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -207,7 +207,7 @@ public boolean hasType(String typeName) {
}

public boolean shouldGetIncludeElement(String classSimpleName) {
return classRepository.isIncludeTypePresent() && AdditionalRootElement.VALUE_BY_TYPE.containsKey(classSimpleName);
return classRepository.isIncludeTypePresent() && AdditionalRootElement.VALUE_BY_TYPE.containsKey(classSimpleName) && AdditionalRootElement.VALUE_BY_TYPE.get(classSimpleName).isAddIncludeToTypeGroup();
}

public AdditionalRootElement getAdditionalRootElement(String classSimpleName) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@

import java.util.Arrays;
import java.util.Map;
import java.util.Set;
import java.util.stream.Collectors;

import lombok.Getter;
Expand All @@ -26,7 +27,8 @@
* a configuration.
*/
public enum AdditionalRootElement {
PIPELINE_PART("PipelinePart", "IPipe", "Wrapper element to help create reusable parts of a pipeline");
PIPELINE_PART("PipelinePart", "IPipe", true, "Wrapper element to help create reusable parts of a pipeline that can be included into other pipelines"),
COMPONENT_PIPE("Pipeline", "ComponentPipe", false, "Wrapper element to help create reusable parts of a pipeline that can be built as independent pipelines", "Pipeline");

/**
* Lookup-map to find the Enum value by the (simple) classname of a type being processed.
Expand All @@ -43,14 +45,25 @@ public enum AdditionalRootElement {
* The XSD typename is dynamically generated for the type and not part of the enum definition.
*/
private final @Getter String typeName;
/**
* If true, and the typeName is an interface from which a group-type will be generated consisting of all implementations
* of the interface, the "Include" element will be added to that group.
*/
private final @Getter boolean addIncludeToTypeGroup;
/**
* Doc string that should be added to the XSD or JSON for this top-level element.
*/
private final @Getter String docString;

AdditionalRootElement(String elementName, String typeName, String docString) {
/**
* Set of types allowed in the additional root element
*/
private final @Getter Set<String> allowedTypes;
AdditionalRootElement(String elementName, String typeName, boolean addIncludeToTypeGroup, String docString, String... allowedTypes) {
this.elementName = elementName;
this.typeName = typeName;
this.addIncludeToTypeGroup = addIncludeToTypeGroup;
this.docString = docString;
this.allowedTypes = Set.of(allowedTypes);
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
package org.frankframework.frankdoc.testtarget.hierarchy;

public class ComponentPipe implements IPipe {
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
package org.frankframework.frankdoc.testtarget.hierarchy;

public class PipeLine {
public void addPipe(IPipe pipe) {

}
}
Original file line number Diff line number Diff line change
Expand Up @@ -6,10 +6,7 @@ public void addParameter(IParameter parameter) {

}

public void addPipe(IPipe pipe) {

}

public void addInclude(Include include) {}

public void setPipeLine(PipeLine pipeLine) {}
}
Original file line number Diff line number Diff line change
Expand Up @@ -8,11 +8,15 @@
"org.frankframework.frankdoc.testtarget.hierarchy.Parameter"
],
"org.frankframework.frankdoc.testtarget.hierarchy.IPipe": [
"org.frankframework.frankdoc.testtarget.hierarchy.ComponentPipe",
"org.frankframework.frankdoc.testtarget.hierarchy.JwtPipe"
],
"org.frankframework.frankdoc.testtarget.hierarchy.Include": [
"org.frankframework.frankdoc.testtarget.hierarchy.Include"
],
"org.frankframework.frankdoc.testtarget.hierarchy.PipeLine": [
"org.frankframework.frankdoc.testtarget.hierarchy.PipeLine"
],
"org.frankframework.frankdoc.testtarget.hierarchy.Start": [
"org.frankframework.frankdoc.testtarget.hierarchy.Start"
],
Expand All @@ -30,7 +34,7 @@
},
"PipelinePart": {
"name": "PipelinePart",
"description": "Wrapper element to help create reusable parts of a pipeline"
"description": "Wrapper element to help create reusable parts of a pipeline that can be included into other pipelines"
},
"org.frankframework.frankdoc.testtarget.hierarchy.NumberParameter": {
"name": "NumberParameter",
Expand Down Expand Up @@ -67,18 +71,26 @@
"roleName": "param",
"type": "org.frankframework.frankdoc.testtarget.hierarchy.IParameter"
},
{
"multiple": true,
"roleName": "pipe",
"type": "org.frankframework.frankdoc.testtarget.hierarchy.IPipe"
},
{
"multiple": true,
"roleName": "include",
"type": "org.frankframework.frankdoc.testtarget.hierarchy.Include"
},
{
"multiple": false,
"roleName": "pipeline",
"type": "org.frankframework.frankdoc.testtarget.hierarchy.PipeLine"
}
]
},
"org.frankframework.frankdoc.testtarget.hierarchy.ComponentPipe": {
"name": "ComponentPipe",
"attributes": {
"active": {
"description": "If defined and empty or false, then this element and all its children are ignored"
}
}
},
"org.frankframework.frankdoc.testtarget.hierarchy.Include": {
"name": "Include",
"description": "Dummy element to trigger Frank!Doc to allow including other files in the right places",
Expand Down Expand Up @@ -115,6 +127,21 @@
"description": "If defined and empty or false, then this element and all its children are ignored"
}
}
},
"org.frankframework.frankdoc.testtarget.hierarchy.PipeLine": {
"name": "Pipeline",
"attributes": {
"active": {
"description": "If defined and empty or false, then this element and all its children are ignored"
}
},
"children": [
{
"multiple": true,
"roleName": "pipe",
"type": "org.frankframework.frankdoc.testtarget.hierarchy.IPipe"
}
]
}
},
"elementNames": {
Expand All @@ -139,11 +166,17 @@
"Start": {
"className": "org.frankframework.frankdoc.testtarget.hierarchy.Start"
},
"ComponentPipe": {
"className": "org.frankframework.frankdoc.testtarget.hierarchy.ComponentPipe"
},
"Include": {
"className": "org.frankframework.frankdoc.testtarget.hierarchy.Include"
},
"Param": {
"className": "org.frankframework.frankdoc.testtarget.hierarchy.Parameter"
},
"Pipeline": {
"className": "org.frankframework.frankdoc.testtarget.hierarchy.PipeLine"
}
},
"enums": {}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -32,9 +32,18 @@
<xs:attribute name="elementRole" type="xs:string" fixed="include" use="prohibited" />
<xs:anyAttribute namespace="##other" processContents="skip" />
</xs:complexType>
<xs:complexType name="PipelineType">
<xs:sequence>
<xs:group ref="PipeElementGroup" minOccurs="0" maxOccurs="unbounded" />
</xs:sequence>
<xs:attribute name="className" type="xs:string" fixed="org.frankframework.frankdoc.testtarget.hierarchy.PipeLine" use="prohibited" />
<xs:attribute ref="active" />
<xs:attribute name="elementRole" type="xs:string" fixed="pipeline" use="prohibited" />
<xs:anyAttribute namespace="##other" processContents="skip" />
</xs:complexType>
<xs:element name="PipelinePart">
<xs:annotation>
<xs:documentation>Wrapper element to help create reusable parts of a pipeline</xs:documentation>
<xs:documentation>Wrapper element to help create reusable parts of a pipeline that can be included into other pipelines</xs:documentation>
</xs:annotation>
<xs:complexType>
<xs:sequence>
Expand All @@ -54,8 +63,8 @@
<xs:sequence>
<xs:element ref="Module" minOccurs="0" maxOccurs="unbounded" />
<xs:group ref="ParamElementGroup" minOccurs="0" maxOccurs="unbounded" />
<xs:group ref="PipeElementGroup" minOccurs="0" maxOccurs="unbounded" />
<xs:element name="Include" minOccurs="0" maxOccurs="unbounded" type="IncludeType" />
<xs:element name="Pipeline" minOccurs="0" maxOccurs="1" type="PipelineType" />
</xs:sequence>
</xs:group>
<xs:group name="ParamElementGroup">
Expand Down Expand Up @@ -129,6 +138,15 @@
</xs:group>
<xs:group name="PipeElementGroupBase">
<xs:choice>
<xs:element name="ComponentPipe">
<xs:complexType>
<xs:complexContent>
<xs:extension base="ComponentPipeType">
<xs:attribute name="elementRole" type="xs:string" fixed="pipe" use="prohibited" />
</xs:extension>
</xs:complexContent>
</xs:complexType>
</xs:element>
<xs:element name="JwtPipe">
<xs:complexType>
<xs:complexContent>
Expand All @@ -140,6 +158,11 @@
</xs:element>
</xs:choice>
</xs:group>
<xs:complexType name="ComponentPipeType">
<xs:attribute name="className" type="xs:string" fixed="org.frankframework.frankdoc.testtarget.hierarchy.ComponentPipe" use="prohibited" />
<xs:attribute ref="active" />
<xs:anyAttribute namespace="##other" processContents="skip" />
</xs:complexType>
<xs:complexType name="JwtPipeType">
<xs:attributeGroup ref="JwtPipeDeclaredAttributeGroup" />
<xs:attribute name="className" type="xs:string" fixed="org.frankframework.frankdoc.testtarget.hierarchy.JwtPipe" use="prohibited" />
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,5 +2,6 @@
<digester-rules>
<rule pattern="*/include" registerMethod="addInclude" beanClass="org.frankframework.frankdoc.testtarget.hierarchy.Include" />
<rule pattern="*/param" registerMethod="addParameter"/>
<rule pattern="*/pipeline" registerMethod="setPipeLine"/>
<rule pattern="*/pipe" registerMethod="addPipe"/>
</digester-rules>