org.apache.muse.ws.resource.metadata
Class OpenMetadataDescriptor

java.lang.Object
  extended by org.apache.muse.ws.resource.metadata.OpenMetadataDescriptor
All Implemented Interfaces:
XmlSerializable, MetadataDescriptor

public class OpenMetadataDescriptor
extends Object
implements MetadataDescriptor

OpenMetadataDescriptor is a MetadataDescriptor that allows free reign on all properties, since no rules or restrictions have been put in place. This class is a singleton because an empty RMD is the same no matter what properties are defined.

Author:
Dan Jemiolo (danj)

Method Summary
 void addProperty(QName property, String modifiability, String mutability)
          Adds another wsrmd:Property element to the descriptor with the basic metadata attributes required by the spec.
 boolean canDelete(QName property)
           
 boolean canInsert(QName property)
           
 boolean canUpdate(QName property)
           
 String getExtendedMetadata(QName property, QName elementName)
          This method allows you to extend a wsrmd:Property definition and provide application-specific metadata for a property.
 Collection getExtendedMetadataNames(QName property)
           
 Collection getInitialValues(QName property)
           
 Collection getInitialValues(QName property, Class type)
           
static OpenMetadataDescriptor getInstance()
           
 QName getInterface()
           
 String getLowerBound(QName property)
           
 String getModifiability(QName property)
          Most users will probably want to use the canDelete(), canInsert(), and canUpdate() methods to test the permissions of a property; these methods handle the Boolean logic between modifiability and mutability values so you don't have to litter your code with messy if/else blocks.
 String getMutability(QName property)
          Most users will probably want to use the canDelete(), canInsert(), and canUpdate() methods to test the permissions of a property; these methods handle the Boolean logic between modifiability and mutability values so you don't have to litter your code with messy if/else blocks.
 String getName()
           
 Collection getPropertyNames()
           
 Collection getStaticValues(QName property)
           
 Collection getStaticValues(QName property, Class type)
           
 String getUpperBound(QName property)
           
 Collection getValidValues(QName property)
           
 Collection getValidValues(QName property, Class type)
           
 String getWsdlLocation()
           
 boolean hasProperty(QName property)
           
 boolean isInitialValue(QName property, Object value)
           
 boolean isReadOnlyExternal(QName property)
           
 boolean isStaticValue(QName property, Object value)
           
 boolean isValidValue(QName property, Object value)
           
 void removeProperty(QName property)
          Removes the wsrmd:Property element with the given name.
 void setExtendedMetadata(QName property, QName elementName, String value)
          This method allows you to extend a wsrmd:Property definition and provide application-specific metadata for a property.
 void setInitialValues(QName property, Collection values)
           
 void setLowerBound(QName property, String value)
           
 void setModifiability(QName property, String value)
           
 void setMutability(QName property, String value)
           
 void setPropertyName(QName currentProperty, QName newProperty)
          Change the name of one of the current wsrmd:Property elements.
 void setStaticValues(QName property, Collection values)
           
 void setUpperBound(QName property, String value)
           
 void setValidValues(QName property, Collection values)
           
 Element toXML()
          Converts this object into an XML representation, as defined by its related schema or specification.
 Element toXML(Document doc)
          Converts this object into an XML representation, as defined by its related schema or specification.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

getInstance

public static OpenMetadataDescriptor getInstance()
Returns:
The singleton instance of this class.

addProperty

public void addProperty(QName property,
                        String modifiability,
                        String mutability)
Description copied from interface: MetadataDescriptor
Adds another wsrmd:Property element to the descriptor with the basic metadata attributes required by the spec.

Specified by:
addProperty in interface MetadataDescriptor
Parameters:
property - The name of the property this metadata refers to.
modifiability - Use WsrmdConstants.READ_ONLY or WsrmdConstants.READ_WRITE.
mutability - Use WsrmdConstants.CONSTANT, WsrmdConstants.APPENDABLE, or WsrmdConstants.MUTABLE.
See Also:
WsrmdConstants

canDelete

public boolean canDelete(QName property)
Specified by:
canDelete in interface MetadataDescriptor
Returns:
true

