Package org.opentrafficsim.editor
Class Schema
java.lang.Object
org.opentrafficsim.editor.Schema
Reads the XML Schema in XSD format for OTS. This class contains various methods that the editor can use to present relevant
structure and information to the user.
Copyright (c) 2023-2024 Delft University of Technology, PO Box 5, 2600 AA, Delft, the Netherlands. All rights reserved.
BSD-style license. See OpenTrafficSim License.
- Author:
- Wouter Schakel
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptiongetElement
(String path) Returns the node for the given path.getRoot()
Get the root node.Returns the type, as pointed to by base={base}.boolean
Return whether the given node is of the type.keyrefs()
Returns the xsd:keyref and the paths where they are defined.keys()
Returns the xsd:key and the paths where they are defined.uniques()
Returns the xsd:unique and the paths where they are defined.
-
Constructor Details
-
Schema
Constructs the XML Schema information from a document.- Parameters:
document
- Document; main document, other files may be included from within the file.
-
-
Method Details
-
getRoot
Get the root node.- Returns:
- Node; root node.
-
getElement
Returns the node for the given path.- Parameters:
path
- String; path.- Returns:
- Node; type.
-
getType
Returns the type, as pointed to by base={base}.- Parameters:
base
- String; type.- Returns:
- String; type, as pointed to by base={base}.
-
keys
Returns the xsd:key and the paths where they are defined.- Returns:
- Map<String, Node>; xsd:key and the paths where they are defined.
-
keyrefs
Returns the xsd:keyref and the paths where they are defined.- Returns:
- Map<String, Node>; xsd:keyref and the paths where they are defined.
-
uniques
Returns the xsd:unique and the paths where they are defined.- Returns:
- Map<String, Node>; xsd:unique and the paths where they are defined.
-
isType
Return whether the given node is of the type.- Parameters:
node
- Node; node.path
- String; path of the type in dotted xpath notation, e.g. "SignalGroup.TrafficLight".- Returns:
- boolean; whether the given node is of the type.
-