Class ArrayMatcher

java.lang.Object
org.simpleframework.xml.transform.ArrayMatcher
All Implemented Interfaces:
Matcher

class ArrayMatcher extends Object implements Matcher
The ArrayMatcher object performs matching of array types to array transforms. This uses the array component type to determine the transform to be used. All array transforms created by this will be ArrayTransform object instances. These will use a type transform for the array component to add values to the individual array indexes. Also such transforms are typically treated as a comma separated list of individual values.
See Also:
  • Field Summary

    Fields
    Modifier and Type
    Field
    Description
    private final Matcher
    This is the primary matcher that can resolve transforms.
  • Constructor Summary

    Constructors
    Constructor
    Description
    Constructor for the ArrayTransform object.
  • Method Summary

    Modifier and Type
    Method
    Description
    match(Class type)
    This is used to match a Transform based on the array component type of an object to be transformed.
    private Transform
    This is used to match a Transform based on the array component type of an object to be transformed.

    Methods inherited from class java.lang.Object

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

    • primary

      private final Matcher primary
      This is the primary matcher that can resolve transforms.
  • Constructor Details

    • ArrayMatcher

      public ArrayMatcher(Matcher primary)
      Constructor for the ArrayTransform object. This is used to match array types to their respective transform using the ArrayTransform object. This will use a comma separated list of tokens to populate the array.
      Parameters:
      primary - this is the primary matcher to be used
  • Method Details

    • match

      public Transform match(Class type) throws Exception
      This is used to match a Transform based on the array component type of an object to be transformed. This will attempt to match the transform using the fully qualified class name of the array component type. If a transform can not be found then this method will throw an exception.
      Specified by:
      match in interface Matcher
      Parameters:
      type - this is the array to find the transform for
      Returns:
      returns a transform for processing the type given
      Throws:
      Exception - thrown if a transform can not be matched
    • matchArray

      private Transform matchArray(Class entry) throws Exception
      This is used to match a Transform based on the array component type of an object to be transformed. This will attempt to match the transform using the fully qualified class name of the array component type. If a transform can not be found then this method will throw an exception.
      Parameters:
      entry - this is the array component type to be matched
      Throws:
      Exception - thrown if a transform can not be matched