existingPd.setWriteMethod(method);
protected void defaultUpdateDescriptor(PropertyDescriptor pd) { // make non-editable try { pd.setWriteMethod(null); } catch (IntrospectionException e) { // TODO Auto-generated catch block e.printStackTrace(); } if(HIDDEN_PROPS.contains(pd.getName())) { pd.setHidden(true); } } }
if (method != null) { try { desc.setWriteMethod(method); } catch (final IntrospectionException e) {
if (method != null) { try { desc.setWriteMethod(method); } catch (final IntrospectionException e) {
existingPd.setWriteMethod(method);
existingPropDescriptor.setWriteMethod(superPropDescriptor.getWriteMethod());
/** * Performs introspection. This method scans the current class's methods for * property write methods which have not been discovered by default * introspection. * * @param icontext the introspection context * @throws IntrospectionException if an error occurs */ public void introspect(final IntrospectionContext icontext) throws IntrospectionException { for (final Method m : icontext.getTargetClass().getMethods()) { if (m.getName().startsWith(getWriteMethodPrefix())) { final String propertyName = propertyName(m); final PropertyDescriptor pd = icontext .getPropertyDescriptor(propertyName); try { if (pd == null) { icontext.addPropertyDescriptor(createFluentPropertyDescritor( m, propertyName)); } else if (pd.getWriteMethod() == null) { pd.setWriteMethod(m); } } catch (final IntrospectionException e) { log.info("Error when creating PropertyDescriptor for " + m + "! Ignoring this property."); log.debug("Exception is:", e); } } } }
@Override public void introspect(IntrospectionContext icontext) throws IntrospectionException { for (Method m : icontext.getTargetClass().getMethods()) { if (m.getName().startsWith(getWriteMethodPrefix())) { String propertyName = propertyName(m); PropertyDescriptor pd = icontext.getPropertyDescriptor(propertyName); if (isIgnored(icontext.getTargetClass().getName(), m.getName())) { logger.trace(m.getName() + " Ignored for " + icontext.getTargetClass().getName()); continue; } try { if (pd == null) { icontext.addPropertyDescriptor(createFluentPropertyDescritor(m, propertyName)); } else if (pd.getWriteMethod() == null) { pd.setWriteMethod(m); } } catch (IntrospectionException e) { logger.debug(e.getMessage(), e); } } } }
/** * Performs introspection. This method scans the current class's methods for * property write methods which have not been discovered by default * introspection. * * @param icontext the introspection context * @throws IntrospectionException if an error occurs */ public void introspect(final IntrospectionContext icontext) throws IntrospectionException { for (final Method m : icontext.getTargetClass().getMethods()) { if (m.getName().startsWith(getWriteMethodPrefix())) { final String propertyName = propertyName(m); final PropertyDescriptor pd = icontext .getPropertyDescriptor(propertyName); try { if (pd == null) { icontext.addPropertyDescriptor(createFluentPropertyDescritor( m, propertyName)); } else if (pd.getWriteMethod() == null) { pd.setWriteMethod(m); } } catch (final IntrospectionException e) { log.info("Error when creating PropertyDescriptor for " + m + "! Ignoring this property."); log.debug("Exception is:", e); } } } }
} catch (IntrospectionException ex) { existingPD.setWriteMethod(null); existingPD.setReadMethod(readMethod); && !(existingPD instanceof IndexedPropertyDescriptor && !writeMethod.getParameterTypes()[0].isArray())) { existingPD.setWriteMethod(writeMethod); pd.setReadMethod(readMethod); try { pd.setWriteMethod(writeMethod); } catch (IntrospectionException ex) { logger.debug(format("Could not add write method [%s] for property [%s]. Reason: %s",
public synchronized void setWriteMethod(Method writeMethod) throws IntrospectionException { this.writeMethod = writeMethod; if( propertyDescriptor!=null ){ propertyDescriptor.setWriteMethod(writeMethod); } } //</editor-fold>
@Override public synchronized void setWriteMethod(Method writeMethod) throws IntrospectionException { if (this.property != null) { this.property.setWriteMethod(writeMethod); } }
public void setWriteMethod( Method setter ) throws IntrospectionException { super.setWriteMethod( setter ); if( _propertyClass == null ) { _propertyClass = super.getPropertyType(); } }
public void setWriteMethod( Method setter ) throws IntrospectionException { super.setWriteMethod( setter ); if( _propertyClass == null ) { _propertyClass = super.getPropertyType(); } }
public BeanInfo[] getAdditionalBeanInfo() {//GEN-FIRST:Superclass Class superclass = org.tentackle.swing.AbstractFormField.class.getSuperclass(); BeanInfo sbi = null; try { sbi = Introspector.getBeanInfo(superclass);//GEN-HEADEREND:Superclass /** * set the text attribute to readOnly! * Otherwise the gui builders set the nerving name via setText! */ for (PropertyDescriptor pd: sbi.getPropertyDescriptors()) { if (pd.getName().equals("text")) { pd.setWriteMethod(null); break; } } } catch(IntrospectionException ex) { } return new BeanInfo[] { sbi }; }//GEN-LAST:Superclass
protected void defaultUpdateDescriptor(PropertyDescriptor pd) { // make non-editable try { pd.setWriteMethod(null); } catch (IntrospectionException e) { // TODO Auto-generated catch block e.printStackTrace(); } if(HIDDEN_PROPS.contains(pd.getName())) { pd.setHidden(true); } } }
private void addPropertyIfScalaGetterMethod(Class forClass, List<PropertyDescriptor> descriptors, Method method) throws IntrospectionException { if (!isScalaGetterMethod(method)) return; PropertyDescriptor propertyDescriptor = new PropertyDescriptor(method.getName(), forClass, method.getName(), null); // found a getter, looking for the setter now try { Method setterMethod = findScalaSetterMethod(forClass, method); propertyDescriptor.setWriteMethod(setterMethod); } catch (NoSuchMethodException e) { // ignore } // check if the same property was already discovered with java bean accessors addScalaPropertyIfNoJavaBeansProperty(descriptors, propertyDescriptor, method); }
@Override public void introspect(IntrospectionContext icontext) throws IntrospectionException { for (Method m : icontext.getTargetClass().getMethods()) { if (m.getName().startsWith(getWriteMethodPrefix())) { String propertyName = propertyName(m); PropertyDescriptor pd = icontext.getPropertyDescriptor(propertyName); if (isIgnored(icontext.getTargetClass().getName(), m.getName())) { logger.trace(m.getName() + " Ignored for " + icontext.getTargetClass().getName()); continue; } try { if (pd == null) { icontext.addPropertyDescriptor(createFluentPropertyDescritor(m, propertyName)); } else if (pd.getWriteMethod() == null) { pd.setWriteMethod(m); } } catch (IntrospectionException e) { logger.debug(e.getMessage(), e); } } } }
@Override public void introspect(IntrospectionContext icontext) throws IntrospectionException { for (Method m : icontext.getTargetClass().getMethods()) { if (m.getName().startsWith(getWriteMethodPrefix())) { String propertyName = propertyName(m); PropertyDescriptor pd = icontext.getPropertyDescriptor(propertyName); if (isIgnored(icontext.getTargetClass().getName(), m.getName())) { logger.trace(m.getName() + " Ignored for " + icontext.getTargetClass().getName()); continue; } try { if (pd == null) { icontext.addPropertyDescriptor(createFluentPropertyDescritor(m, propertyName)); } else if (pd.getWriteMethod() == null) { pd.setWriteMethod(m); } } catch (IntrospectionException e) { logger.debug(e.getMessage(), e); } } } }
@Override public void introspect(IntrospectionContext icontext) throws IntrospectionException { for (Method m : icontext.getTargetClass().getMethods()) { if (m.getName().startsWith(getWriteMethodPrefix())) { String propertyName = propertyName(m); PropertyDescriptor pd = icontext.getPropertyDescriptor(propertyName); if (isIgnored(icontext.getTargetClass().getName(), m.getName())) { logger.trace(m.getName() + " Ignored for " + icontext.getTargetClass().getName()); continue; } try { if (pd == null) { icontext.addPropertyDescriptor(createFluentPropertyDescritor(m, propertyName)); } else if (pd.getWriteMethod() == null) { pd.setWriteMethod(m); } } catch (IntrospectionException e) { logger.debug(e.getMessage(), e); } } } }