com.sun.xml.ws.api
Class PropertySet

java.lang.Object
  extended by com.sun.xml.ws.api.PropertySet
All Implemented Interfaces:
org.jvnet.ws.message.PropertySet
Direct Known Subclasses:
DistributedPropertySet, HttpResponseProperties, WsaPropertyBag, WSDLProperties, WSHTTPConnection, XMLPropertyBag

public abstract class PropertySet
extends Object
implements org.jvnet.ws.message.PropertySet

A set of "properties" that can be accessed via strongly-typed fields as well as reflexibly through the property name.


Nested Class Summary
protected static interface PropertySet.Accessor
          Represents a typed property defined on a PropertySet.
(package private) static class PropertySet.FieldAccessor
           
(package private) static class PropertySet.MethodAccessor
           
protected static class PropertySet.PropertyMap
          Represents the list of strongly-typed known propertyies (keyed by property names.)
 
Nested classes/interfaces inherited from interface org.jvnet.ws.message.PropertySet
org.jvnet.ws.message.PropertySet.Property
 
Field Summary
(package private)  Set<Map.Entry<String,Object>> mapViewCore
          Lazily created view of Propertys that forms the core of createMapView().
 
Constructor Summary
protected PropertySet()
          Creates a new instance of TypedMap.
 
Method Summary
 boolean containsKey(Object key)
           
(package private)  void createEntrySet(Set<Map.Entry<String,Object>> core)
           
 Map<String,Object> createMapView()
          Creates a PropertySet.PropertyMap view of this PropertySet.
 Object get(Object key)
          Gets the name of the property.
protected abstract  PropertySet.PropertyMap getPropertyMap()
          Map representing the Fields and Methods annotated with Property.
protected static PropertySet.PropertyMap parse(Class clazz)
          This method parses a class for fields and methods with Property.
 Object put(String key, Object value)
          Sets a property.
 Object remove(Object key)
           
 boolean supports(Object key)
          Checks if this PropertySet supports a property of the given name.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

mapViewCore

Set<Map.Entry<String,Object>> mapViewCore
Lazily created view of Propertys that forms the core of createMapView().

Constructor Detail

PropertySet

protected PropertySet()
Creates a new instance of TypedMap.

Method Detail

getPropertyMap

protected abstract PropertySet.PropertyMap getPropertyMap()
Map representing the Fields and Methods annotated with Property. Model of PropertySet class.

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;
 }
 


parse

protected static PropertySet.PropertyMap parse(Class clazz)
This method parses a class for fields and methods with Property.


containsKey

public final boolean containsKey(Object key)
Specified by:
containsKey in interface org.jvnet.ws.message.PropertySet

get

public Object get(Object key)
Gets the name of the property.

Specified by:
get in interface org.jvnet.ws.message.PropertySet
Parameters:
key - This field is typed as Object to follow the HashMap.get(Object) convention, but if anything but String is passed, this method just returns null.

put

public Object put(String key,
                  Object value)
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:
put in interface org.jvnet.ws.message.PropertySet
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:
Property

supports

public boolean supports(Object key)
Checks if this PropertySet supports a property of the given name.

Specified by:
supports in interface org.jvnet.ws.message.PropertySet

remove

public Object remove(Object key)
Specified by:
remove in interface org.jvnet.ws.message.PropertySet

createMapView

public final Map<String,Object> createMapView()
Creates a PropertySet.PropertyMap view of this PropertySet.

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 PropertySet after the view is created.

Specified by:
createMapView in interface org.jvnet.ws.message.PropertySet
Returns:
always non-null valid instance.

createEntrySet

void createEntrySet(Set<Map.Entry<String,Object>> core)


Copyright (c) 1997-2011 Oracle and/or its affiliates. All rights reserved.