本文整理匯總了Java中java.beans.PropertyDescriptor.setValue方法的典型用法代碼示例。如果您正苦於以下問題:Java PropertyDescriptor.setValue方法的具體用法?Java PropertyDescriptor.setValue怎麽用?Java PropertyDescriptor.setValue使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類java.beans.PropertyDescriptor
的用法示例。
在下文中一共展示了PropertyDescriptor.setValue方法的15個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。
示例1: NotifyObserversSamplerBeanInfo
import java.beans.PropertyDescriptor; //導入方法依賴的package包/類
public NotifyObserversSamplerBeanInfo() {
super(NotifyObserversSampler.class);
createPropertyGroup("Sensor",
new String[]{"objectId", "instanceId", "resourceId"});
PropertyDescriptor p = property("objectId");
p.setValue(NOT_UNDEFINED, Boolean.TRUE);
p.setValue(DEFAULT, Integer.valueOf(3303));
p = property("instanceId");
p.setValue(NOT_UNDEFINED, Boolean.TRUE);
p.setValue(DEFAULT, Integer.valueOf(0));
p = property("resourceId");
p.setValue(NOT_UNDEFINED, Boolean.TRUE);
p.setValue(DEFAULT, Integer.valueOf(5700));
}
示例2: CryptoWSSecurityPostProcessorBeanInfo
import java.beans.PropertyDescriptor; //導入方法依賴的package包/類
public CryptoWSSecurityPostProcessorBeanInfo(Class<? extends CryptoWSSecurityPostProcessor> clazz) {
super(clazz);
createPropertyGroup("Certificate", new String[]{
"keystoreFile", "keystorePassword", "certPassword"
});
PropertyDescriptor p;
p = property("keystoreFile");
p.setPropertyEditorClass(FileEditor.class);
p.setValue(NOT_UNDEFINED, Boolean.TRUE);
p.setValue(DEFAULT, "");
p = property("keystorePassword");
p.setPropertyEditorClass(PasswordEditor.class);
p.setValue(NOT_UNDEFINED, Boolean.TRUE);
p.setValue(DEFAULT, "");
p = property("certPassword");
p.setPropertyEditorClass(PasswordEditor.class);
p.setValue(NOT_UNDEFINED, Boolean.TRUE);
p.setValue(DEFAULT, "");
}
示例3: PlainTextConfigElementBeanInfo
import java.beans.PropertyDescriptor; //導入方法依賴的package包/類
/**
* 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);
}
示例4: getPropertyDescriptor
import java.beans.PropertyDescriptor; //導入方法依賴的package包/類
protected PropertyDescriptor getPropertyDescriptor(String name) throws IntrospectionException {
checkAdditionalProperties();
for (int i = 0 ; i < properties.length ; i++) {
PropertyDescriptor property = properties[i];
if (name.equals(property.getName())) {
PropertyDescriptor clone = new PropertyDescriptor(name, property.getReadMethod(), property.getWriteMethod());
clone.setDisplayName(property.getDisplayName());
clone.setShortDescription(property.getShortDescription());
clone.setPropertyEditorClass(property.getPropertyEditorClass());
clone.setBound(property.isBound());
clone.setConstrained(property.isConstrained());
clone.setExpert(property.isExpert());
clone.setHidden(property.isHidden());
clone.setPreferred(property.isPreferred());
for (String attributeName : Collections.list(property.attributeNames())) {
clone.setValue(attributeName, property.getValue(attributeName));
}
return properties[i] = clone;
}
}
return null;
}
示例5: copyNonMethodProperties
import java.beans.PropertyDescriptor; //導入方法依賴的package包/類
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());
}
示例6: LwM2mManagerBeanInfo
import java.beans.PropertyDescriptor; //導入方法依賴的package包/類
public LwM2mManagerBeanInfo() {
super(LwM2mManager.class);
createPropertyGroup("ConnectionInfo",
new String[]{"serverURI", "registrationPath", "registrationDuration", "registerAtStart", "derregisterAtStop"});
PropertyDescriptor p = property("serverURI");
p.setValue(NOT_UNDEFINED, Boolean.TRUE);
p.setValue(DEFAULT, "coap://localhost:5683");
p = property("registrationPath");
p.setValue(NOT_UNDEFINED, Boolean.TRUE);
p.setValue(DEFAULT, "rd");
p = property("registrationDuration");
p.setValue(NOT_UNDEFINED, Boolean.TRUE);
p.setValue(DEFAULT, Long.valueOf(86400));
p = property("registerAtStart");
p.setValue(NOT_UNDEFINED, Boolean.TRUE);
p.setValue(DEFAULT, Boolean.TRUE);
p = property("derregisterAtStop");
p.setValue(NOT_UNDEFINED, Boolean.TRUE);
p.setValue(DEFAULT, Boolean.TRUE);
createPropertyGroup("Device",
new String[]{"resources"});
p = property("resources");
p.setValue(NOT_UNDEFINED, Boolean.TRUE);
p.setValue(DEFAULT, "/3303/0/5700, /3303/0/5604");
}
示例7: WSSEncryptionPreProcessorBeanInfo
import java.beans.PropertyDescriptor; //導入方法依賴的package包/類
public WSSEncryptionPreProcessorBeanInfo() {
super(WSSEncryptionPreProcessor.class);
createPropertyGroup("Encryption", new String[]{
"keyIdentifier", "symmetricEncryptionAlgorithm", "keyEncryptionAlgorithm", "createEncryptedKey",
PARTSTOSECURE // this property is created in the parent class but added here so it is rendered at the bottom
});
PropertyDescriptor p;
p = property("keyIdentifier");
p.setValue(NOT_UNDEFINED, Boolean.TRUE);
p.setValue(DEFAULT, WSSEncryptionPreProcessor.keyIdentifiers[0]);
p.setValue(NOT_OTHER, Boolean.TRUE);
p.setValue(TAGS, WSSEncryptionPreProcessor.keyIdentifiers);
p = property("symmetricEncryptionAlgorithm");
p.setValue(NOT_UNDEFINED, Boolean.TRUE);
p.setValue(DEFAULT, WSSEncryptionPreProcessor.symmetricEncryptionAlgorithms[0]);
p.setValue(NOT_OTHER, Boolean.TRUE);
p.setValue(TAGS, WSSEncryptionPreProcessor.symmetricEncryptionAlgorithms);
p = property("keyEncryptionAlgorithm");
p.setValue(NOT_UNDEFINED, Boolean.TRUE);
p.setValue(DEFAULT, WSSEncryptionPreProcessor.keyEncryptionAlgorithms[0]);
p.setValue(NOT_OTHER, Boolean.TRUE);
p.setValue(TAGS, WSSEncryptionPreProcessor.keyEncryptionAlgorithms);
p = property("createEncryptedKey");
p.setValue(NOT_UNDEFINED, Boolean.TRUE);
p.setValue(DEFAULT, Boolean.TRUE);
}
示例8: WSSSignaturePreProcessorBeanInfo
import java.beans.PropertyDescriptor; //導入方法依賴的package包/類
public WSSSignaturePreProcessorBeanInfo() {
super(WSSSignaturePreProcessor.class);
createPropertyGroup("Signature", new String[]{
"keyIdentifier", "signatureAlgorithm", "signatureCanonicalization", "digestAlgorithm", "useSingleCertificate",
PARTSTOSECURE // this property is created in the parent class but added here so it is rendered at the bottom
});
PropertyDescriptor p;
p = property("keyIdentifier");
p.setValue(NOT_UNDEFINED, Boolean.TRUE);
p.setValue(DEFAULT, WSSSignaturePreProcessor.keyIdentifiers[0]);
p.setValue(NOT_OTHER, Boolean.TRUE);
p.setValue(TAGS, WSSSignaturePreProcessor.keyIdentifiers);
p = property("signatureAlgorithm");
p.setValue(NOT_UNDEFINED, Boolean.TRUE);
p.setValue(DEFAULT, WSSSignaturePreProcessor.signatureAlgorithms[0]);
p.setValue(NOT_OTHER, Boolean.TRUE);
p.setValue(TAGS, WSSSignaturePreProcessor.signatureAlgorithms);
p = property("signatureCanonicalization");
p.setValue(NOT_UNDEFINED, Boolean.TRUE);
p.setValue(DEFAULT, WSSSignaturePreProcessor.signatureCanonicalizations[0]);
p.setValue(NOT_OTHER, Boolean.TRUE);
p.setValue(TAGS, WSSSignaturePreProcessor.signatureCanonicalizations);
p = property("digestAlgorithm");
p.setValue(NOT_UNDEFINED, Boolean.TRUE);
p.setValue(DEFAULT, WSSSignaturePreProcessor.digestAlgorithms[0]);
p.setValue(NOT_OTHER, Boolean.TRUE);
p.setValue(TAGS, WSSSignaturePreProcessor.digestAlgorithms);
p = property("useSingleCertificate");
p.setValue(NOT_UNDEFINED, Boolean.TRUE);
p.setValue(DEFAULT, Boolean.FALSE);
}
示例9: WSSTimestampPreProcessorBeanInfo
import java.beans.PropertyDescriptor; //導入方法依賴的package包/類
public WSSTimestampPreProcessorBeanInfo() {
super(WSSTimestampPreProcessor.class);
createPropertyGroup("Timestamp", new String[]{
"timeToLive"
});
PropertyDescriptor p;
p = property("timeToLive");
p.setValue(NOT_UNDEFINED, Boolean.TRUE);
p.setValue(DEFAULT, 300);
}
示例10: WSSUsernameTokenPreProcessorBeanInfo
import java.beans.PropertyDescriptor; //導入方法依賴的package包/類
public WSSUsernameTokenPreProcessorBeanInfo() {
super(WSSUsernameTokenPreProcessor.class);
createPropertyGroup("UsernameToken", new String[]{
"username", "password", "passwordType", "addNonce", "addCreated", "precisionInMilliSeconds"
});
PropertyDescriptor p;
p = property("username");
p.setValue(NOT_UNDEFINED, Boolean.TRUE);
p.setValue(DEFAULT, "");
p = property("password");
p.setPropertyEditorClass(PasswordEditor.class);
p.setValue(NOT_UNDEFINED, Boolean.TRUE);
p.setValue(DEFAULT, "");
p = property("passwordType");
p.setValue(NOT_UNDEFINED, Boolean.TRUE);
p.setValue(DEFAULT, WSSUsernameTokenPreProcessor.passwordTypes[0]);
p.setValue(NOT_OTHER, Boolean.TRUE);
p.setValue(TAGS, WSSUsernameTokenPreProcessor.passwordTypes);
p = property("addNonce");
p.setValue(NOT_UNDEFINED, Boolean.TRUE);
p.setValue(DEFAULT, Boolean.TRUE);
p = property("addCreated");
p.setValue(NOT_UNDEFINED, Boolean.TRUE);
p.setValue(DEFAULT, Boolean.TRUE);
p = property("precisionInMilliSeconds");
p.setValue(NOT_UNDEFINED, Boolean.TRUE);
p.setValue(DEFAULT, Boolean.TRUE);
}
示例11: CryptoWSSecurityPreProcessorBeanInfo
import java.beans.PropertyDescriptor; //導入方法依賴的package包/類
public CryptoWSSecurityPreProcessorBeanInfo(Class<? extends CryptoWSSecurityPreProcessor> clazz) {
super(clazz);
createPropertyGroup("Certificate", new String[]{
"keystoreFile", "keystorePassword", "certAlias", "certPassword"
});
PropertyDescriptor p;
p = property("keystoreFile");
p.setPropertyEditorClass(FileEditor.class);
p.setValue(NOT_UNDEFINED, Boolean.TRUE);
p.setValue(DEFAULT, "");
p = property("keystorePassword");
p.setPropertyEditorClass(PasswordEditor.class);
p.setValue(NOT_UNDEFINED, Boolean.TRUE);
p.setValue(DEFAULT, "");
p = property("certAlias");
p.setValue(NOT_UNDEFINED, Boolean.TRUE);
p.setValue(DEFAULT, "");
p = property("certPassword");
p.setPropertyEditorClass(PasswordEditor.class);
p.setValue(NOT_UNDEFINED, Boolean.TRUE);
p.setValue(DEFAULT, "");
p = property(PARTSTOSECURE); // this is expected to be added to a property group by subclasses
p.setPropertyEditorClass(TableEditor.class);
p.setValue(TableEditor.CLASSNAME, SecurityPart.class.getName());
p.setValue(TableEditor.HEADERS, new String[]{"Name", "Namespace", "Encode"});
p.setValue(TableEditor.OBJECT_PROPERTIES, new String[]{"name", "namespace", "modifier"});
}
示例12: SerializedConfigElementBeanInfo
import java.beans.PropertyDescriptor; //導入方法依賴的package包/類
/**
* 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>");
}
示例13: AbstractBeanInfo
import java.beans.PropertyDescriptor; //導入方法依賴的package包/類
public AbstractBeanInfo() throws IntrospectionException {
super(Abstract.class);
for (PropertyDescriptor pd : getPropertyDescriptors()) {
if (names.contains(pd.getName())) {
pd.setValue("transient", Boolean.TRUE);
}
}
}
示例14: getPropertyDescriptors
import java.beans.PropertyDescriptor; //導入方法依賴的package包/類
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);
}
}
示例15: getPropertyDescriptors
import java.beans.PropertyDescriptor; //導入方法依賴的package包/類
@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;
}