Class SclRootAdapter
java.lang.Object
org.lfenergy.compas.sct.commons.scl.SclElementAdapter<SclRootAdapter,SCL>
org.lfenergy.compas.sct.commons.scl.SclRootAdapter
A representation of the model object
SCL
.
The following features are supported:
- Adapter
Returns the value of the HeaderAdapter reference object
Returns the value of the SubstationAdapter reference object By nme
Returns or Adds the value of the CommunicationAdapter reference object
Returns the value of the IEDAdapter containment reference list
Returns the value of the IEDAdapter reference object By name
Returns the value of the DataTypeTemplateAdapter containment reference list
- Principal functions
Add Private under this object
Adds Header describing the children under this object
Adds IED describing the children under this object
Add given TPrivate describing the children under this object
Returns the value of the revision attribute
Returns the value of the release attribute
Returns the value of the version attribute
- Checklist functions
-
Field Summary
Fields inherited from class org.lfenergy.compas.sct.commons.scl.SclElementAdapter
currentElem, parentAdapter
-
Constructor Summary
ConstructorDescriptionSclRootAdapter
(String hId, String hVersion, String hRevision) ConstructorSclRootAdapter
(SCL scd) Constructor -
Method Summary
Modifier and TypeMethodDescriptionprotected void
Add Header to SCL root nodeAdds IED and updates DataTypeTemplate of current SCLprotected boolean
Check if node is child of the reference nodecheckObjRef
(String val) Checks if given reference matches with at least one IED of SCLprotected String
Returns XPath path to current elementfindConnectedApAdapter
(String iedName, String apName) Find a ConnectedAp element withe given iedName and apNamefindIedAdapterByName
(String iedName) Find an IED by name from SCLgetCommunicationAdapter
(boolean createIfNotExists) Gets Communication from SCLGets DataTypeTemplates from current SCLGets Header from current SCLgetIEDAdapterByName
(String iedName) Gets IED by name from SCLGets SCL Release valueGets SCL Revision valueGets SCL Version valueGets the first Substation from SCL root nodegetSubstationAdapter
(String ssName) Gets Substation from SCL root node by Substation nameGets all IEDs from SCLMethods inherited from class org.lfenergy.compas.sct.commons.scl.SclElementAdapter
addPrivate, amRootElement, buildFatalReportItem, customInit, getXPath, setCurrentElem
-
Field Details
-
RELEASE
public static final short RELEASE- See Also:
-
REVISION
- See Also:
-
VERSION
- See Also:
-
-
Constructor Details
-
SclRootAdapter
Constructor- Parameters:
hId
- SCL Header IDhVersion
- SCL Header VersionhRevision
- SCL Header Revision- Throws:
ScdException
- throws when inconsistenc in SCL file
-
SclRootAdapter
Constructor- Parameters:
scd
- SCL for which adapter is created
-
-
Method Details
-
amChildElementRef
protected boolean amChildElementRef()Check if node is child of the reference node- Specified by:
amChildElementRef
in classSclElementAdapter<SclRootAdapter,
SCL> - Returns:
- true
-
elementXPath
Returns XPath path to current element- Specified by:
elementXPath
in classSclElementAdapter<SclRootAdapter,
SCL> - Returns:
- "SCL>
-
getSclRelease
Gets SCL Release value- Returns:
- Release value
-
getSclRevision
Gets SCL Revision value- Returns:
- Revision value
-
getSclVersion
Gets SCL Version value- Returns:
- Version value
-
getSubstationAdapter
Gets Substation from SCL root node by Substation name- Parameters:
ssName
- name of wanted Substation- Returns:
- SubstationAdapter object
- Throws:
ScdException
- throws when unknown Substation
-
getSubstationAdapter
Gets the first Substation from SCL root node- Returns:
- SubstationAdapter object
- Throws:
ScdException
- throws when unknown Substation
-
addHeader
protected void addHeader(@NonNull @NonNull String hId, @NonNull @NonNull String hVersion, @NonNull @NonNull String hRevision) throws ScdException Add Header to SCL root node- Parameters:
hId
- SCL Header IDhVersion
- SCL Header VersionhRevision
- SCL Header Revision- Throws:
ScdException
- throws when header already exists in SCL
-
addIED
Adds IED and updates DataTypeTemplate of current SCL- Parameters:
icd
- ICD containing IED to add and related DataTypeTemplateiedName
- name of IED to add in SCL- Returns:
- IEDAdapter as added IED
- Throws:
ScdException
- throws when inconsistency between IED to add and SCL file content
-
getHeaderAdapter
Gets Header from current SCL- Returns:
- HeaderAdapter object as Header of SCL
-
getDataTypeTemplateAdapter
Gets DataTypeTemplates from current SCL- Returns:
- DataTypeTemplateAdapter object as DataTypeTemplates of SCL
-
getIEDAdapterByName
Gets IED by name from SCL- Parameters:
iedName
- name of IED to find in SCL- Returns:
- IEDAdapter object as IED of SCL
- Throws:
ScdException
- throws when unknown IED
-
findIedAdapterByName
Find an IED by name from SCL- Parameters:
iedName
- name of IED to find in SCL- Returns:
- Optional
of the first IED with a matching name - Throws:
ScdException
-
getCommunicationAdapter
Gets Communication from SCL- Parameters:
createIfNotExists
- true create Communication node if not exist, false do not create communication- Returns:
- CommunicationAdapter object as IED of SCL
- Throws:
ScdException
- throws when no Communication in SCL and createIfNotExists == false
-
streamIEDAdapters
Gets all IEDs from SCL- Returns:
- Stream of IEDAdapter object as IEDs of SCL
-
checkObjRef
Checks if given reference matches with at least one IED of SCL- Parameters:
val
- reference to check- Returns:
- IEDAdapter object as IED of SCL
- Throws:
ScdException
- throws when no IED matches
-
findConnectedApAdapter
Find a ConnectedAp element withe given iedName and apName- Parameters:
iedName
- iedNameapName
- apName- Returns:
- the first ConnectedAp which match the given iedName and apName, or empty Optional if none found
-