/******************************************************************************* * Licensed to the Apache Software Foundation (ASF) under one * or more contributor license agreements. See the NOTICE file * distributed with this work for additional information * regarding copyright ownership. The ASF licenses this file * to you under the Apache License, Version 2.0 (the * "License"); you may not use this file except in compliance * with the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, * software distributed under the License is distributed on an * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY * KIND, either express or implied. See the License for the * specific language governing permissions and limitations * under the License. * *******************************************************************************/ // // This file was generated by the JavaTM Architecture for XML Binding(JAXB) Reference Implementation, v2.1.1-b02-fcs // See <a href="http://java.sun.com/xml/jaxb">http://java.sun.com/xml/jaxb</a> // Any modifications to this file will be lost upon recompilation of the source schema. // Generated on: 2008.12.04 at 08:36:58 PM IST // package org.apache.wink.webdav.model; import java.util.ArrayList; import java.util.List; import javax.xml.bind.annotation.XmlAccessType; import javax.xml.bind.annotation.XmlAccessorType; import javax.xml.bind.annotation.XmlAnyElement; import javax.xml.bind.annotation.XmlRootElement; import javax.xml.bind.annotation.XmlType; import javax.xml.namespace.QName; import org.w3c.dom.Element; /** * The <code>prop</code> XML element per the WebDAV specification [RFC 4918] * * <pre> * Name: prop * Namespace: DAV: * Purpose: Contains properties related to a resource. * Description: The prop XML element is a generic container for * properties defined on resources. All elements inside a prop XML * element MUST define properties related to the resource. No other * elements may be used inside of a prop element. * * <!ELEMENT prop ANY> * * </pre> */ @XmlAccessorType(XmlAccessType.FIELD) @XmlType(name = "", propOrder = { }) @XmlRootElement(name = "prop") public class Prop { protected Creationdate creationdate; protected Displayname displayname; protected Getcontentlanguage getcontentlanguage; protected Getcontentlength getcontentlength; protected Getcontenttype getcontenttype; protected Getetag getetag; protected Getlastmodified getlastmodified; protected Lockdiscovery lockdiscovery; protected Resourcetype resourcetype; protected Supportedlock supportedlock; @XmlAnyElement protected List<Element> any; /** * Gets the value of the creationdate property. * * @return possible object is {@link Creationdate } */ public Creationdate getCreationdate() { return creationdate; } /** * Sets the value of the creationdate property. * * @param value allowed object is {@link Creationdate } */ public void setCreationdate(Creationdate value) { this.creationdate = value; } /** * Gets the value of the displayname property. * * @return possible object is {@link Displayname } */ public Displayname getDisplayname() { return displayname; } /** * Sets the value of the displayname property. * * @param value allowed object is {@link Displayname } */ public void setDisplayname(Displayname value) { this.displayname = value; } /** * Gets the value of the getcontentlanguage property. * * @return possible object is {@link Getcontentlanguage } */ public Getcontentlanguage getGetcontentlanguage() { return getcontentlanguage; } /** * Sets the value of the getcontentlanguage property. * * @param value allowed object is {@link Getcontentlanguage } */ public void setGetcontentlanguage(Getcontentlanguage value) { this.getcontentlanguage = value; } /** * Gets the value of the getcontentlength property. * * @return possible object is {@link Getcontentlength } */ public Getcontentlength getGetcontentlength() { return getcontentlength; } /** * Sets the value of the getcontentlength property. * * @param value allowed object is {@link Getcontentlength } */ public void setGetcontentlength(Getcontentlength value) { this.getcontentlength = value; } /** * Gets the value of the getcontenttype property. * * @return possible object is {@link Getcontenttype } */ public Getcontenttype getGetcontenttype() { return getcontenttype; } /** * Sets the value of the getcontenttype property. * * @param value allowed object is {@link Getcontenttype } */ public void setGetcontenttype(Getcontenttype value) { this.getcontenttype = value; } /** * Gets the value of the getetag property. * * @return possible object is {@link Getetag } */ public Getetag getGetetag() { return getetag; } /** * Sets the value of the getetag property. * * @param value allowed object is {@link Getetag } */ public void setGetetag(Getetag value) { this.getetag = value; } /** * Gets the value of the getlastmodified property. * * @return possible object is {@link Getlastmodified } */ public Getlastmodified getGetlastmodified() { return getlastmodified; } /** * Sets the value of the getlastmodified property. * * @param value allowed object is {@link Getlastmodified } */ public void setGetlastmodified(Getlastmodified value) { this.getlastmodified = value; } /** * Gets the value of the lockdiscovery property. * * @return possible object is {@link Lockdiscovery } */ public Lockdiscovery getLockdiscovery() { return lockdiscovery; } /** * Sets the value of the lockdiscovery property. * * @param value allowed object is {@link Lockdiscovery } */ public void setLockdiscovery(Lockdiscovery value) { this.lockdiscovery = value; } /** * Gets the value of the resourcetype property. * * @return possible object is {@link Resourcetype } */ public Resourcetype getResourcetype() { return resourcetype; } /** * Sets the value of the resourcetype property. * * @param value allowed object is {@link Resourcetype } */ public void setResourcetype(Resourcetype value) { this.resourcetype = value; } /** * Gets the value of the supportedlock property. * * @return possible object is {@link Supportedlock } */ public Supportedlock getSupportedlock() { return supportedlock; } /** * Sets the value of the supportedlock property. * * @param value allowed object is {@link Supportedlock } */ public void setSupportedlock(Supportedlock value) { this.supportedlock = value; } /** * Gets the value of the any property. * <p> * This accessor method returns a reference to the live list, not a * snapshot. Therefore any modification you make to the returned list will * be present inside the JAXB object. This is why there is not a * <CODE>set</CODE> method for the any property. * <p> * For example, to add a new item, do as follows: * * <pre> * getAny().add(newItem); * </pre> * <p> * Objects of the following type(s) are allowed in the list {@link Element } */ public List<Element> getAny() { if (any == null) { any = new ArrayList<Element>(); } return this.any; } /** * Get a proprietary property as an W3C element * * @param name the name of the property to get * @return an Element instance representing the property, or null if no such * property exists */ public Element getAnyByName(QName name) { return getAnyByName(name.getNamespaceURI(), name.getLocalPart()); } /** * Get a proprietary property as an W3C element * * @param namespaceURI the namespace of the property to get * @param name the name of the property to get * @return an Element instance representing the property, or null if no such * property exists */ public Element getAnyByName(String namespaceURI, String name) { for (Element element : getAny()) { String elementName = element.getLocalName(); String elementNamespaceURI = element.getNamespaceURI(); if (elementNamespaceURI == null) { elementNamespaceURI = ""; //$NON-NLS-1$ } if (elementNamespaceURI.equals(namespaceURI) && elementName.equals(name)) { return element; } } return null; } /** * Remove the specified proprietary property * * @param namespaceURI the namespace of the property to remove * @param name name of the property to remove */ public void removeAny(String namespaceURI, String name) { innerRemoveAny(getAnyByName(namespaceURI, name)); } /** * Remove the specified proprietary property * * @param name name of the property to remove */ public void removeAny(QName name) { innerRemoveAny(getAnyByName(name)); } /** * Remove the specified proprietary property * * @param element the Element instance to remove */ public void removeAny(Element element) { innerRemoveAny(getAnyByName(element.getNamespaceURI(), element.getLocalName())); } private void innerRemoveAny(Element element) { if (element == null) { return; } getAny().remove(element); } /** * Set a proprietary property, and return the Element representing it * * @param name the name of the property * @return the Element representing the property */ public Element setProperty(QName name) { String fullName = WebDAVModelHelper.getFullName(name); return setProperty(name.getNamespaceURI(), fullName, (String)null); } /** * Set a proprietary property, and return the Element representing it * * @param name the name of the property * @param content the text content of the property * @return the Element representing the property */ public Element setProperty(QName name, String content) { String fullName = WebDAVModelHelper.getFullName(name); return setProperty(name.getNamespaceURI(), fullName, content); } /** * Set a proprietary property, and return the Element representing it * * @param name the name of the property * @param content the text content of the property * @return the Element representing the property */ public Element setProperty(QName name, Element content) { String fullName = WebDAVModelHelper.getFullName(name); return setProperty(name.getNamespaceURI(), fullName, content); } /** * Set a proprietary property, and return the Element representing it * * @param namespaceURI the namespace of the property * @param name the name of the property * @return the Element representing the property */ public Element setProperty(String namespaceURI, String name) { return setProperty(namespaceURI, name, (String)null); } /** * Set a proprietary property, and return the Element representing it * * @param namespaceURI the namespace of the property * @param name the name of the property * @param content the text content of the property * @return the Element representing the property */ public Element setProperty(String namespaceURI, String name, String content) { removeAny(namespaceURI, name); Element element = WebDAVModelHelper.createElement(namespaceURI, name, content); getAny().add(element); return element; } /** * Set a proprietary property, and return the Element representing it * * @param namespaceURI the namespace of the property * @param name the name of the property * @param child the child element of the property element * @return the Element representing the property */ public Element setProperty(String namespaceURI, String name, Element child) { removeAny(namespaceURI, name); Element element = WebDAVModelHelper.createElement(namespaceURI, name, child); getAny().add(element); return element; } /** * Performs a shallow copy of all elements in this Prop instance into the * dest Prop instance * * @param dest the Prop instance to cop this instance into */ public void copyTo(Prop dest) { if (dest == null) { return; } dest.setCreationdate(this.getCreationdate()); dest.setDisplayname(this.getDisplayname()); dest.setGetcontentlanguage(this.getGetcontentlanguage()); dest.setGetcontentlength(this.getGetcontentlength()); dest.setGetcontenttype(this.getGetcontenttype()); dest.setGetetag(this.getGetetag()); dest.setGetlastmodified(this.getGetlastmodified()); dest.setLockdiscovery(this.getLockdiscovery()); dest.setResourcetype(this.getResourcetype()); dest.setSupportedlock(this.getSupportedlock()); dest.getAny().clear(); for (Element element : this.getAny()) { dest.getAny().add(element); } } }