Tabnine Logo
Property.<init>
Code IndexAdd Tabnine to your IDE (free)

How to use
org.springframework.core.convert.Property
constructor

Best Java code snippets using org.springframework.core.convert.Property.<init> (Showing top 20 results out of 315)

origin: spring-projects/spring-framework

@Override
public boolean canWrite(EvaluationContext context, @Nullable Object target, String name) throws AccessException {
  if (!this.allowWrite || target == null) {
    return false;
  }
  Class<?> type = (target instanceof Class ? (Class<?>) target : target.getClass());
  PropertyCacheKey cacheKey = new PropertyCacheKey(type, name, target instanceof Class);
  if (this.writerCache.containsKey(cacheKey)) {
    return true;
  }
  Method method = findSetterForProperty(name, type, target);
  if (method != null) {
    // Treat it like a property
    Property property = new Property(type, null, method);
    TypeDescriptor typeDescriptor = new TypeDescriptor(property);
    this.writerCache.put(cacheKey, method);
    this.typeDescriptorCache.put(cacheKey, typeDescriptor);
    return true;
  }
  else {
    Field field = findField(name, type, target);
    if (field != null) {
      this.writerCache.put(cacheKey, field);
      this.typeDescriptorCache.put(cacheKey, new TypeDescriptor(field));
      return true;
    }
  }
  return false;
}
origin: spring-projects/spring-framework

Property property = new Property(type, method, null);
TypeDescriptor typeDescriptor = new TypeDescriptor(property);
this.readerCache.put(cacheKey, new InvokerPair(method, typeDescriptor));
origin: spring-projects/spring-framework

private Property property(PropertyDescriptor pd) {
  GenericTypeAwarePropertyDescriptor gpd = (GenericTypeAwarePropertyDescriptor) pd;
  return new Property(gpd.getBeanClass(), gpd.getReadMethod(), gpd.getWriteMethod(), gpd.getName());
}
origin: spring-projects/spring-framework

@Test
public void nestedPropertyTypeMapTwoLevels() throws Exception {
  Property property = new Property(getClass(), getClass().getMethod("getTest4"), getClass().getMethod("setTest4", List.class));
  TypeDescriptor t1 = TypeDescriptor.nested(property, 2);
  assertEquals(String.class, t1.getType());
}
origin: spring-projects/spring-framework

@Test
public void testUpCastNotSuper() throws Exception {
  Property property = new Property(getClass(), getClass().getMethod("getProperty"),
      getClass().getMethod("setProperty", Map.class));
  TypeDescriptor typeDescriptor = new TypeDescriptor(property);
  try {
    typeDescriptor.upcast(Collection.class);
    fail("Did not throw");
  }
  catch (IllegalArgumentException ex) {
    assertEquals("interface java.util.Map is not assignable to interface java.util.Collection", ex.getMessage());
  }
}
origin: spring-projects/spring-framework

@Test
public void testUpCast() throws Exception {
  Property property = new Property(getClass(), getClass().getMethod("getProperty"),
      getClass().getMethod("setProperty", Map.class));
  TypeDescriptor typeDescriptor = new TypeDescriptor(property);
  TypeDescriptor upCast = typeDescriptor.upcast(Object.class);
  assertTrue(upCast.getAnnotation(MethodAnnotation1.class) != null);
}
origin: spring-projects/spring-framework

@Test
public void propertyGenericType() throws Exception {
  GenericType<Integer> genericBean = new IntegerType();
  Property property = new Property(getClass(), genericBean.getClass().getMethod("getProperty"),
      genericBean.getClass().getMethod("setProperty", Integer.class));
  TypeDescriptor desc = new TypeDescriptor(property);
  assertEquals(Integer.class, desc.getType());
}
origin: spring-projects/spring-framework

