Interface Contact

All Superinterfaces:
Type
All Known Implementing Classes:
AttributeParameter.Contact, ElementArrayParameter.Contact, ElementListParameter.Contact, ElementListUnionParameter.Contact, ElementMapParameter.Contact, ElementMapUnionParameter.Contact, ElementParameter.Contact, ElementUnionParameter.Contact, FieldContact, MethodContact, ParameterContact, TextParameter.Contact

interface Contact extends Type
The Contact interface is used to provide a point of contact with an object. Typically this will be used to get and set to an from a field or a pair of matching bean methods. Each contact must be labeled with an annotation.
See Also:
  • Method Summary

    Modifier and Type
    Method
    Description
    get(Object source)
    This is used to get the value from the specified object using the point of contact.
    This is the annotation associated with the point of contact.
    This is the class that declares the contact.
    This provides the dependent class for the contact.
    This provides the dependent classes for the contact.
    This represents the name of the object contact.
    boolean
    This is used to determine if the annotated contact is for a read only variable.
    void
    set(Object source, Object value)
    This is used to set the value on the specified object through this contact.
    This is used to describe the contact as it exists within the owning class.

    Methods inherited from interface org.simpleframework.xml.strategy.Type

    getAnnotation, getType
  • Method Details

    • getName

      String getName()
      This represents the name of the object contact. If the contact is a field then the name of the field is provided. If however the contact is a method then the Java Bean name of the method is provided, which will be the decapitalized name of the method without the get, set, or is prefix to the method.
      Returns:
      this returns the name of the contact represented
    • getDependent

      Class getDependent()
      This provides the dependent class for the contact. This will typically represent a generic type for the actual type. For contacts that use a Collection type this will be the generic type parameter for that collection.
      Returns:
      this returns the dependent type for the contact
    • getDependents

      Class[] getDependents()
      This provides the dependent classes for the contact. This will typically represent a generic types for the actual type. For contacts that use a Map type this will be the generic type parameter for that map type declaration.
      Returns:
      this returns the dependent types for the contact
    • getDeclaringClass

      Class getDeclaringClass()
      This is the class that declares the contact. The declaring class is where the field or method has been defined. This will typically be a class rather than an interface.
      Returns:
      this returns the class the contact is declared within
    • getAnnotation

      Annotation getAnnotation()
      This is the annotation associated with the point of contact. This will be an XML annotation that describes how the contact should be serialized and deserialized from the object.
      Returns:
      this provides the annotation associated with this
    • set

      void set(Object source, Object value) throws Exception
      This is used to set the value on the specified object through this contact. Depending on the type of contact this will set the value given, typically this will be done by invoking a method or setting the value on the object field.
      Parameters:
      source - this is the object to set the value on
      value - this is the value to be set through the contact
      Throws:
      Exception
    • get

      Object get(Object source) throws Exception
      This is used to get the value from the specified object using the point of contact. Typically the value is retrieved from the specified object by invoking a get method of by acquiring the value from a field within the specified object.
      Parameters:
      source - this is the object to acquire the value from
      Returns:
      this is the value acquired from the point of contact
      Throws:
      Exception
    • isReadOnly

      boolean isReadOnly()
      This is used to determine if the annotated contact is for a read only variable. A read only variable is a field that can be set from within the constructor such as a blank final variable. It can also be a method with no set counterpart.
      Returns:
      this returns true if the contact is a constant one
    • toString

      String toString()
      This is used to describe the contact as it exists within the owning class. This is used to provide error messages that can be used to debug issues that occur when processing a contact.
      Specified by:
      toString in interface Type
      Overrides:
      toString in class Object
      Returns:
      this returns a string representation of the contact