org.apache.muse.ws.resource.properties.schema.impl
Class SimpleResourcePropertiesSchema

java.lang.Object
  extended by org.apache.muse.ws.resource.properties.schema.impl.SimpleResourcePropertiesSchema
All Implemented Interfaces:
ResourcePropertiesSchema

public class SimpleResourcePropertiesSchema
extends Object
implements ResourcePropertiesSchema

SimpleResourcePropertiesSchema is Muse's default implementation of the (WS-RP document schema). Instances of this schema structure can be created from a DOM Element containing the WS-RP document definition.

Author:
Dan Jemiolo (danj)

Field Summary
 
Fields inherited from interface org.apache.muse.ws.resource.properties.schema.ResourcePropertiesSchema
UNBOUNDED
 
Constructor Summary
SimpleResourcePropertiesSchema(QName wsrpName, Element wsrpElement)
          Creates a new schema by parsing the WS-RP document and storing the various property data for future lookups.
 
Method Summary
 WsResourceCapability getCapability(QName property)
           
 QName getElementName()
           
 int getMaxOccurs(QName property)
           
 int getMinOccurs(QName property)
           
protected  org.apache.muse.ws.resource.properties.schema.impl.PropertySchemaDefinition getProperty(QName property)
           
 Collection getPropertyNames()
           
 QName getPropertyTypeName(QName property)
           
 boolean hasCapability(QName property)
           
 boolean hasProperty(QName property)
           
 boolean isMaxUnbounded(QName property)
           
 boolean isNillable(QName property)
           
 void setCapability(QName property, WsResourceCapability capability)
          Maps the property to the capability so that users can later determine which capability should be used for servicing read/write requests against the property.
 void setElementName(QName wsrpName)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

SimpleResourcePropertiesSchema

public SimpleResourcePropertiesSchema(QName wsrpName,
                                      Element wsrpElement)
Creates a new schema by parsing the WS-RP document and storing the various property data for future lookups. The child xsd:elements in the given Element represent the actual properties in the WS-RP definition; the types of these properties must be referred to using the XSD ref attribute.

Parameters:
wsrpElement - The DOM Element containing the WS-RP document's type definition.
Method Detail

getCapability

public WsResourceCapability getCapability(QName property)
Specified by:
getCapability in interface ResourcePropertiesSchema
Returns:
The capability that defines the resource property, or null if the property does not exist.

getElementName

public final QName getElementName()
Specified by:
getElementName in interface ResourcePropertiesSchema
Returns:
The name of the schema element representing the WSRP document.

getMaxOccurs

public int getMaxOccurs(QName property)
Specified by:
getMaxOccurs in interface ResourcePropertiesSchema
Returns:
The maximum number of occurrences for the given property, or UNBOUNDED if the property's "maxOccurs" is set to "unbounded".

getMinOccurs

public int getMinOccurs(QName property)
Specified by:
getMinOccurs in interface ResourcePropertiesSchema
Returns:
The minimum number of occurrences for the given property.

getProperty

protected org.apache.muse.ws.resource.properties.schema.impl.PropertySchemaDefinition getProperty(QName property)

getPropertyNames

public Collection getPropertyNames()
Specified by:
getPropertyNames in interface ResourcePropertiesSchema
Returns:
The collection of property names defined in this schema.

getPropertyTypeName

public QName getPropertyTypeName(QName property)
Specified by:
getPropertyTypeName in interface ResourcePropertiesSchema
Returns:
The qualified name of the property's type (set with the "type" attribute). If no type is specified, the method returns XsdUtils.ANY_TYPE_QNAME.

hasCapability

public boolean hasCapability(QName property)
Specified by:
hasCapability in interface ResourcePropertiesSchema

hasProperty

public boolean hasProperty(QName property)
Specified by:
hasProperty in interface ResourcePropertiesSchema
Returns:
True is the schema has a property definition with the given name.

isMaxUnbounded

public boolean isMaxUnbounded(QName property)
Specified by:
isMaxUnbounded in interface ResourcePropertiesSchema
Returns:
True if getMaxOccurs(QName) returns UNBOUNDED.

isNillable

public boolean isNillable(QName property)
Specified by:
isNillable in interface ResourcePropertiesSchema
Returns:
True if instances of the given property can be set to null, or empty elements (set with the "nillable" attribute).

setCapability

public void setCapability(QName property,
                          WsResourceCapability capability)
Description copied from interface: ResourcePropertiesSchema
Maps the property to the capability so that users can later determine which capability should be used for servicing read/write requests against the property.

Specified by:
setCapability in interface ResourcePropertiesSchema

setElementName

public void setElementName(QName wsrpName)
Specified by:
setElementName in interface ResourcePropertiesSchema
Parameters:
wsrpName - The name of the schema element representing the WSRP document.


Copyright © 2005-2011 Apache Web Services - Muse. All Rights Reserved.