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
Nested ClassesModifier and TypeClassDescriptionstatic classA representation of the model objectDOIAdapter.DAIAdapter. -
Field Summary
FieldsFields inherited from class org.lfenergy.compas.sct.commons.scl.SclElementAdapter
currentElem, parentAdapter -
Constructor Summary
ConstructorsModifierConstructorDescriptionprotectedDOIAdapter(AbstractLNAdapter<? extends TAnyLN> parentAdapter, TDOI currentElem) Constructor -
Method Summary
Modifier and TypeMethodDescriptionprotected booleanCheck if node is child of the reference nodeprotected StringReturns 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, setCurrentElemMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods 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:
amChildElementRefin classSclElementAdapter<AbstractLNAdapter<? extends TAnyLN>,TDOI> - Returns:
- link parent child existence
-
elementXPath
Description copied from class:SclElementAdapterReturns XPath path to current element- Specified by:
elementXPathin classSclElementAdapter<AbstractLNAdapter<? extends TAnyLN>,TDOI> - Returns:
- message as undefined
-
getName
Description copied from interface:IDataParentAdapterGet name of the DOI or SDI- Specified by:
getNamein interfaceIDataParentAdapter- Returns:
- name of the DOI or SDI
-
getSDIOrDAI
Description copied from interface:IDataParentAdapterGet children (SDI or DAI) of this element- Specified by:
getSDIOrDAIin interfaceIDataParentAdapter- Returns:
- currentElem.getSDIOrDAI()
-
toAdapter
Description copied from interface:IDataParentAdapterConvert the given TSDI to a RootSDIAdapter or SDIAdapter The current instance must be the parent of the given childTSDI- Specified by:
toAdapterin 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:IDataParentAdapterConvert the given TDAI to a AbstractDAIAdapter The current instance must be the parent of the given childTSDI- Specified by:
toAdapterin 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
-