canInsert

public boolean canInsert(QName property)
Specified by:
canInsert in interface MetadataDescriptor
Returns:
true

canUpdate

public boolean canUpdate(QName property)
Specified by:
canUpdate in interface MetadataDescriptor
Returns:
true

getExtendedMetadata

public String getExtendedMetadata(QName property,
                                  QName elementName)
Description copied from interface: MetadataDescriptor
This method allows you to extend a wsrmd:Property definition and provide application-specific metadata for a property. These will be parsed as simple name-value pairs - you cannot associate complex types or XML fragments with an extended metadata item.

Specified by:
getExtendedMetadata in interface MetadataDescriptor
elementName - The name of the extended metadata item.
Returns:
The value of the extended metadata item, or null if there is no such item.

getExtendedMetadataNames

public Collection getExtendedMetadataNames(QName property)
Specified by:
getExtendedMetadataNames in interface MetadataDescriptor
Returns:
The names (QNames) of all extended metadata elements defined for this property. The collection may be empty.

getInitialValues

public Collection getInitialValues(QName property)
Specified by:
getInitialValues in interface MetadataDescriptor
Returns:
An empty collection.
See Also:
MetadataDescriptor.getInitialValues(QName, Class)

getInitialValues

public Collection getInitialValues(QName property,
                                   Class type)
Specified by:
getInitialValues in interface MetadataDescriptor
type - The type whose serializer should be used to convert the property values (DOM Elements) into POJOs.
Returns:
An empty collection.
See Also:
MetadataDescriptor.getValidValues(QName)

getInterface

public QName getInterface()
Specified by:
getInterface in interface MetadataDescriptor

getLowerBound

public String getLowerBound(QName property)
Specified by:
getLowerBound in interface MetadataDescriptor
Returns:
null

getModifiability

public String getModifiability(QName property)
Description copied from interface: MetadataDescriptor
Most users will probably want to use the canDelete(), canInsert(), and canUpdate() methods to test the permissions of a property; these methods handle the Boolean logic between modifiability and mutability values so you don't have to litter your code with messy if/else blocks. This method returns the actual string value of the attribute that is used in the RMD doc.

Specified by:
getModifiability in interface MetadataDescriptor
Returns:
null
See Also:
MetadataDescriptor.canDelete(QName), MetadataDescriptor.canInsert(QName), MetadataDescriptor.canUpdate(QName)

getMutability

public String getMutability(QName property)
Description copied from interface: MetadataDescriptor
Most users will probably want to use the canDelete(), canInsert(), and canUpdate() methods to test the permissions of a property; these methods handle the Boolean logic between modifiability and mutability values so you don't have to litter your code with messy if/else blocks. This method returns the actual string value of the attribute that is used in the RMD doc.

Specified by:
getMutability in interface MetadataDescriptor
Returns:
null
See Also:
MetadataDescriptor.canDelete(QName), MetadataDescriptor.canInsert(QName), MetadataDescriptor.canUpdate(QName)

getName

public String getName()
Specified by:
getName in interface MetadataDescriptor
Returns:
null

getPropertyNames

public Collection getPropertyNames()
Specified by:
getPropertyNames in interface MetadataDescriptor
Returns:
An empty collection.

getStaticValues

public Collection getStaticValues(QName property)
Specified by:
getStaticValues in interface MetadataDescriptor
Returns:
An empty collection.
See Also:
MetadataDescriptor.getStaticValues(QName, Class)

getStaticValues

public Collection getStaticValues(QName property,
                                  Class type)
Specified by:
getStaticValues in interface MetadataDescriptor
type - The type whose serializer should be used to convert the property values (DOM Elements) into POJOs.
Returns:
An empty collection.
See Also:
MetadataDescriptor.getStaticValues(QName)

getUpperBound

public String getUpperBound(QName property)
Specified by:
getUpperBound in interface MetadataDescriptor
Returns:
null

getValidValues

public Collection getValidValues(QName property)
Specified by:
getValidValues in interface MetadataDescriptor
Returns:
An empty collection.
See Also:
MetadataDescriptor.getValidValues(QName, Class)

getValidValues

