Interface Parameter

All Known Implementing Classes:
AttributeParameter, CacheParameter, ElementArrayParameter, ElementListParameter, ElementListUnionParameter, ElementMapParameter, ElementMapUnionParameter, ElementParameter, ElementUnionParameter, TemplateParameter, TextParameter

interface Parameter
The Parameter is used to represent a constructor parameter. It contains the XML annotation used on the parameter as well as the name of the parameter and its position index. A parameter is used to validate against the annotated methods and fields and also to determine the deserialized values that should be injected in to the constructor to instantiate it.
  • Method Summary

    Modifier and Type
    Method
    Description
    This is used to acquire the annotation that is used for the parameter.
    This method is used to return an XPath expression that is used to represent the position of this parameter.
    int
    This returns the index position of the parameter in the constructor.
    This is the key used to represent the parameter.
    This is used to acquire the name of the parameter that this represents.
    This is used to acquire the path of the element or attribute represented by this parameter.
    This is used to acquire the annotated type class.
    boolean
    This method is used to determine if the parameter represents an attribute.
    boolean
    This is used to determine if the parameter is primitive.
    boolean
    This is used to determine if the parameter is required.
    boolean
    This is used to determine if the parameter represents text.
    This is used to provide a textual representation of the parameter.
  • Method Details

    • getKey

      Object getKey()
      This is the key used to represent the parameter. The key is used to store the parameter in hash containers. Unlike the path is not necessarily the path for the parameter.
      Returns:
      this is the key used to represent the parameter
    • getType

      Class getType()
      This is used to acquire the annotated type class. The class is the type that is to be deserialized from the XML. This is used to validate against annotated fields and methods.
      Returns:
      this returns the type used for the parameter
    • getIndex

      int getIndex()
      This returns the index position of the parameter in the constructor. This is used to determine the order of values that are to be injected in to the constructor.
      Returns:
      this returns the index for the parameter
    • getAnnotation

      Annotation getAnnotation()
      This is used to acquire the annotation that is used for the parameter. The annotation provided will be an XML annotation such as the Element or Attribute annotation.
      Returns:
      this returns the annotation used on the parameter
    • getExpression

      Expression getExpression()
      This method is used to return an XPath expression that is used to represent the position of this parameter. If there is no XPath expression associated with this then an empty path is returned. This will never return a null expression.
      Returns:
      the XPath expression identifying the location
    • getName

      String getName()
      This is used to acquire the name of the parameter that this represents. The name is determined using annotation and the name attribute of that annotation, if one is provided.
      Returns:
      this returns the name of the annotated parameter
    • getPath

      String getPath()
      This is used to acquire the path of the element or attribute represented by this parameter. The path is determined by acquiring the XPath expression and appending the name of the label to form a fully qualified path.
      Returns:
      returns the path that is used for this parameter
    • isRequired

      boolean isRequired()
      This is used to determine if the parameter is required. If an attribute is not required then it can be null. Which means that we can inject a null value. Also, this means we can match constructors in a more flexible manner.
      Returns:
      this returns true if the parameter is required
    • isPrimitive

      boolean isPrimitive()
      This is used to determine if the parameter is primitive. A primitive parameter must not be null. As there is no way to provide the value to the constructor. A default value is not a good solution as it affects the constructor score.
      Returns:
      this returns true if the parameter is primitive
    • isAttribute

      boolean isAttribute()
      This method is used to determine if the parameter represents an attribute. This is used to style the name so that elements are styled as elements and attributes are styled as required.
      Returns:
      this is used to determine if this is an attribute
    • isText

      boolean isText()
      This is used to determine if the parameter represents text. If this represents text it typically does not have a name, instead the empty string represents the name. Also text parameters can not exist with other text parameters.
      Returns:
      returns true if this parameter represents text
    • toString

      String toString()
      This is used to provide a textual representation of the parameter. Providing a string describing the parameter is useful for debugging and for exception messages.
      Overrides:
      toString in class Object
      Returns:
      this returns the string representation for this