Class PrefixedName


  • public final class PrefixedName
    extends Object
    Java name handler for avoiding naming conflicts with EO-reserved words.

    This class is used to represent any Java class or method name and provides encoding/decoding functionality to avoid naming conflicts with EO-reserved words. Names are prefixed with "j$" to distinguish them from EO keywords.

    You can read more about the problem here

    Since:
    0.1.0
    • Constructor Detail

      • PrefixedName

        public PrefixedName​(String origin)
        Constructor.
        Parameters:
        origin - The original name.
      • PrefixedName

        public PrefixedName​(String prefix,
                            String origin)
        Constructor.
        Parameters:
        prefix - Prefix to be used for encoding and decoding
        origin - The original name.
      • PrefixedName

        public PrefixedName​(String prefix,
                            String origin,
                            Pattern delimited,
                            Pattern prefixed)
        Constructor.
        Parameters:
        prefix - Prefix to be used for encoding and decoding
        origin - The original name
        delimited - Pattern to find positions for prefixing
        prefixed - Pattern to find existing prefixes for removal
        Suppressed Checkstyle violations:
        ParameterNumberCheck (5 lines)
    • Method Detail

      • encode

        public String encode()
        Encode name.
        Returns:
        Encoded name.
      • decode

        public String decode()
        Decode name.
        Returns:
        Decoded name.