@Test
public void propertyTypeCovariance() throws Exception {
  GenericType<Number> genericBean = new NumberType();
  Property property = new Property(getClass(), genericBean.getClass().getMethod("getProperty"),
      genericBean.getClass().getMethod("setProperty", Number.class));
  TypeDescriptor desc = new TypeDescriptor(property);
  assertEquals(Integer.class, desc.getType());
}
origin: spring-projects/spring-framework

Property property = new Property(type, method, null);
TypeDescriptor typeDescriptor = new TypeDescriptor(property);
invoker = new InvokerPair(method, typeDescriptor);
origin: org.springframework/spring-expression

@Override
public boolean canWrite(EvaluationContext context, @Nullable Object target, String name) throws AccessException {
  if (!this.allowWrite || target == null) {
    return false;
  }
  Class<?> type = (target instanceof Class ? (Class<?>) target : target.getClass());
  PropertyCacheKey cacheKey = new PropertyCacheKey(type, name, target instanceof Class);
  if (this.writerCache.containsKey(cacheKey)) {
    return true;
  }
  Method method = findSetterForProperty(name, type, target);
  if (method != null) {
    // Treat it like a property
    Property property = new Property(type, null, method);
    TypeDescriptor typeDescriptor = new TypeDescriptor(property);
    this.writerCache.put(cacheKey, method);
    this.typeDescriptorCache.put(cacheKey, typeDescriptor);
    return true;
  }
  else {
    Field field = findField(name, type, target);
    if (field != null) {
      this.writerCache.put(cacheKey, field);
      this.typeDescriptorCache.put(cacheKey, new TypeDescriptor(field));
      return true;
    }
  }
  return false;
}
origin: spring-projects/spring-framework

@Test
public void propertyGenericTypeList() throws Exception {
  GenericType<Integer> genericBean = new IntegerType();
  Property property = new Property(getClass(), genericBean.getClass().getMethod("getListProperty"),
      genericBean.getClass().getMethod("setListProperty", List.class));
  TypeDescriptor desc = new TypeDescriptor(property);
  assertEquals(List.class, desc.getType());
  assertEquals(Integer.class, desc.getElementTypeDescriptor().getType());
}
origin: org.springframework/spring-beans

private Property property(PropertyDescriptor pd) {
  GenericTypeAwarePropertyDescriptor gpd = (GenericTypeAwarePropertyDescriptor) pd;
  return new Property(gpd.getBeanClass(), gpd.getReadMethod(), gpd.getWriteMethod(), gpd.getName());
}
origin: org.springframework/spring-expression

Property property = new Property(type, method, null);
TypeDescriptor typeDescriptor = new TypeDescriptor(property);
this.readerCache.put(cacheKey, new InvokerPair(method, typeDescriptor));
origin: spring-projects/spring-framework

@Test
public void propertyComplex() throws Exception {
  Property property = new Property(getClass(), getClass().getMethod("getComplexProperty"),
      getClass().getMethod("setComplexProperty", Map.class));
  TypeDescriptor desc = new TypeDescriptor(property);
  assertEquals(String.class, desc.getMapKeyTypeDescriptor().getType());
  assertEquals(Integer.class, desc.getMapValueTypeDescriptor().getElementTypeDescriptor().getElementTypeDescriptor().getType());
}
origin: spring-projects/spring-framework

@Test
public void propertyGenericClassList() throws Exception {
  IntegerClass genericBean = new IntegerClass();
  Property property = new Property(genericBean.getClass(), genericBean.getClass().getMethod("getListProperty"),
      genericBean.getClass().getMethod("setListProperty", List.class));
  TypeDescriptor desc = new TypeDescriptor(property);
  assertEquals(List.class, desc.getType());
  assertEquals(Integer.class, desc.getElementTypeDescriptor().getType());
  assertNotNull(desc.getAnnotation(MethodAnnotation1.class));
  assertTrue(desc.hasAnnotation(MethodAnnotation1.class));
}
origin: org.springframework/spring-expression

