Tabnine Logo
PropertyMatches.getPossibleMatches
Code IndexAdd Tabnine to your IDE (free)

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

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

origin: spring-projects/spring-framework

@Override
protected NotWritablePropertyException createNotWritablePropertyException(String propertyName) {
  PropertyMatches matches = PropertyMatches.forField(propertyName, getRootClass());
  throw new NotWritablePropertyException(
      getRootClass(), getNestedPath() + propertyName,
      matches.buildErrorMessage(), matches.getPossibleMatches());
}
origin: spring-projects/spring-framework

@Override
protected NotWritablePropertyException createNotWritablePropertyException(String propertyName) {
  PropertyMatches matches = PropertyMatches.forProperty(propertyName, getRootClass());
  throw new NotWritablePropertyException(getRootClass(), getNestedPath() + propertyName,
      matches.buildErrorMessage(), matches.getPossibleMatches());
}
origin: spring-projects/spring-framework

@Test
public void severalMatchesFieldProperty() {
  PropertyMatches matches = PropertyMatches.forField("counter", SampleFieldProperties.class);
  assertThat(matches.getPossibleMatches(), hasItemInArray("counter1"));
  assertThat(matches.getPossibleMatches(), hasItemInArray("counter2"));
  assertThat(matches.getPossibleMatches(), hasItemInArray("counter3"));
}
origin: spring-projects/spring-framework

@Test
public void severalMatchesBeanProperty() {
  PropertyMatches matches = PropertyMatches.forProperty("counter", SampleBeanProperties.class);
  assertThat(matches.getPossibleMatches(), hasItemInArray("counter1"));
  assertThat(matches.getPossibleMatches(), hasItemInArray("counter2"));
  assertThat(matches.getPossibleMatches(), hasItemInArray("counter3"));
}
origin: spring-projects/spring-framework

@Test
public void complexFieldPropertyTypo() {
  PropertyMatches matches = PropertyMatches.forField("desriptn", SampleFieldProperties.class);
  assertThat(matches.getPossibleMatches(), emptyArray());
}
origin: spring-projects/spring-framework

@Test
public void simpleBeanPropertyTypo() {
  PropertyMatches matches = PropertyMatches.forProperty("naem", SampleBeanProperties.class);
  assertThat(matches.getPossibleMatches(), hasItemInArray("name"));
}
origin: spring-projects/spring-framework

@Test
public void simpleFieldPropertyTypo() {
  PropertyMatches matches = PropertyMatches.forField("naem", SampleFieldProperties.class);
  assertThat(matches.getPossibleMatches(), hasItemInArray("name"));
}
origin: spring-projects/spring-framework

@Test
public void unknownBeanProperty() {
  PropertyMatches matches = PropertyMatches.forProperty("unknown", SampleBeanProperties.class);
  assertThat(matches.getPossibleMatches(), emptyArray());
}
origin: spring-projects/spring-framework

@Test
public void unknownFieldProperty() {
  PropertyMatches matches = PropertyMatches.forField("unknown", SampleFieldProperties.class);
  assertThat(matches.getPossibleMatches(), emptyArray());
}
origin: org.springframework/spring-beans

@Override
protected NotWritablePropertyException createNotWritablePropertyException(String propertyName) {
  PropertyMatches matches = PropertyMatches.forField(propertyName, getRootClass());
  throw new NotWritablePropertyException(
      getRootClass(), getNestedPath() + propertyName,
      matches.buildErrorMessage(), matches.getPossibleMatches());
}
origin: spring-projects/spring-framework

@Test
public void complexBeanPropertyTypo() {
  PropertyMatches matches = PropertyMatches.forProperty("desriptn", SampleBeanProperties.class);
  assertThat(matches.getPossibleMatches(), emptyArray());
}
origin: org.springframework/spring-beans

@Override
protected NotWritablePropertyException createNotWritablePropertyException(String propertyName) {
  PropertyMatches matches = PropertyMatches.forProperty(propertyName, getRootClass());
  throw new NotWritablePropertyException(getRootClass(), getNestedPath() + propertyName,
      matches.buildErrorMessage(), matches.getPossibleMatches());
}
origin: camunda/camunda-bpm-platform

throw new NotWritablePropertyException(
    getRootClass(), this.nestedPath + propertyName,
    matches.buildErrorMessage(), matches.getPossibleMatches());
origin: apache/servicemix-bundles

  private static Set<String> detectPotentialMatches(String propertyName, Class<?> type) {

    Set<String> result = new HashSet<>();
    result.addAll(Arrays.asList(PropertyMatches.forField(propertyName, type).getPossibleMatches()));
    result.addAll(Arrays.asList(PropertyMatches.forProperty(propertyName, type).getPossibleMatches()));

    return result;
  }
}
origin: apache/servicemix-bundles

  /**
   * Detects all potential matches for the given property name and type.
   *
   * @param propertyName must not be {@literal null} or empty.
   * @param type must not be {@literal null}.
   * @return
   */
  private static Set<String> detectPotentialMatches(String propertyName, Class<?> type) {

    Set<String> result = new HashSet<>();
    result.addAll(Arrays.asList(PropertyMatches.forField(propertyName, type).getPossibleMatches()));
    result.addAll(Arrays.asList(PropertyMatches.forProperty(propertyName, type).getPossibleMatches()));

    return result;
  }
}
origin: apache/servicemix-bundles

@Override
protected NotWritablePropertyException createNotWritablePropertyException(String propertyName) {
  PropertyMatches matches = PropertyMatches.forProperty(propertyName, getRootClass());
  throw new NotWritablePropertyException(getRootClass(), getNestedPath() + propertyName,
      matches.buildErrorMessage(), matches.getPossibleMatches());
}
origin: apache/servicemix-bundles

@Override
protected NotWritablePropertyException createNotWritablePropertyException(String propertyName) {
  PropertyMatches matches = PropertyMatches.forField(propertyName, getRootClass());
  throw new NotWritablePropertyException(
      getRootClass(), getNestedPath() + propertyName,
      matches.buildErrorMessage(), matches.getPossibleMatches());
}
org.springframework.beansPropertyMatchesgetPossibleMatches

Javadoc

Return the calculated possible matches.

Popular methods of PropertyMatches

  • forProperty
    Create PropertyMatches for the given bean property.
  • 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
  • calculateStringDistance
    Calculate the distance between the given two Strings according to the Levenshtein algorithm.

Popular in Java

  • Making http requests using okhttp
  • onRequestPermissionsResult (Fragment)
  • getApplicationContext (Context)
  • setScale (BigDecimal)
  • OutputStream (java.io)
    A writable sink for bytes.Most clients will use output streams that write data to the file system (
  • Proxy (java.net)
    This class represents proxy server settings. A created instance of Proxy stores a type and an addres
  • URI (java.net)
    A Uniform Resource Identifier that identifies an abstract or physical resource, as specified by RFC
  • Stack (java.util)
    Stack is a Last-In/First-Out(LIFO) data structure which represents a stack of objects. It enables u
  • ExecutorService (java.util.concurrent)
    An Executor that provides methods to manage termination and methods that can produce a Future for tr
  • BasicDataSource (org.apache.commons.dbcp)
    Basic implementation of javax.sql.DataSource that is configured via JavaBeans properties. This is no
  • Top plugins for WebStorm
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