Class BasePropertySet
java.lang.Object
com.oracle.webservices.api.message.BasePropertySet
- All Implemented Interfaces:
PropertySet
- Direct Known Subclasses:
AdditionalResponses,AddressingPropertySet,BaseDistributedPropertySet,InboundAccepted,OutboundDelivered,PropertySet,ThrowableContainerPropertySet,TransactionPropertySet,WsaPropertyBag,WSDLProperties,WSHTTPConnection,XMLPropertyBag
A set of "properties" that can be accessed via strongly-typed fields
as well as reflexibly through the property name.
- Author:
- Kohsuke Kawaguchi
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionprotected static interfaceRepresents a typed property defined on aPropertySet.protected static classRepresents the list of strongly-typed known properties (keyed by property names.)static classPropertyMapEntry represents a Map.Entry in the PropertyMap with more efficient access.Nested classes/interfaces inherited from interface com.oracle.webservices.api.message.PropertySet
PropertySet.Property -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionasMap()Creates a modifiableMapview of thisPropertySet.booleancontainsKey(Object key) protected voidcreateEntrySet(Set<Map.Entry<String, Object>> core) Deprecated.Gets the name of the property.protected abstract BasePropertySet.PropertyMapMap representing the Fields and Methods annotated withPropertySet.Property.protected booleanUsed when constructing theBasePropertySet.MapViewfor this object - it controls if theBasePropertySet.MapViewservers only to access strongly typed values or allows also different valuesprotected static BasePropertySet.PropertyMapThis method parses a class for fields and methods withPropertySet.Property.protected static BasePropertySet.PropertyMapparse(Class<?> clazz, MethodHandles.Lookup caller) This method parses a class for fields and methods withPropertySet.Property.Sets a property.booleanChecks if thisPropertySetsupports a property of the given name.
-
Constructor Details
-
BasePropertySet
protected BasePropertySet()Creates a new instance of TypedMap.
-
-
Method Details
-
getPropertyMap
Map representing the Fields and Methods annotated withPropertySet.Property. Model ofPropertySetclass.At the end of the derivation chain this method just needs to be implemented as:
private static final PropertyMap model; static { model = parse(MyDerivedClass.class); } protected PropertyMap getPropertyMap() { return model; }or if the implementation is in different Java module.private static final PropertyMap model; static { model = parse(MyDerivedClass.class, MethodHandles.lookup()); } protected PropertyMap getPropertyMap() { return model; }- Returns:
- the map of strongly-typed known properties keyed by property names
-
parse
This method parses a class for fields and methods withPropertySet.Property.- Parameters:
clazz- Class to be parsed- Returns:
- the map of strongly-typed known properties keyed by property names
- See Also:
-
parse
This method parses a class for fields and methods withPropertySet.Property.- Parameters:
clazz- Class to be parsedcaller- the caller lookup object- Returns:
- the map of strongly-typed known properties keyed by property names
- Throws:
NullPointerException- ifclazzorcallerisnullSecurityException- if denied by the security managerRuntimeException- if any of the other access checks specified above fails- Since:
- 3.0.1
-
containsKey
- Specified by:
containsKeyin interfacePropertySet
-
get
Gets the name of the property.- Specified by:
getin interfacePropertySet- Parameters:
key- This field is typed asObjectto follow theMap.get(Object)convention, but if anything butStringis passed, this method just returns null.
-
put
Sets a property.Implementation Note
This method is slow. Code inside JAX-WS should define strongly-typed fields in this class and access them directly, instead of using this.
- Specified by:
putin interfacePropertySet- Throws:
ReadOnlyPropertyException- if the given key is an alias of a strongly-typed field, and if the name object given is not assignable to the field.- See Also:
-
supports
Checks if thisPropertySetsupports a property of the given name.- Specified by:
supportsin interfacePropertySet
-
remove
- Specified by:
removein interfacePropertySet
-
createMapView
Deprecated.use newer implementationPropertySet.asMap()which produces readwriteMapCreates aMapview of thisPropertySet.This map is partially live, in the sense that values you set to it will be reflected to
PropertySet.However, this map may not pick up changes made to
PropertySetafter the view is created.- Specified by:
createMapViewin interfacePropertySet- Returns:
- always non-null valid instance.
-
asMap
Creates a modifiableMapview of thisPropertySet.
Changes done on thisMapor onPropertySetobject work in both directions - values made toMapare reflected toPropertySetand changes done using getters/setters onPropertySetobject are automatically reflected in thisMap.
If necessary, it also can hold other values (not present onPropertySet) - seemapAllowsAdditionalProperties()- Specified by:
asMapin interfacePropertySet- Returns:
- always non-null valid instance.
-
createView
-
mapAllowsAdditionalProperties
protected boolean mapAllowsAdditionalProperties()Used when constructing theBasePropertySet.MapViewfor this object - it controls if theBasePropertySet.MapViewservers only to access strongly typed values or allows also different values- Returns:
- true if
Mapshould allow also properties not defined as strongly typed fields
-
createEntrySet
-
PropertySet.asMap()which produces readwriteMap