Class PAbstractObject

java.lang.Object
org.mapfish.print.wrapper.PElement
org.mapfish.print.wrapper.PAbstractObject
All Implemented Interfaces:
PObject
Direct Known Subclasses:
PJsonObject, PMultiObject, PYamlObject

public abstract class PAbstractObject extends PElement implements PObject
Abstract class for PObject implementation.
  • Constructor Details

    • PAbstractObject

      protected PAbstractObject(PElement parent, String contextName)
      Constructor.
      Parameters:
      parent - the parent element
      contextName - the field name of this element in the parent.
  • Method Details

    • getString

      public final String getString(String key)
      Get a property as a string or throw an exception.
      Specified by:
      getString in interface PObject
      Parameters:
      key - the property name
    • optString

      public final String optString(String key, String defaultValue)
      Get a property as a string or defaultValue.
      Specified by:
      optString in interface PObject
      Parameters:
      key - the property name
      defaultValue - the default value
    • getInt

      public final int getInt(String key)
      Get a property as an int or throw an exception.
      Specified by:
      getInt in interface PObject
      Parameters:
      key - the property name
    • optInt

      public final Integer optInt(String key, Integer defaultValue)
      Get a property as an int or default value.
      Specified by:
      optInt in interface PObject
      Parameters:
      key - the property name
      defaultValue - the default value
    • getLong

      public final long getLong(String key)
      Get a property as an long or throw an exception.
      Specified by:
      getLong in interface PObject
      Parameters:
      key - the property name
    • optLong

      public final long optLong(String key, long defaultValue)
      Get a property as an long or default value.
      Specified by:
      optLong in interface PObject
      Parameters:
      key - the property name
      defaultValue - the default value
    • getDouble

      public final double getDouble(String key)
      Get a property as a double or throw an exception.
      Specified by:
      getDouble in interface PObject
      Parameters:
      key - the property name
    • optDouble

      public final Double optDouble(String key, Double defaultValue)
      Get a property as a double or defaultValue.
      Specified by:
      optDouble in interface PObject
      Parameters:
      key - the property name
      defaultValue - the default value
    • getFloat

      public final float getFloat(String key)
      Get a property as a float or throw an exception.
      Specified by:
      getFloat in interface PObject
      Parameters:
      key - the property name
    • optFloat

      public final Float optFloat(String key, Float defaultValue)
      Get a property as a float or Default value.
      Specified by:
      optFloat in interface PObject
      Parameters:
      key - the property name
      defaultValue - default value
    • getBool

      public final boolean getBool(String key)
      Get a property as a boolean or throw exception.
      Specified by:
      getBool in interface PObject
      Parameters:
      key - the property name
    • optBool

      public final Boolean optBool(String key, Boolean defaultValue)
      Get a property as a boolean or default value.
      Specified by:
      optBool in interface PObject
      Parameters:
      key - the property name
      defaultValue - the default
    • getObject

      public final PObject getObject(String key)
      Get a property as a object or throw exception.
      Specified by:
      getObject in interface PObject
      Parameters:
      key - the property name
    • optObject

      public final PObject optObject(String key, PObject defaultValue)
      Get a property as a array or default.
      Specified by:
      optObject in interface PObject
      Parameters:
      key - the property name
      defaultValue - default
    • getArray

      public final PArray getArray(String key)
      Get a property as a array or throw exception.
      Specified by:
      getArray in interface PObject
      Parameters:
      key - the property name
    • optArray

      public final PArray optArray(String key, PArray defaultValue)
      Get a property as a array or default.
      Specified by:
      optArray in interface PObject
      Parameters:
      key - the property name
      defaultValue - default