Enum Class DocumentReader.NodeAnnotation

java.lang.Object
java.lang.Enum<DocumentReader.NodeAnnotation>
org.opentrafficsim.editor.DocumentReader.NodeAnnotation
All Implemented Interfaces:
Serializable, Comparable<DocumentReader.NodeAnnotation>, Constable
Enclosing class:
DocumentReader

public static enum DocumentReader.NodeAnnotation extends Enum<DocumentReader.NodeAnnotation>
Types of annotation elements the DocumentReader can read. This is a combination of the element name (e.g. xsd:appinfo) and the source name.
 <xsd:sequence>
   <xsd:annotation>
     <xsd:appinfo source="name">annotates the sequence</xsd:appinfo>
   </xsd:annotation>
 </xsd:sequence>
 
  • Enum Constant Details

  • Method Details

    • values

      public static DocumentReader.NodeAnnotation[] values()
      Returns an array containing the constants of this enum class, in the order they are declared.
      Returns:
      an array containing the constants of this enum class, in the order they are declared
    • valueOf

      public static DocumentReader.NodeAnnotation valueOf(String name)
      Returns the enum constant of this class with the specified name. The string must match exactly an identifier used to declare an enum constant in this class. (Extraneous whitespace characters are not permitted.)
      Parameters:
      name - the name of the enum constant to be returned.
      Returns:
      the enum constant with the specified name
      Throws:
      IllegalArgumentException - if this enum class has no constant with the specified name
      NullPointerException - if the argument is null
    • get

      public Optional<String> get(Node node)
      Returns an annotation value. These are defined as below, for either xsd:appinfo or xsd:documentation. All space-like characters are replaced by blanks, and consecutive blanks are removed.
       <xsd:sequence>
         <xsd:annotation>
           <xsd:appinfo source="name">annotates the sequence</xsd:appinfo>
         </xsd:annotation>
       </xsd:sequence>
       
      Parameters:
      node - node, either xsd:element or xsd:attribute.
      Returns:
      annotation value, empty if not found.