Class ModelElement


  • public class ModelElement
    extends Object
    A w3c Element wrapper with a better API. Author unknown.
    • Constructor Detail

      • ModelElement

        public ModelElement​(Element xml)
    • Method Detail

      • child

        public ModelElement child​(String name)
        Returns the child with the given name, or null if none.
      • childAsString

        public String childAsString​(String path)
      • asString

        public String asString()
      • asDouble

        public double asDouble()
      • asLong

        public long asLong()
      • asDuration

        public Duration asDuration()
      • childAsLong

        public Long childAsLong​(String path)
      • childAsInteger

        public Integer childAsInteger​(String path)
      • childAsDouble

        public Double childAsDouble​(String path)
      • childAsBoolean

        public Boolean childAsBoolean​(String path)
      • requiredIntegerAttribute

        public int requiredIntegerAttribute​(String name)
        Returns the given attribute or throws IllegalArgumentException if not present
      • integerAttribute

        public Integer integerAttribute​(String name)
        Returns the value of this attribute or null if not present
      • booleanAttribute

        public boolean booleanAttribute​(String name)
      • booleanAttribute

        public boolean booleanAttribute​(String name,
                                        boolean defaultValue)
      • longAttribute

        public Long longAttribute​(String name)
      • doubleAttribute

        public Double doubleAttribute​(String name)
      • requiredDoubleAttribute

        public double requiredDoubleAttribute​(String name)
        Returns the given attribute or throws IllegalArgumentException if not present
      • stringAttribute

        public String stringAttribute​(String name)
        Returns the content of the attribute with the given name, or null if none
      • stringAttribute

        public String stringAttribute​(String name,
                                      String defaultValue)
        Returns the content of the attribute with the given name, or the default value if none
      • requiredStringAttribute

        public String requiredStringAttribute​(String name)
        Returns the content of the attribute with the given name or throws IllegalArgumentException if not present