public Collection getValidValues(QName property,
                                 Class type)
Specified by:
getValidValues in interface MetadataDescriptor
type - The type whose serializer should be used to convert the property values (DOM Elements) into POJOs.
Returns:
An empty collection.
See Also:
MetadataDescriptor.getValidValues(QName)

getWsdlLocation

public String getWsdlLocation()
Specified by:
getWsdlLocation in interface MetadataDescriptor

hasProperty

public boolean hasProperty(QName property)
Specified by:
hasProperty in interface MetadataDescriptor
Returns:
true

isInitialValue

public boolean isInitialValue(QName property,
                              Object value)
Specified by:
isInitialValue in interface MetadataDescriptor
Returns:
false

isReadOnlyExternal

public boolean isReadOnlyExternal(QName property)
Specified by:
isReadOnlyExternal in interface MetadataDescriptor
Returns:
false

isStaticValue

public boolean isStaticValue(QName property,
                             Object value)
Specified by:
isStaticValue in interface MetadataDescriptor
Returns:
false

isValidValue

public boolean isValidValue(QName property,
                            Object value)
Specified by:
isValidValue in interface MetadataDescriptor
Returns:
true

toXML

public Element toXML()
Description copied from interface: XmlSerializable
Converts this object into an XML representation, as defined by its related schema or specification. The format of the XML is dependent on the concrete type.

Specified by:
toXML in interface XmlSerializable
Returns:
An XML representation of this object.

toXML

public Element toXML(Document doc)
Description copied from interface: XmlSerializable
Converts this object into an XML representation, as defined by its related schema or specification. The format of the XML is dependent on the concrete type.

Specified by:
toXML in interface XmlSerializable
Parameters:
doc - The DOM Document that will be used to create all of the nodes in the resulting XML fragment.
Returns:
An XML representation of this object.

removeProperty

public void removeProperty(QName property)
Description copied from interface: MetadataDescriptor
Removes the wsrmd:Property element with the given name.

Specified by:
removeProperty in interface MetadataDescriptor
Parameters:
property - The name of the property to remove.

setExtendedMetadata

public void setExtendedMetadata(QName property,
                                QName elementName,
                                String value)
Description copied from interface: MetadataDescriptor
This method allows you to extend a wsrmd:Property definition and provide application-specific metadata for a property.

Specified by:
setExtendedMetadata in interface MetadataDescriptor
Parameters:
property - The wsrmd:Property element to which the new element should be added.
elementName - The name of the extended metadata item. param value The value of the extended metadata item(may be null).

setInitialValues

public void setInitialValues(QName property,
                             Collection values)
Specified by:
setInitialValues in interface MetadataDescriptor

setLowerBound

public void setLowerBound(QName property,
                          String value)
Specified by:
setLowerBound in interface MetadataDescriptor

setModifiability

public void setModifiability(QName property,
                             String value)
Specified by:
setModifiability in interface MetadataDescriptor
Parameters:
property - The wsrmd:Property element whose modifiability attribute will be changed.
value - WsrmdConstants.READ_ONLY or WsrmdConstants.READ_WRITE

setMutability

public void setMutability(QName property,
                          String value)
Specified by:
setMutability in interface MetadataDescriptor
Parameters:
property - The wsrmd:Property element whose mutability attribute will be changed.
value - WsrmdConstants.CONSTANT, WsrmdConstants.APPENDABLE, or WsrmdConstants.MUTABLE

setPropertyName

public void setPropertyName(QName currentProperty,
                            QName newProperty)
Description copied from interface: MetadataDescriptor
Change the name of one of the current wsrmd:Property elements. The new name cannot be one of the existing properties' names.

Specified by:
setPropertyName in interface MetadataDescriptor

setStaticValues

public void setStaticValues(QName property,
                            Collection values)
Specified by:
setStaticValues in interface MetadataDescriptor

setUpperBound

public void setUpperBound(QName property,
                          String value)
Specified by:
setUpperBound in interface MetadataDescriptor

setValidValues

public void setValidValues(QName property,
                           Collection values)
Specified by:
setValidValues in interface MetadataDescriptor


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