congrats Icon
New! Announcing Tabnine Chat Beta
Learn More
Tabnine Logo
PropertyMatches.calculateStringDistance
Code IndexAdd Tabnine to your IDE (free)

How to use
calculateStringDistance
method
in
org.springframework.beans.PropertyMatches

Best Java code snippets using org.springframework.beans.PropertyMatches.calculateStringDistance (Showing top 1 results out of 315)

origin: camunda/camunda-bpm-platform

/**
 * Generate possible property alternatives for the given property and
 * class. Internally uses the <code>getStringDistance</code> method, which
 * in turn uses the Levenshtein algorithm to determine the distance between
 * two Strings.
 * @param propertyDescriptors the JavaBeans property descriptors to search
 * @param maxDistance the maximum distance to accept
 */
private String[] calculateMatches(PropertyDescriptor[] propertyDescriptors, int maxDistance) {
  List<String> candidates = new ArrayList<String>();
  for (PropertyDescriptor pd : propertyDescriptors) {
    if (pd.getWriteMethod() != null) {
      String possibleAlternative = pd.getName();
      if (calculateStringDistance(this.propertyName, possibleAlternative) <= maxDistance) {
        candidates.add(possibleAlternative);
      }
    }
  }
  Collections.sort(candidates);
  return StringUtils.toStringArray(candidates);
}
org.springframework.beansPropertyMatchescalculateStringDistance

Javadoc

Calculate the distance between the given two Strings according to the Levenshtein algorithm.

Popular methods of PropertyMatches

  • forProperty
    Create PropertyMatches for the given bean property.
  • getPossibleMatches
    Return the calculated possible matches.
  • buildErrorMessage
    Build an error message for the given invalid property name, indicating the possible property matches
  • forField
    Create PropertyMatches for the given field property.
  • <init>
    Create a new PropertyMatches instance for the given property and possible matches.
  • calculateMatches
    Generate possible property alternatives for the given property and class. Internally uses the getStr

Popular in Java

  • Reading from database using SQL prepared statement
  • putExtra (Intent)
  • onCreateOptionsMenu (Activity)
  • requestLocationUpdates (LocationManager)
  • Charset (java.nio.charset)
    A charset is a named mapping between Unicode characters and byte sequences. Every Charset can decode
  • Permission (java.security)
    Legacy security code; do not use.
  • PriorityQueue (java.util)
    A PriorityQueue holds elements on a priority heap, which orders the elements according to their natu
  • JarFile (java.util.jar)
    JarFile is used to read jar entries and their associated data from jar files.
  • Cipher (javax.crypto)
    This class provides access to implementations of cryptographic ciphers for encryption and decryption
  • JFrame (javax.swing)
  • Top Vim plugins
Tabnine Logo
  • Products

    Search for Java codeSearch for JavaScript code
  • IDE Plugins

    IntelliJ IDEAWebStormVisual StudioAndroid StudioEclipseVisual Studio CodePyCharmSublime TextPhpStormVimGoLandRubyMineEmacsJupyter NotebookJupyter LabRiderDataGripAppCode
  • Company

    About UsContact UsCareers
  • Resources

    FAQBlogTabnine AcademyTerms of usePrivacy policyJava Code IndexJavascript Code Index
Get Tabnine for your IDE now