Class PrimitiveAttribute<VALUE>

    • Field Summary

      Fields 
      Modifier and Type Field Description
      protected VALUE defaultValue
      The default value.
    • Constructor Summary

      Constructors 
      Modifier Constructor Description
      protected PrimitiveAttribute​(java.lang.Class<VALUE> valueClass)
      Constructor.
    • Method Summary

      All Methods Instance Methods Abstract Methods Concrete Methods 
      Modifier and Type Method Description
      protected java.lang.String clientConfigTypeDescription()
      Returns a string that is a technical description of the type.
      VALUE getDefault()  
      java.lang.Object getValue​(Template template, java.lang.String attributeName, PObject requestJsonAttributes)
      Get the attribute value.
      java.lang.Class<VALUE> getValueClass()  
      void printClientConfig​(org.json.JSONWriter json, Template template)
      Write this attribute out the the json writer so that clients can know what attributes are expected.
      void setConfigName​(java.lang.String configName)
      Set the name of the attribute as set in the configuration file.
      abstract void setDefault​(VALUE value)
      A default value for this attribute.
      void validate​(java.util.List<java.lang.Throwable> validationErrors, Configuration configuration)
      validate that the configuration was correct.
      void validateValue​(java.lang.Object value)
      Validation of the value from a request.
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Field Detail

      • defaultValue

        protected VALUE defaultValue
        The default value.
    • Constructor Detail

      • PrimitiveAttribute

        protected PrimitiveAttribute​(java.lang.Class<VALUE> valueClass)
        Constructor.
        Parameters:
        valueClass - the type of the value of this attribute
    • Method Detail

      • getValueClass

        public final java.lang.Class<VALUE> getValueClass()
      • getDefault

        public final VALUE getDefault()
      • setDefault

        public abstract void setDefault​(VALUE value)
        A default value for this attribute.
        Parameters:
        value - The default value.
      • setConfigName

        public final void setConfigName​(java.lang.String configName)
        Description copied from interface: Attribute
        Set the name of the attribute as set in the configuration file.
        Specified by:
        setConfigName in interface Attribute
        Parameters:
        configName - the name of the attribute
      • validate

        public void validate​(java.util.List<java.lang.Throwable> validationErrors,
                             Configuration configuration)
        Description copied from interface: ConfigurationObject
        validate that the configuration was correct.
        Specified by:
        validate in interface ConfigurationObject
        Parameters:
        validationErrors - a list to add any detected errors to.
        configuration - the containing configuration
      • validateValue

        public void validateValue​(java.lang.Object value)
        Validation of the value from a request.
        Parameters:
        value - The value from a request.
      • printClientConfig

        public final void printClientConfig​(org.json.JSONWriter json,
                                            Template template)
                                     throws org.json.JSONException
        Description copied from interface: Attribute
        Write this attribute out the the json writer so that clients can know what attributes are expected.
        Specified by:
        printClientConfig in interface Attribute
        Parameters:
        json - the json writer to write to
        template - the template that this attribute is part of
        Throws:
        org.json.JSONException
      • clientConfigTypeDescription

        protected java.lang.String clientConfigTypeDescription()
        Returns a string that is a technical description of the type. In other words, a string that the client software (user of the capabilities response) can use to create a request or UI.
      • getValue

        public java.lang.Object getValue​(@Nonnull
                                         Template template,
                                         @Nonnull
                                         java.lang.String attributeName,
                                         @Nonnull
                                         PObject requestJsonAttributes)
        Description copied from interface: Attribute
        Get the attribute value.
        Specified by:
        getValue in interface Attribute
        Parameters:
        template - the template of the current request.
        attributeName - the name of the attribute
        requestJsonAttributes - the json data for populating the attribute values
        Returns:
        the value