Java Code Examples for java.beans.PropertyDescriptor#setValue()
The following examples show how to use
java.beans.PropertyDescriptor#setValue() .
These examples are extracted from open source projects.
You can vote up the ones you like or vote down the ones you don't like,
and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source Project: spring-analysis-note File: PropertyDescriptorUtils.java License: MIT License | 6 votes |
/** * See {@link java.beans.FeatureDescriptor}. */ public static void copyNonMethodProperties(PropertyDescriptor source, PropertyDescriptor target) { target.setExpert(source.isExpert()); target.setHidden(source.isHidden()); target.setPreferred(source.isPreferred()); target.setName(source.getName()); target.setShortDescription(source.getShortDescription()); target.setDisplayName(source.getDisplayName()); // Copy all attributes (emulating behavior of private FeatureDescriptor#addTable) Enumeration<String> keys = source.attributeNames(); while (keys.hasMoreElements()) { String key = keys.nextElement(); target.setValue(key, source.getValue(key)); } // See java.beans.PropertyDescriptor#PropertyDescriptor(PropertyDescriptor) target.setPropertyEditorClass(source.getPropertyEditorClass()); target.setBound(source.isBound()); target.setConstrained(source.isConstrained()); }
Example 2
Source Project: spring4-understanding File: PropertyDescriptorUtils.java License: Apache License 2.0 | 6 votes |
/** * See {@link java.beans.FeatureDescriptor}. */ public static void copyNonMethodProperties(PropertyDescriptor source, PropertyDescriptor target) throws IntrospectionException { target.setExpert(source.isExpert()); target.setHidden(source.isHidden()); target.setPreferred(source.isPreferred()); target.setName(source.getName()); target.setShortDescription(source.getShortDescription()); target.setDisplayName(source.getDisplayName()); // Copy all attributes (emulating behavior of private FeatureDescriptor#addTable) Enumeration<String> keys = source.attributeNames(); while (keys.hasMoreElements()) { String key = keys.nextElement(); target.setValue(key, source.getValue(key)); } // See java.beans.PropertyDescriptor#PropertyDescriptor(PropertyDescriptor) target.setPropertyEditorClass(source.getPropertyEditorClass()); target.setBound(source.isBound()); target.setConstrained(source.isConstrained()); }
Example 3
Source Project: pepper-box File: PlainTextConfigElementBeanInfo.java License: Apache License 2.0 | 6 votes |
/** * Constructor which creates property group and creates UI for PlainTextConfigElement. */ public PlainTextConfigElementBeanInfo() { super(PlainTextConfigElement.class); //Create property group createPropertyGroup("plain_text_load_generator", new String[] { PLACE_HOLDER, JSON_SCHEMA }); PropertyDescriptor placeHolderProps = property(PLACE_HOLDER); placeHolderProps.setValue(NOT_UNDEFINED, Boolean.TRUE); placeHolderProps.setValue(DEFAULT, PropsKeys.MSG_PLACEHOLDER); placeHolderProps.setValue(NOT_EXPRESSION, Boolean.TRUE); //Create inout Text Area PropertyDescriptor p = property(JSON_SCHEMA); p.setPropertyEditorClass(TextAreaEditor.class); p.setValue(NOT_UNDEFINED, Boolean.TRUE); }
Example 4
Source Project: blog_demos File: ExtendedBeanInfo.java License: Apache License 2.0 | 6 votes |
public static void copyNonMethodProperties(PropertyDescriptor source, PropertyDescriptor target) throws IntrospectionException { target.setExpert(source.isExpert()); target.setHidden(source.isHidden()); target.setPreferred(source.isPreferred()); target.setName(source.getName()); target.setShortDescription(source.getShortDescription()); target.setDisplayName(source.getDisplayName()); // Copy all attributes (emulating behavior of private FeatureDescriptor#addTable) Enumeration<String> keys = source.attributeNames(); while (keys.hasMoreElements()) { String key = keys.nextElement(); target.setValue(key, source.getValue(key)); } // See java.beans.PropertyDescriptor#PropertyDescriptor(PropertyDescriptor) target.setPropertyEditorClass(source.getPropertyEditorClass()); target.setBound(source.isBound()); target.setConstrained(source.isConstrained()); }
Example 5
Source Project: dragonwell8_jdk File: Test7193977.java License: GNU General Public License v2.0 | 5 votes |
public AbstractBeanInfo() throws IntrospectionException { super(Abstract.class); for (PropertyDescriptor pd : getPropertyDescriptors()) { if (names.contains(pd.getName())) { pd.setValue("transient", Boolean.TRUE); } } }
Example 6
Source Project: openjdk-8 File: Test4984912.java License: GNU General Public License v2.0 | 5 votes |
public PropertyDescriptor[] getPropertyDescriptors() { try { PropertyDescriptor pdProperty = new PropertyDescriptor("property", SimpleBean.class, "getProperty", "setProperty"); PropertyDescriptor pdNullable = new PropertyDescriptor("nullable", SimpleBean.class, null, null); PropertyDescriptor pdIndexed = new IndexedPropertyDescriptor("indexed", SimpleBean.class, null, null, null, null); pdNullable.setValue("name", "value"); return new PropertyDescriptor[] {pdProperty, pdNullable, pdIndexed}; } catch (IntrospectionException exception) { throw new Error(exception); } }
Example 7
Source Project: TencentKona-8 File: Test7193977.java License: GNU General Public License v2.0 | 5 votes |
public AbstractBeanInfo() throws IntrospectionException { super(Abstract.class); for (PropertyDescriptor pd : getPropertyDescriptors()) { if (names.contains(pd.getName())) { pd.setValue("transient", Boolean.TRUE); } } }
Example 8
Source Project: openjdk-8-source File: Test4984912.java License: GNU General Public License v2.0 | 5 votes |
public PropertyDescriptor[] getPropertyDescriptors() { try { PropertyDescriptor pdProperty = new PropertyDescriptor("property", SimpleBean.class, "getProperty", "setProperty"); PropertyDescriptor pdNullable = new PropertyDescriptor("nullable", SimpleBean.class, null, null); PropertyDescriptor pdIndexed = new IndexedPropertyDescriptor("indexed", SimpleBean.class, null, null, null, null); pdNullable.setValue("name", "value"); return new PropertyDescriptor[] {pdProperty, pdNullable, pdIndexed}; } catch (IntrospectionException exception) { throw new Error(exception); } }
Example 9
Source Project: hottub File: Test7193977.java License: GNU General Public License v2.0 | 5 votes |
public AbstractBeanInfo() throws IntrospectionException { super(Abstract.class); for (PropertyDescriptor pd : getPropertyDescriptors()) { if (names.contains(pd.getName())) { pd.setValue("transient", Boolean.TRUE); } } }
Example 10
Source Project: jdk8u60 File: Test7193977.java License: GNU General Public License v2.0 | 5 votes |
public AbstractBeanInfo() throws IntrospectionException { super(Abstract.class); for (PropertyDescriptor pd : getPropertyDescriptors()) { if (names.contains(pd.getName())) { pd.setValue("transient", Boolean.TRUE); } } }
Example 11
Source Project: jdk8u60 File: Test4984912.java License: GNU General Public License v2.0 | 5 votes |
public PropertyDescriptor[] getPropertyDescriptors() { try { PropertyDescriptor pdProperty = new PropertyDescriptor("property", SimpleBean.class, "getProperty", "setProperty"); PropertyDescriptor pdNullable = new PropertyDescriptor("nullable", SimpleBean.class, null, null); PropertyDescriptor pdIndexed = new IndexedPropertyDescriptor("indexed", SimpleBean.class, null, null, null, null); pdNullable.setValue("name", "value"); return new PropertyDescriptor[] {pdProperty, pdNullable, pdIndexed}; } catch (IntrospectionException exception) { throw new Error(exception); } }
Example 12
Source Project: openjdk-jdk8u File: Test7193977.java License: GNU General Public License v2.0 | 5 votes |
public AbstractBeanInfo() throws IntrospectionException { super(Abstract.class); for (PropertyDescriptor pd : getPropertyDescriptors()) { if (names.contains(pd.getName())) { pd.setValue("transient", Boolean.TRUE); } } }
Example 13
Source Project: pepper-box File: SerializedConfigElementBeanInfo.java License: Apache License 2.0 | 5 votes |
/** * Constructor which creates property group and creates UI for SerializedConfigElement. */ public SerializedConfigElementBeanInfo() { super(SerializedConfigElement.class); //Create Property group createPropertyGroup("serialized_load_generator", new String[] { PLACE_HOLDER, CLASS_NAME, OBJ_PROPERTIES }); PropertyDescriptor placeHolderProps = property(PLACE_HOLDER); placeHolderProps.setValue(NOT_UNDEFINED, Boolean.TRUE); placeHolderProps.setValue(DEFAULT, PropsKeys.MSG_PLACEHOLDER); placeHolderProps.setValue(NOT_EXPRESSION, Boolean.TRUE); //Create table editor component of jmeter for class field and expression mapping TypeEditor tableEditor = TypeEditor.TableEditor; PropertyDescriptor tableProperties = property(OBJ_PROPERTIES, tableEditor); tableProperties.setValue(TableEditor.CLASSNAME, FieldExpressionMapping.class.getName()); tableProperties.setValue(TableEditor.HEADERS, new String[]{ "Field Name", "Field Expression" } ); tableProperties.setValue(TableEditor.OBJECT_PROPERTIES, new String[]{ FieldExpressionMapping.FIELD_NAME, FieldExpressionMapping.FIELD_EXPRESSION } ); tableProperties.setValue(DEFAULT, new ArrayList<>()); tableProperties.setValue(NOT_UNDEFINED, Boolean.TRUE); //Create class name input textfield PropertyDescriptor classNameProps = property(CLASS_NAME); classNameProps.setPropertyEditorClass(ClassPropertyEditor.class); classNameProps.setValue(NOT_UNDEFINED, Boolean.TRUE); classNameProps.setValue(DEFAULT, "<POJO class name>"); }
Example 14
Source Project: jdk8u_jdk File: Test4984912.java License: GNU General Public License v2.0 | 5 votes |
public PropertyDescriptor[] getPropertyDescriptors() { try { PropertyDescriptor pdProperty = new PropertyDescriptor("property", SimpleBean.class, "getProperty", "setProperty"); PropertyDescriptor pdNullable = new PropertyDescriptor("nullable", SimpleBean.class, null, null); PropertyDescriptor pdIndexed = new IndexedPropertyDescriptor("indexed", SimpleBean.class, null, null, null, null); pdNullable.setValue("name", "value"); return new PropertyDescriptor[] {pdProperty, pdNullable, pdIndexed}; } catch (IntrospectionException exception) { throw new Error(exception); } }
Example 15
Source Project: openjdk-jdk9 File: Test4984912.java License: GNU General Public License v2.0 | 5 votes |
public PropertyDescriptor[] getPropertyDescriptors() { try { PropertyDescriptor pdProperty = new PropertyDescriptor("property", SimpleBean.class, "getProperty", "setProperty"); PropertyDescriptor pdNullable = new PropertyDescriptor("nullable", SimpleBean.class, null, null); PropertyDescriptor pdIndexed = new IndexedPropertyDescriptor("indexed", SimpleBean.class, null, null, null, null); pdNullable.setValue("name", "value"); return new PropertyDescriptor[] {pdProperty, pdNullable, pdIndexed}; } catch (IntrospectionException exception) { throw new Error(exception); } }
Example 16
Source Project: jdk8u-jdk File: Test4984912.java License: GNU General Public License v2.0 | 5 votes |
public PropertyDescriptor[] getPropertyDescriptors() { try { PropertyDescriptor pdProperty = new PropertyDescriptor("property", SimpleBean.class, "getProperty", "setProperty"); PropertyDescriptor pdNullable = new PropertyDescriptor("nullable", SimpleBean.class, null, null); PropertyDescriptor pdIndexed = new IndexedPropertyDescriptor("indexed", SimpleBean.class, null, null, null, null); pdNullable.setValue("name", "value"); return new PropertyDescriptor[] {pdProperty, pdNullable, pdIndexed}; } catch (IntrospectionException exception) { throw new Error(exception); } }
Example 17
Source Project: jdk8u-jdk File: Test4984912.java License: GNU General Public License v2.0 | 5 votes |
public PropertyDescriptor[] getPropertyDescriptors() { try { PropertyDescriptor pdProperty = new PropertyDescriptor("property", SimpleBean.class, "getProperty", "setProperty"); PropertyDescriptor pdNullable = new PropertyDescriptor("nullable", SimpleBean.class, null, null); PropertyDescriptor pdIndexed = new IndexedPropertyDescriptor("indexed", SimpleBean.class, null, null, null, null); pdNullable.setValue("name", "value"); return new PropertyDescriptor[] {pdProperty, pdNullable, pdIndexed}; } catch (IntrospectionException exception) { throw new Error(exception); } }
Example 18
Source Project: jmeter-cassandra File: CassandraConnectionBeanInfo.java License: Apache License 2.0 | 4 votes |
public CassandraConnectionBeanInfo() { super(CassandraConnection.class); createPropertyGroup("varName", new String[] { "sessionName" }); createPropertyGroup("cluster", new String[] { "contactPoints", "keyspace", "username", "password" }); createPropertyGroup("loadbalancergroup", new String[] { "loadBalancer", "localDataCenter" }); PropertyDescriptor p = property("contactPoints"); p.setValue(NOT_UNDEFINED, Boolean.TRUE); p.setValue(DEFAULT, ""); p = property("sessionName"); p.setValue(NOT_UNDEFINED, Boolean.TRUE); p.setValue(DEFAULT, ""); p = property("keyspace"); p.setValue(NOT_UNDEFINED, Boolean.TRUE); p.setValue(DEFAULT, ""); p = property("username"); p.setValue(NOT_UNDEFINED, Boolean.TRUE); p.setValue(DEFAULT, ""); p = property("password", TypeEditor.PasswordEditor); p.setValue(NOT_UNDEFINED, Boolean.TRUE); p.setValue(DEFAULT, ""); p = property("loadBalancer"); // $NON-NLS-1$ p.setValue(NOT_UNDEFINED, Boolean.TRUE); p.setValue(DEFAULT, CassandraConnection.DEFAULTLOADBALANCER); p.setValue(NOT_OTHER,Boolean.TRUE); p.setValue(TAGS,new String[]{ CassandraConnection.ROUND_ROBIN, CassandraConnection.DC_AWARE_ROUND_ROBIN, CassandraConnection.DC_TOKEN_AWARE, CassandraConnection.WHITELIST, CassandraConnection.DEFAULTLOADBALANCER }); p = property("localDataCenter"); p.setValue(NOT_UNDEFINED, Boolean.TRUE); p.setValue(DEFAULT, ""); }
Example 19
Source Project: jmeter-cassandra File: CassandraTestElementBeanInfoSupport.java License: Apache License 2.0 | 4 votes |
/** * */ public CassandraTestElementBeanInfoSupport(Class<? extends TestBean> beanClass) { super(beanClass); createPropertyGroup("varName", // $NON-NLS-1$ new String[]{"sessionName" }); // $NON-NLS-1$ createPropertyGroup("cql", // $NON-NLS-1$ new String[] { "queryType", // $NON-NLS-1$ "query", // $NON-NLS-1$ "queryArguments", // $NON-NLS-1$ "variableNames", // $NON-NLS-1$ "resultVariable", // $NON-NLS-1$ "consistencyLevel", // $NON-NLS-1$ "batchSize" // $NON-NLS-1$ }); PropertyDescriptor p = property("sessionName"); // $NON-NLS-1$ p.setValue(NOT_UNDEFINED, Boolean.TRUE); p.setValue(DEFAULT, ""); // $NON-NLS-1$ p = property("queryArguments"); // $NON-NLS-1$ p.setValue(NOT_UNDEFINED, Boolean.TRUE); p.setValue(DEFAULT, ""); // $NON-NLS-1$ p = property("variableNames"); // $NON-NLS-1$ p.setValue(NOT_UNDEFINED, Boolean.TRUE); p.setValue(DEFAULT, ""); // $NON-NLS-1$ p = property("resultVariable"); // $NON-NLS-1$ p.setValue(NOT_UNDEFINED, Boolean.TRUE); p.setValue(DEFAULT, ""); // $NON-NLS-1$ p = property("batchSize"); // $NON-NLS-1$ p.setValue(NOT_UNDEFINED, Boolean.TRUE); p.setValue(DEFAULT, ""); p = property("queryType"); // $NON-NLS-1$ p.setValue(NOT_UNDEFINED, Boolean.TRUE); p.setValue(DEFAULT, AbstractCassandaTestElement.SIMPLE); p.setValue(NOT_OTHER,Boolean.TRUE); p.setValue(TAGS,new String[]{ AbstractCassandaTestElement.SIMPLE, AbstractCassandaTestElement.PREPARED, AbstractCassandaTestElement.DYNAMIC_BATCH }); p = property("consistencyLevel"); // $NON-NLS-1$ p.setValue(NOT_UNDEFINED, Boolean.TRUE); p.setValue(DEFAULT, "ONE"); p.setValue(NOT_OTHER,Boolean.TRUE); p.setValue(TAGS,new String[]{ AbstractCassandaTestElement.ANY, AbstractCassandaTestElement.ONE, AbstractCassandaTestElement.QUORUM, AbstractCassandaTestElement.TWO, AbstractCassandaTestElement.THREE, AbstractCassandaTestElement.ALL, AbstractCassandaTestElement.LOCAL_ONE, AbstractCassandaTestElement.LOCAL_QUORUM, AbstractCassandaTestElement.EACH_QUORUM }); p = property("query", TypeEditor.TextAreaEditor); // $NON-NLS-1$ p.setValue(NOT_UNDEFINED, Boolean.TRUE); p.setValue(DEFAULT, ""); // $NON-NLS-1$ p.setValue(TEXT_LANGUAGE, "sql"); // $NON-NLS-1$ }
Example 20
Source Project: openjdk-jdk9 File: TestBeanInfoPriority.java License: GNU General Public License v2.0 | 4 votes |
@Override public PropertyDescriptor[] getPropertyDescriptors() { PropertyDescriptor[] p = new PropertyDescriptor[2]; try { // value PropertyDescriptor pdValue = new PropertyDescriptor( "value", TestClass.class, "getValue", "setValue"); pdValue.setBound(true); pdValue.setConstrained(true); pdValue.setExpert(true); pdValue.setHidden(true); pdValue.setPreferred(true); pdValue.setValue("required", true); pdValue.setValue("visualUpdate", true); pdValue.setShortDescription("user-defined-value"); pdValue.setValue("enumerationValues", new Object[]{ "EAST", 3, "javax.swing.SwingConstants.EAST", "WEST", 7, "javax.swing.SwingConstants.WEST"}); p[iValue] = pdValue; // other PropertyDescriptor pdOther = new PropertyDescriptor( "other", TestClass.class, "getOther", "setOther"); pdOther.setBound(false); pdOther.setConstrained(false); pdOther.setExpert(false); pdOther.setHidden(false); pdOther.setPreferred(false); pdOther.setValue("required", false); pdOther.setValue("visualUpdate", false); pdOther.setShortDescription("user-defined-other"); pdOther.setValue("enumerationValues", new Object[]{ "TOP", 1, "javax.swing.SwingConstants.TOP"}); p[iOther] = pdOther; } catch(IntrospectionException e) { e.printStackTrace(); } return p; }