Property property = new Property(type, method, null);
TypeDescriptor typeDescriptor = new TypeDescriptor(property);
invoker = new InvokerPair(method, typeDescriptor);
origin: spring-projects/spring-framework

@Test
public void property() throws Exception {
  Property property = new Property(
      getClass(), getClass().getMethod("getProperty"), getClass().getMethod("setProperty", Map.class));
  TypeDescriptor desc = new TypeDescriptor(property);
  assertEquals(Map.class, desc.getType());
  assertEquals(Integer.class, desc.getMapKeyTypeDescriptor().getElementTypeDescriptor().getType());
  assertEquals(Long.class, desc.getMapValueTypeDescriptor().getElementTypeDescriptor().getType());
  assertNotNull(desc.getAnnotation(MethodAnnotation1.class));
  assertNotNull(desc.getAnnotation(MethodAnnotation2.class));
  assertNotNull(desc.getAnnotation(MethodAnnotation3.class));
}
origin: camunda/camunda-bpm-platform

private Property property(PropertyDescriptor pd) {
  GenericTypeAwarePropertyDescriptor typeAware = (GenericTypeAwarePropertyDescriptor) pd;
  return new Property(typeAware.getBeanClass(), typeAware.getReadMethod(), typeAware.getWriteMethod());
}
origin: philwebb/springfaces

private static Property getProperty(TrackedELContext trackedContext) {
  if (!trackedContext.hasValues()) {
    return null;
  }
  Class<? extends Object> baseClass = trackedContext.getBase().getClass();
  PropertyDescriptor propertyDescriptor = BeanUtils.getPropertyDescriptor(baseClass, trackedContext.getProperty()
      .toString());
  Property property = new Property(baseClass, propertyDescriptor.getReadMethod(),
      propertyDescriptor.getWriteMethod());
  return property;
}
origin: apache/servicemix-bundles

private Property property(PropertyDescriptor pd) {
  GenericTypeAwarePropertyDescriptor gpd = (GenericTypeAwarePropertyDescriptor) pd;
  return new Property(gpd.getBeanClass(), gpd.getReadMethod(), gpd.getWriteMethod(), gpd.getName());
}
org.springframework.core.convertProperty<init>

Popular methods of Property

  • getName
    The name of the property: e.g. 'foo'
  • getObjectType
    The object declaring this property, either directly or in a superclass the object extends.
  • declaringClass
  • getAnnotations
  • getField
  • getMethodParameter
  • getReadMethod
    The property getter method: e.g. getFoo()
  • getType
    The property type: e.g. java.lang.String
  • getWriteMethod
    The property setter method: e.g. setFoo(String)
  • resolveAnnotations
  • resolveMethodParameter
  • resolveName
  • resolveMethodParameter,
  • resolveName,
  • resolveParameterType,
  • resolveReadMethodParameter,
  • resolveWriteMethodParameter,
  • addAnnotationsToMap

Popular in Java

  • Reading from database using SQL prepared statement
  • getOriginalFilename (MultipartFile)
    Return the original filename in the client's filesystem.This may contain path information depending
  • getExternalFilesDir (Context)
  • runOnUiThread (Activity)
  • DateFormat (java.text)
    Formats or parses dates and times.This class provides factories for obtaining instances configured f
  • Stack (java.util)
    Stack is a Last-In/First-Out(LIFO) data structure which represents a stack of objects. It enables u
  • AtomicInteger (java.util.concurrent.atomic)
    An int value that may be updated atomically. See the java.util.concurrent.atomic package specificati
  • DataSource (javax.sql)
    An interface for the creation of Connection objects which represent a connection to a database. This
  • IOUtils (org.apache.commons.io)
    General IO stream manipulation utilities. This class provides static utility methods for input/outpu
  • SAXParseException (org.xml.sax)
    Encapsulate an XML parse error or warning.> This module, both source code and documentation, is in t
  • CodeWhisperer alternatives
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