Package org.appng.api.support
Class DatasourceInheritanceHelper
- java.lang.Object
-
- org.appng.api.support.DatasourceInheritanceHelper
-
public class DatasourceInheritanceHelper extends Object
This is a helper class providing some static methods to process the inheritance of datasource definitions found in a resource. If a datasource id contains the inheritance separator '::' appNG clones the ancestor datasource definition and overrides or adds:- datasource id - override
- title - override
- parameter - add
- bind class - override
- fields - add
- bean id - override
- bean options - add
- linkpanel - override
- config permissions - override
- config labels - add
- Author:
- Claus Stümke, aiticon GmbH, 2016
-
-
Constructor Summary
Constructors Constructor Description DatasourceInheritanceHelper()
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static String
getAncestorId(String datasourceId)
returns the part of the datasource id of a datatsource for inheritance which indicates the id of the ancestor datasourcestatic String
getDescendantId(String datasourceId)
returns the part of the datasource id of a datatsource for inheritance which indicates the final id of the descendantstatic Datasource
inherit(Datasource descendantDefinition, Datasource ancestor, MarshallService marshallService)
clones the ancestor datasource and adds or overrides id, title, parameter, fields, bean options, bean id, bind class and linkpanel.static boolean
isInheriting(String datasourceId)
Returnstrue
if the id contains exactly one inheritance separator string "::"
-
-
-
Method Detail
-
isInheriting
public static boolean isInheriting(String datasourceId)
Returnstrue
if the id contains exactly one inheritance separator string "::"- Parameters:
datasourceId
-- Returns:
true
if the id contains an inheritance separator string
-
getDescendantId
public static String getDescendantId(String datasourceId)
returns the part of the datasource id of a datatsource for inheritance which indicates the final id of the descendant- Parameters:
datasourceId
-- Returns:
- the descendant's id
-
getAncestorId
public static String getAncestorId(String datasourceId)
returns the part of the datasource id of a datatsource for inheritance which indicates the id of the ancestor datasource- Parameters:
datasourceId
-- Returns:
- the ancestor's id
-
inherit
public static Datasource inherit(Datasource descendantDefinition, Datasource ancestor, MarshallService marshallService)
clones the ancestor datasource and adds or overrides id, title, parameter, fields, bean options, bean id, bind class and linkpanel. Returns the new datasource.- Parameters:
descendantDefinition
-ancestor
-- Returns:
- the cloned
Datasource
-
-