Class DOIAdapter
java.lang.Object
org.lfenergy.compas.sct.commons.scl.SclElementAdapter<AbstractLNAdapter<? extends TAnyLN>,TDOI>
org.lfenergy.compas.sct.commons.scl.ied.DOIAdapter
- All Implemented Interfaces:
IDataAdapter
,IDataParentAdapter
public class DOIAdapter
extends SclElementAdapter<AbstractLNAdapter<? extends TAnyLN>,TDOI>
implements IDataParentAdapter
A representation of the model object
DOIAdapter
.
The following features are supported:
-
Nested Class Summary
Modifier and TypeClassDescriptionstatic class
A representation of the model objectDOIAdapter.DAIAdapter
. -
Field Summary
Fields inherited from class org.lfenergy.compas.sct.commons.scl.SclElementAdapter
currentElem, parentAdapter
-
Constructor Summary
ModifierConstructorDescriptionprotected
DOIAdapter
(AbstractLNAdapter<? extends TAnyLN> parentAdapter, TDOI currentElem) Constructor -
Method Summary
Modifier and TypeMethodDescriptionprotected boolean
Check if node is child of the reference nodeprotected String
Returns XPath path to current elementgetName()
Get name of the DOI or SDIGet children (SDI or DAI) of this elementConvert the given TDAI to a AbstractDAIAdapter The current instance must be the parent of the given childTSDIConvert the given TSDI to a RootSDIAdapter or SDIAdapter The current instance must be the parent of the given childTSDICheck and update DAI identified by name with given valueupdateDaiFromExtRef
(List<TExtRef> tExtRefs) Update the DAI/Val according to the ExtRef attributes.Methods inherited from class org.lfenergy.compas.sct.commons.scl.SclElementAdapter
addPrivate, amRootElement, buildFatalReportItem, customInit, getXPath, setCurrentElem
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface org.lfenergy.compas.sct.commons.scl.ied.IDataParentAdapter
addDAI, addSDOI, findDataAdapterByName, findDeepestMatch, findStructuredDataAdapterByName, getDataAdapterByName, getStructuredDataAdapterByName
-
Field Details
-
DAI_NOT_UPDATABLE_MESSAGE
- See Also:
-
-
Constructor Details
-
DOIAdapter
Constructor- Parameters:
parentAdapter
- Parent container referencecurrentElem
- Current reference
-
-
Method Details
-
amChildElementRef
protected boolean amChildElementRef()Check if node is child of the reference node- Specified by:
amChildElementRef
in classSclElementAdapter<AbstractLNAdapter<? extends TAnyLN>,
TDOI> - Returns:
- link parent child existence
-
elementXPath
Description copied from class:SclElementAdapter
Returns XPath path to current element- Specified by:
elementXPath
in classSclElementAdapter<AbstractLNAdapter<? extends TAnyLN>,
TDOI> - Returns:
- message as undefined
-
getName
Description copied from interface:IDataParentAdapter
Get name of the DOI or SDI- Specified by:
getName
in interfaceIDataParentAdapter
- Returns:
- name of the DOI or SDI
-
getSDIOrDAI
Description copied from interface:IDataParentAdapter
Get children (SDI or DAI) of this element- Specified by:
getSDIOrDAI
in interfaceIDataParentAdapter
- Returns:
- currentElem.getSDIOrDAI()
-
toAdapter
Description copied from interface:IDataParentAdapter
Convert the given TSDI to a RootSDIAdapter or SDIAdapter The current instance must be the parent of the given childTSDI- Specified by:
toAdapter
in interfaceIDataParentAdapter
- Parameters:
childTSDI
- child SDI to convert to an adapter- Returns:
- RootSDIAdapter when current instance is a DOI or SDIAdapter otherwise
-
toAdapter
Description copied from interface:IDataParentAdapter
Convert the given TDAI to a AbstractDAIAdapter The current instance must be the parent of the given childTSDI- Specified by:
toAdapter
in interfaceIDataParentAdapter
- Parameters:
childTDAI
- child SDI to convert to an adapter- Returns:
- AbstractDAIAdapter
-
updateDaiFromExtRef
Update the DAI/Val according to the ExtRef attributes. If the ExtRef.desc start with DAI[name='purpose']/Val and end with "_1" (nominal case): - DAI[name='setSrcRef']/Val is updated with ExtRef attributes concatenation - DAI[name='setSrcCB']/Val is updated with ExtRef attributes concatenation if ExtRef.srcCBName is present If the ExtRef.desc start with DAI[name='purpose']/Val and end with "_2" or greater (test case): - DAI[name='setTstRef']/Val is updated with ExtRef attributes concatenation - DAI[name='setTstCB']/Val is updated with ExtRef attributes concatenation if ExtRef.srcCBName is present- Parameters:
tExtRefs
- all the ExtRefs contained in the current LDevice/LLN0- Returns:
- a filled SclReportItem if an error occurs, empty SclReportItem otherwise
-
updateDAI
Check and update DAI identified by name with given value- Parameters:
daName
- name of DAI to updatevalue
- new value- Returns:
- warning message when DAI not updatable, otherwise return empty and update DAI with value
-