Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
Re: [ptp-dev] Getting default value for StringAttribute

Dave,

What do you want the default value for? You can get the default value by creating a string attribute with no initial value, then getting the value of the attribute. We could provide a getDefaultValue() convenience method if you're going to be doing this a lot.

Given an attribute definition, you'd do something like this:

StringAttribute attr = JobAttributes.getQueueIdAttributeDefinition ().create();
String defValue = attr.getValue();

If you already have an attribute, the you'd do something like:

String defValue = attr.getDefinition().create().getValue();

Let me know if you'd us to add getDefaultValue() and will put it in.

Greg

On Jun 7, 2007, at 9:12 AM, Dave Wootton wrote:

Randy
I may not be understanding what we talked about at the workshop regarding StringAttribute default values, but I don't see any way to get a default
value from a StringAttribute or StringAttributeDefinition. I see where
StringAttributeDefinition contains a default value, but I don't see a
method to return the default value. For my purposes, the only attributes I
care about are StringAttributes, although I may want to use
IntegerAttributes as well.

Am I missing something?

Dave
_______________________________________________
ptp-dev mailing list
ptp-dev@xxxxxxxxxxx
https://dev.eclipse.org/mailman/listinfo/ptp-dev



Back to the top