Class IdentifierUtilImpl

    • Method Summary

      All Methods Static Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      java.lang.String appendNames​(java.lang.String rule, java.lang.String name1, java.lang.String name2)
      Append the names together while maintaining delimiters.
      java.lang.String appendNames​(IdentifierRule rule, java.lang.String name1, java.lang.String name2)
      Append the names together while maintaining delimiters.
      boolean canSplit​(java.lang.String rule, java.lang.String name)
      Determines whether a name can be split into multiple components.
      boolean canSplit​(java.lang.String rule, java.lang.String name, java.lang.String delim)
      Determines whether a name can be split into multiple components, taking into account the specified delimiter.
      boolean canSplit​(IdentifierRule rule, java.lang.String name)
      Determines whether a name can be split into multiple components.
      boolean canSplit​(IdentifierRule rule, java.lang.String name, java.lang.String delim)
      Determines whether a name can be split into multiple components, taking into account the specified delimiter.
      java.lang.String combineFull​(IdentifierConfiguration config, java.lang.String rule, java.lang.String fullName)  
      java.lang.String combineNames​(java.lang.String rule, java.lang.String[] names)
      Combines names using the specified delimiting rule and appropriate separators
      java.lang.String combineNames​(java.lang.String rule, java.lang.String[] rules, java.lang.String[] names)
      Combines names using delimiting rules and appropriate separators
      java.lang.String combineNames​(java.lang.String rule, java.lang.String name1, java.lang.String name2)
      Combines two names using delimiting rules and appropriate separators
      java.lang.String combineNames​(IdentifierConfiguration config, java.lang.String rule, java.lang.String[] names)  
      java.lang.String combineNames​(IdentifierConfiguration config, IdentifierRule namingRule, java.lang.String[] names)  
      java.lang.String combineNames​(IdentifierConfiguration config, IdentifierRule rule, java.lang.String name1, java.lang.String name2)  
      java.lang.String combineNames​(IdentifierConfiguration config, IdentifierRule rule, IdentifierRule[] rules, java.lang.String[] names)  
      java.lang.String combineNames​(IdentifierRule rule, java.lang.String[] names)
      Combines names using the specified delimiting rule and appropriate separators
      java.lang.String combineNames​(IdentifierRule rule, java.lang.String name1, java.lang.String name2)
      Combines two names using delimiting rules and appropriate separators
      java.lang.String combineNames​(IdentifierRule rule, IdentifierRule[] rules, java.lang.String[] names)
      Combines names using delimiting rules and appropriate separators
      java.lang.String convert​(IdentifierConfiguration config, java.lang.String rule, java.lang.String name)
      Convert the string using this naming configuration to the supplied naming configuration.
      java.lang.String convertFull​(IdentifierConfiguration config, java.lang.String rule, java.lang.String fullName)
      Converts a qualified string-based name defined using the base configuration to the specified configuration.
      java.lang.String delimit​(java.lang.String rule, java.lang.String name)
      Delimit the name if it requires delimiters
      java.lang.String delimit​(java.lang.String rule, java.lang.String name, boolean force)
      Delimit the string with the option to force delimiting.
      java.lang.String delimit​(IdentifierConfiguration config, IdentifierRule rule, java.lang.String name)  
      java.lang.String delimit​(IdentifierConfiguration config, IdentifierRule rule, java.lang.String name, boolean force)  
      java.lang.String delimit​(IdentifierRule rule, java.lang.String name)
      Delimit the name if it requires delimiters
      java.lang.String delimit​(IdentifierRule rule, java.lang.String name, boolean force)
      Delimit the string with the option to force delimiting.
      void endConfiguration()
      Invoked upon completion of bean property configuration for this object.
      IdentifierConfiguration getIdentifierConfiguration()
      Get the naming configuration.
      boolean isDelimited​(java.lang.String rule, java.lang.String name)
      Determines whether a name is delimited.
      boolean isDelimited​(IdentifierConfiguration config, IdentifierRule rule, java.lang.String name)  
      boolean isDelimited​(IdentifierRule rule, java.lang.String name)
      Determines whether a name is delimited.
      static boolean isDoubleQuoted​(java.lang.String name)
      Returns whether a name is double quoted
      boolean isReservedWord​(java.lang.String rule, java.lang.String name)
      Returns whether a name is considered a reserved word
      boolean isReservedWord​(IdentifierRule rule, java.lang.String name)
      Returns whether a name is considered a reserved word.
      java.lang.String joinNames​(java.lang.String[] rules, java.lang.String[] names)
      Joins several names with different naming rules into a single string using appropriate delimiters and separators
      java.lang.String joinNames​(java.lang.String rule, java.lang.String[] names)
      Joins several names with different naming rules into a single string using appropriate delimiters and separators
      java.lang.String joinNames​(java.lang.String rule, java.lang.String[] names, java.lang.String delimiter)
      Joins several names with different naming rules into a single string using the specified delimiter
      java.lang.String joinNames​(IdentifierConfiguration config, IdentifierRule rule, java.lang.String[] names, java.lang.String delimiter)
      Join names using a single naming rule and specified delimiter
      java.lang.String joinNames​(IdentifierRule[] rules, java.lang.String[] names)
      Joins multiple names together using the standard delimiting rules ex. ( {"s", "t", "c"} --> "s"."
      java.lang.String joinNames​(IdentifierRule rule, java.lang.String[] names)
      Joins several names with different naming rules into a single string using appropriate delimiters and separators
      java.lang.String joinNames​(IdentifierRule rule, java.lang.String[] names, java.lang.String delimiter)
      Joins several names with different naming rules into a single string using the specified delimiter
      protected boolean needsConversion​(IdentifierConfiguration config)  
      java.lang.String removeDelimiters​(java.lang.String rule, java.lang.String name)
      Remove delimiters from a delimited name
      java.lang.String removeDelimiters​(IdentifierConfiguration config, java.lang.String rule, java.lang.String name)
      Remove delimiters from a delimited name
      java.lang.String removeDelimiters​(IdentifierConfiguration config, IdentifierRule rule, java.lang.String name)  
      protected java.lang.String removeDelimiters​(IdentifierConfiguration config, IdentifierRule rule, java.lang.String name, java.lang.String leading, java.lang.String trailing)  
      java.lang.String removeDelimiters​(IdentifierRule rule, java.lang.String name)
      Remove delimiters from a delimited name
      java.lang.String removeHungarianNotation​(java.lang.String rule, java.lang.String name)
      Removes Hungarian notation from the specified string.
      java.lang.String removeHungarianNotation​(IdentifierRule rule, java.lang.String name)
      Removes Hungarian notation from the specified string.
      boolean requiresDelimiters​(java.lang.String rule, java.lang.String name)
      Determines whether a name requires delimiters based upon: The SQL-92 Reference definition of a valid unquoted name The naming rule specified
      boolean requiresDelimiters​(IdentifierConfiguration config, IdentifierRule rule, java.lang.String name)  
      boolean requiresDelimiters​(IdentifierRule rule, java.lang.String name)
      Determines whether a name requires delimiters based upon: The SQL-92 Reference definition of a valid unquoted name The naming rule specified
      void setConfiguration​(Configuration conf)
      Invoked prior to setting bean properties.
      void setIdentifierConfiguration​(IdentifierConfiguration config)
      Set the naming configuration to use for naming operations.
      java.lang.String[] splitName​(java.lang.String rule, java.lang.String name)
      Splits a combined name name using the provided naming rule
      java.lang.String[] splitName​(java.lang.String nrule, java.lang.String name, java.lang.String nameDelim)
      Splits a combined name name using the provided naming rule and delimiter.
      java.lang.String[] splitName​(IdentifierConfiguration config, java.lang.String rule, java.lang.String name)  
      java.lang.String[] splitName​(IdentifierConfiguration config, IdentifierRule nrule, java.lang.String name)  
      java.lang.String[] splitName​(IdentifierRule nrule, java.lang.String name)
      Splits a combined name name using the provided naming rule
      java.lang.String[] splitName​(IdentifierRule nrule, java.lang.String name, java.lang.String nameDelim)
      Splits names using single naming rule and appropriate separators
      void startConfiguration()
      Invoked before bean property configuration is begun on this object.
      java.lang.String truncateName​(java.lang.String rule, java.lang.String name, int length)
      Truncates a name while maintaining delimiters.
      java.lang.String truncateName​(IdentifierRule namingRule, java.lang.String name, int length)
      Truncates a name while maintaining delimiters.
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Constructor Detail

      • IdentifierUtilImpl

        public IdentifierUtilImpl()
    • Method Detail

      • combineNames

        public java.lang.String combineNames​(java.lang.String rule,
                                             java.lang.String name1,
                                             java.lang.String name2)
        Description copied from interface: IdentifierUtil
        Combines two names using delimiting rules and appropriate separators
        Specified by:
        combineNames in interface IdentifierUtil
      • combineNames

        public java.lang.String combineNames​(java.lang.String rule,
                                             java.lang.String[] names)
        Description copied from interface: IdentifierUtil
        Combines names using the specified delimiting rule and appropriate separators
        Specified by:
        combineNames in interface IdentifierUtil
        Returns:
        a combined name ex. {"TH IS", THAT} -> "TH IS_THAT"
      • combineNames

        public java.lang.String combineNames​(IdentifierConfiguration config,
                                             java.lang.String rule,
                                             java.lang.String[] names)
      • combineNames

        public java.lang.String combineNames​(IdentifierRule rule,
                                             IdentifierRule[] rules,
                                             java.lang.String[] names)
        Description copied from interface: IdentifierUtil
        Combines names using delimiting rules and appropriate separators
        Specified by:
        combineNames in interface IdentifierUtil
        Returns:
        a combined name ex. {"TH IS", THAT} -> "TH IS_THAT"
      • appendNames

        public java.lang.String appendNames​(IdentifierRule rule,
                                            java.lang.String name1,
                                            java.lang.String name2)
        Description copied from interface: IdentifierUtil
        Append the names together while maintaining delimiters.
        Specified by:
        appendNames in interface IdentifierUtil
      • joinNames

        public java.lang.String joinNames​(IdentifierRule[] rules,
                                          java.lang.String[] names)
        Joins multiple names together using the standard delimiting rules ex. ( {"s", "t", "c"} --> "s"."t"."c" }
        Specified by:
        joinNames in interface IdentifierUtil
      • joinNames

        public java.lang.String joinNames​(java.lang.String rule,
                                          java.lang.String[] names)
        Description copied from interface: IdentifierUtil
        Joins several names with different naming rules into a single string using appropriate delimiters and separators
        Specified by:
        joinNames in interface IdentifierUtil
      • joinNames

        public java.lang.String joinNames​(IdentifierRule rule,
                                          java.lang.String[] names)
        Description copied from interface: IdentifierUtil
        Joins several names with different naming rules into a single string using appropriate delimiters and separators
        Specified by:
        joinNames in interface IdentifierUtil
      • joinNames

        public java.lang.String joinNames​(IdentifierRule rule,
                                          java.lang.String[] names,
                                          java.lang.String delimiter)
        Description copied from interface: IdentifierUtil
        Joins several names with different naming rules into a single string using the specified delimiter
        Specified by:
        joinNames in interface IdentifierUtil
      • joinNames

        public java.lang.String joinNames​(java.lang.String rule,
                                          java.lang.String[] names,
                                          java.lang.String delimiter)
        Description copied from interface: IdentifierUtil
        Joins several names with different naming rules into a single string using the specified delimiter
        Specified by:
        joinNames in interface IdentifierUtil
      • joinNames

        public java.lang.String joinNames​(IdentifierConfiguration config,
                                          IdentifierRule rule,
                                          java.lang.String[] names,
                                          java.lang.String delimiter)
        Join names using a single naming rule and specified delimiter
        Parameters:
        rule -
        names -
      • splitName

        public java.lang.String[] splitName​(IdentifierRule nrule,
                                            java.lang.String name)
        Description copied from interface: IdentifierUtil
        Splits a combined name name using the provided naming rule
        Specified by:
        splitName in interface IdentifierUtil
        name - the multi-value name
        Returns:
        individual components of the name ex. schema.table --> { schema, table }
      • splitName

        public java.lang.String[] splitName​(IdentifierRule nrule,
                                            java.lang.String name,
                                            java.lang.String nameDelim)
        Splits names using single naming rule and appropriate separators
        Specified by:
        splitName in interface IdentifierUtil
        Parameters:
        name - the multi-value name
        Returns:
        individual components of the name ex. schema.table --> { schema, table }
      • isDoubleQuoted

        public static boolean isDoubleQuoted​(java.lang.String name)
        Returns whether a name is double quoted
      • delimit

        public java.lang.String delimit​(IdentifierRule rule,
                                        java.lang.String name)
        Description copied from interface: IdentifierUtil
        Delimit the name if it requires delimiters
        Specified by:
        delimit in interface IdentifierUtil
        Parameters:
        rule - the rule to use for delimiting
        name - the name to delimit
        Returns:
        the delimited name, if delimiting was necessary.
      • delimit

        public java.lang.String delimit​(IdentifierRule rule,
                                        java.lang.String name,
                                        boolean force)
        Description copied from interface: IdentifierUtil
        Delimit the string with the option to force delimiting. If force is true, the name will delimited without checking to see if it requires delimiters.
        Specified by:
        delimit in interface IdentifierUtil
        Parameters:
        rule - the rule to use for delimiting
        name - the name to delimit
        force - add delimiters even if delimiting is not required
        Returns:
        the delimited name, if delimiting was necessary.
      • isDelimited

        public boolean isDelimited​(IdentifierRule rule,
                                   java.lang.String name)
        Description copied from interface: IdentifierUtil
        Determines whether a name is delimited.
        Specified by:
        isDelimited in interface IdentifierUtil
        Parameters:
        rule - the rule to use for removing delimiters
        name - the name to examine for delimiters
      • removeDelimiters

        public java.lang.String removeDelimiters​(IdentifierConfiguration config,
                                                 java.lang.String rule,
                                                 java.lang.String name)
        Description copied from interface: IdentifierUtil
        Remove delimiters from a delimited name
        Specified by:
        removeDelimiters in interface IdentifierUtil
        rule - the rule to use for removing delimiters
        name - the name from which to remove delimiters
      • removeDelimiters

        public java.lang.String removeDelimiters​(IdentifierRule rule,
                                                 java.lang.String name)
        Description copied from interface: IdentifierUtil
        Remove delimiters from a delimited name
        Specified by:
        removeDelimiters in interface IdentifierUtil
        Parameters:
        rule - the rule to use for removing delimiters
        name - the name from which to remove delimiters
      • requiresDelimiters

        public boolean requiresDelimiters​(IdentifierRule rule,
                                          java.lang.String name)
        Description copied from interface: IdentifierUtil
        Determines whether a name requires delimiters based upon:
        • The SQL-92 Reference definition of a valid unquoted name
        • The naming rule specified
        Specified by:
        requiresDelimiters in interface IdentifierUtil
        Parameters:
        rule - the rule to use for removing delimiters
        name - the name to examine for delimiting requirements
      • isReservedWord

        public boolean isReservedWord​(IdentifierRule rule,
                                      java.lang.String name)
        Returns whether a name is considered a reserved word.
        Specified by:
        isReservedWord in interface IdentifierUtil
      • isReservedWord

        public boolean isReservedWord​(java.lang.String rule,
                                      java.lang.String name)
        Description copied from interface: IdentifierUtil
        Returns whether a name is considered a reserved word
        Specified by:
        isReservedWord in interface IdentifierUtil
      • removeDelimiters

        protected java.lang.String removeDelimiters​(IdentifierConfiguration config,
                                                    IdentifierRule rule,
                                                    java.lang.String name,
                                                    java.lang.String leading,
                                                    java.lang.String trailing)
      • combineNames

        public java.lang.String combineNames​(java.lang.String rule,
                                             java.lang.String[] rules,
                                             java.lang.String[] names)
        Description copied from interface: IdentifierUtil
        Combines names using delimiting rules and appropriate separators
        Specified by:
        combineNames in interface IdentifierUtil
        Returns:
        a combined name ex. {"TH IS", THAT} -> "TH IS_THAT"
      • truncateName

        public java.lang.String truncateName​(java.lang.String rule,
                                             java.lang.String name,
                                             int length)
        Description copied from interface: IdentifierUtil
        Truncates a name while maintaining delimiters.
        Specified by:
        truncateName in interface IdentifierUtil
      • truncateName

        public java.lang.String truncateName​(IdentifierRule namingRule,
                                             java.lang.String name,
                                             int length)
        Description copied from interface: IdentifierUtil
        Truncates a name while maintaining delimiters.
        Specified by:
        truncateName in interface IdentifierUtil
      • delimit

        public java.lang.String delimit​(java.lang.String rule,
                                        java.lang.String name)
        Description copied from interface: IdentifierUtil
        Delimit the name if it requires delimiters
        Specified by:
        delimit in interface IdentifierUtil
        Parameters:
        rule - the rule to use for delimiting
        name - the name to delimit
        Returns:
        the delimited name, if delimiting was necessary.
      • delimit

        public java.lang.String delimit​(java.lang.String rule,
                                        java.lang.String name,
                                        boolean force)
        Description copied from interface: IdentifierUtil
        Delimit the string with the option to force delimiting. If force is true, the name will delimited without checking to see if it requires delimiters.
        Specified by:
        delimit in interface IdentifierUtil
        Parameters:
        rule - the rule to use for delimiting
        name - the name to delimit
        force - add delimiters even if delimiting is not required
        Returns:
        the delimited name, if delimiting was necessary.
      • isDelimited

        public boolean isDelimited​(java.lang.String rule,
                                   java.lang.String name)
        Description copied from interface: IdentifierUtil
        Determines whether a name is delimited.
        Specified by:
        isDelimited in interface IdentifierUtil
        Parameters:
        rule - the rule to use for removing delimiters
        name - the name to examine for delimiters
      • removeDelimiters

        public java.lang.String removeDelimiters​(java.lang.String rule,
                                                 java.lang.String name)
        Description copied from interface: IdentifierUtil
        Remove delimiters from a delimited name
        Specified by:
        removeDelimiters in interface IdentifierUtil
        Parameters:
        rule - the rule to use for removing delimiters
        name - the name from which to remove delimiters
      • requiresDelimiters

        public boolean requiresDelimiters​(java.lang.String rule,
                                          java.lang.String name)
        Description copied from interface: IdentifierUtil
        Determines whether a name requires delimiters based upon:
        • The SQL-92 Reference definition of a valid unquoted name
        • The naming rule specified
        Specified by:
        requiresDelimiters in interface IdentifierUtil
        Parameters:
        rule - the rule to use for removing delimiters
        name - the name to examine for delimiting requirements
      • splitName

        public java.lang.String[] splitName​(IdentifierConfiguration config,
                                            java.lang.String rule,
                                            java.lang.String name)
      • splitName

        public java.lang.String[] splitName​(java.lang.String rule,
                                            java.lang.String name)
        Description copied from interface: IdentifierUtil
        Splits a combined name name using the provided naming rule
        Specified by:
        splitName in interface IdentifierUtil
        name - the multi-value name
        Returns:
        individual components of the name ex. schema.table --> { schema, table }
      • joinNames

        public java.lang.String joinNames​(java.lang.String[] rules,
                                          java.lang.String[] names)
        Description copied from interface: IdentifierUtil
        Joins several names with different naming rules into a single string using appropriate delimiters and separators
        Specified by:
        joinNames in interface IdentifierUtil
      • appendNames

        public java.lang.String appendNames​(java.lang.String rule,
                                            java.lang.String name1,
                                            java.lang.String name2)
        Description copied from interface: IdentifierUtil
        Append the names together while maintaining delimiters.
        Specified by:
        appendNames in interface IdentifierUtil
      • removeHungarianNotation

        public java.lang.String removeHungarianNotation​(java.lang.String rule,
                                                        java.lang.String name)
        Description copied from interface: IdentifierUtil
        Removes Hungarian notation from the specified string.
        Specified by:
        removeHungarianNotation in interface IdentifierUtil
      • splitName

        public java.lang.String[] splitName​(java.lang.String nrule,
                                            java.lang.String name,
                                            java.lang.String nameDelim)
        Description copied from interface: IdentifierUtil
        Splits a combined name name using the provided naming rule and delimiter.
        Specified by:
        splitName in interface IdentifierUtil
        name - the multi-value name
        Returns:
        individual components of the name ex. schema.table --> { schema, table }
      • convert

        public java.lang.String convert​(IdentifierConfiguration config,
                                        java.lang.String rule,
                                        java.lang.String name)
        Description copied from interface: IdentifierUtil
        Convert the string using this naming configuration to the supplied naming configuration.
        Specified by:
        convert in interface IdentifierUtil
      • convertFull

        public java.lang.String convertFull​(IdentifierConfiguration config,
                                            java.lang.String rule,
                                            java.lang.String fullName)
        Description copied from interface: IdentifierUtil
        Converts a qualified string-based name defined using the base configuration to the specified configuration. Returns the converted name.
        Specified by:
        convertFull in interface IdentifierUtil
      • combineFull

        public java.lang.String combineFull​(IdentifierConfiguration config,
                                            java.lang.String rule,
                                            java.lang.String fullName)
      • endConfiguration

        public void endConfiguration()
        Description copied from interface: Configurable
        Invoked upon completion of bean property configuration for this object.
        Specified by:
        endConfiguration in interface Configurable
      • startConfiguration

        public void startConfiguration()
        Description copied from interface: Configurable
        Invoked before bean property configuration is begun on this object.
        Specified by:
        startConfiguration in interface Configurable
      • canSplit

        public boolean canSplit​(java.lang.String rule,
                                java.lang.String name)
        Description copied from interface: IdentifierUtil
        Determines whether a name can be split into multiple components.
        Specified by:
        canSplit in interface IdentifierUtil
      • canSplit

        public boolean canSplit​(IdentifierRule rule,
                                java.lang.String name)
        Description copied from interface: IdentifierUtil
        Determines whether a name can be split into multiple components.
        Specified by:
        canSplit in interface IdentifierUtil
      • canSplit

        public boolean canSplit​(java.lang.String rule,
                                java.lang.String name,
                                java.lang.String delim)
        Description copied from interface: IdentifierUtil
        Determines whether a name can be split into multiple components, taking into account the specified delimiter.
        Specified by:
        canSplit in interface IdentifierUtil
      • canSplit

        public boolean canSplit​(IdentifierRule rule,
                                java.lang.String name,
                                java.lang.String delim)
        Description copied from interface: IdentifierUtil
        Determines whether a name can be split into multiple components, taking into account the specified delimiter.
        Specified by:
        canSplit in interface IdentifierUtil
      • combineNames

        public java.lang.String combineNames​(IdentifierRule rule,
                                             java.lang.String[] names)
        Description copied from interface: IdentifierUtil
        Combines names using the specified delimiting rule and appropriate separators
        Specified by:
        combineNames in interface IdentifierUtil
        Returns:
        a combined name ex. {"TH IS", THAT} -> "TH IS_THAT"
      • combineNames

        public java.lang.String combineNames​(IdentifierRule rule,
                                             java.lang.String name1,
                                             java.lang.String name2)
        Description copied from interface: IdentifierUtil
        Combines two names using delimiting rules and appropriate separators
        Specified by:
        combineNames in interface IdentifierUtil