Class SimpleClassNameDiscriminatorStrategy

  • All Implemented Interfaces:
    DiscriminatorStrategy

    public class SimpleClassNameDiscriminatorStrategy
    extends Object
    implements DiscriminatorStrategy
    A DiscriminatorStrategy that utilizes the simple (unqualified) class name.

    This strategy provides options for stripping a prefix and/or suffix from the simple class name and for de-capitalizing the (stripped) name (according to the unusual rules of Introspector.decapitalize(String).

    In oder for this strategy to successfully recover the Class object for a subtype from the simple names produced by toDiscriminator(Class, Class), the subtype classes must be in the same package as the base type and loaded by the same class loader as the base type.

    Author:
    Carl Harris
    • Constructor Detail

      • SimpleClassNameDiscriminatorStrategy

        public SimpleClassNameDiscriminatorStrategy()
    • Method Detail

      • getName

        public String getName()
        Gets the name property.
        Returns:
        property value
      • setName

        public void setName​(String name)
        Sets the name property.
        Parameters:
        name - the property value to set
      • getPrefix

        public String getPrefix()
        Gets the prefix property.
        Returns:
        property value
      • setPrefix

        public void setPrefix​(String prefix)
        Sets the prefix property.
        Parameters:
        prefix - the property value to set
      • getSuffix

        public String getSuffix()
        Gets the suffix property.
        Returns:
        property value
      • setSuffix

        public void setSuffix​(String suffix)
        Sets the suffix property.
        Parameters:
        suffix - the property value to set
      • isDecapitalize

        public boolean isDecapitalize()
        Gets the decapitalize property.
        Returns:
        property value
      • setDecapitalize

        public void setDecapitalize​(boolean decapitalize)
        Sets the decapitalize property.
        Parameters:
        decapitalize - the property value to set