001    //
002    // This file was generated by the JavaTM Architecture for XML Binding(JAXB) Reference Implementation, v2.0-b11-EA
003    // See <a href="http://java.sun.com/xml/jaxb">http://java.sun.com/xml/jaxb</a>
004    // Any modifications to this file will be lost upon recompilation of the source schema. 
005    // Generated on: 2005.05.06 at 02:17:10 BST 
006    //
007    
008    
009    package org.codehaus.activesoap.policy.addressing;
010    
011    import org.codehaus.activesoap.util.QNameHelper;
012    
013    import javax.xml.namespace.NamespaceContext;
014    import javax.xml.namespace.QName;
015    import javax.xml.stream.XMLStreamException;
016    import javax.xml.stream.XMLStreamWriter;
017    
018    /**
019     * @XmlAccessorType(value = AccessType.FIELD)
020     * @XmlType(name = "Relationship", namespace = "http://schemas.xmlsoap.org/ws/2003/03/addressing")
021     */
022    public class Relationship extends AttributedURI {
023    
024        public static final QName RELATIONSHIP_TYPE_NAME = new QName("RelationshipType");
025    
026        /**
027         * @XmlAttribute(name = "RelationshipType", namespace = "")
028         */
029        protected QName relationshipType;
030    
031        /**
032         * Gets the value of the relationshipType property.
033         *
034         * @return possible object is
035         *         {@link QName}
036         */
037        public QName getRelationshipType() {
038            return relationshipType;
039        }
040    
041        /**
042         * Sets the value of the relationshipType property.
043         *
044         * @param value allowed object is
045         *              {@link QName}
046         */
047        public void setRelationshipType(QName value) {
048            this.relationshipType = value;
049        }
050    
051        public void putAttributeValue(NamespaceContext namespaceContext, QName attributeName, String attributeValue) {
052            if (attributeName.equals(RELATIONSHIP_TYPE_NAME)) {
053                // lets turn the value into a qname
054                setRelationshipType(QNameHelper.asQName(namespaceContext, attributeValue));
055            }
056            else {
057                super.putAttributeValue(namespaceContext, attributeName, attributeValue);
058            }
059        }
060    
061        public void writeAttributes(XMLStreamWriter out) throws XMLStreamException {
062            if (relationshipType != null) {
063                out.writeAttribute(RELATIONSHIP_TYPE_NAME.getPrefix(), RELATIONSHIP_TYPE_NAME.getNamespaceURI(), RELATIONSHIP_TYPE_NAME.getLocalPart(), QNameHelper.getQualifiedName(relationshipType));
064            }
065            super.writeAttributes(out);
066        }
067    }