
org.purl.dc.elements._1.SimpleLiteral Maven / Gradle / Ivy
//
// This file was generated by the JavaTM Architecture for XML Binding(JAXB) Reference Implementation, v2.3.0
// See https://javaee.github.io/jaxb-v2/
// Any modifications to this file will be lost upon recompilation of the source schema.
// Generated on: 2021.02.03 at 11:54:10 AM CST
//
package org.purl.dc.elements._1;
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.XmlAttribute;
import javax.xml.bind.annotation.XmlMixed;
import javax.xml.bind.annotation.XmlSchemaType;
import javax.xml.bind.annotation.XmlSeeAlso;
import javax.xml.bind.annotation.XmlType;
import javax.xml.bind.annotation.adapters.CollapsedStringAdapter;
import javax.xml.bind.annotation.adapters.XmlJavaTypeAdapter;
import org.jvnet.jaxb2_commons.lang.CopyStrategy2;
import org.jvnet.jaxb2_commons.lang.CopyTo2;
import org.jvnet.jaxb2_commons.lang.JAXBCopyStrategy;
import org.jvnet.jaxb2_commons.locator.ObjectLocator;
import org.jvnet.jaxb2_commons.locator.util.LocatorUtils;
import org.purl.dc.terms.Box;
import org.purl.dc.terms.DCMIType;
import org.purl.dc.terms.DDC;
import org.purl.dc.terms.IMT;
import org.purl.dc.terms.ISO3166;
import org.purl.dc.terms.ISO6392;
import org.purl.dc.terms.ISO6393;
import org.purl.dc.terms.LCC;
import org.purl.dc.terms.LCSH;
import org.purl.dc.terms.MESH;
import org.purl.dc.terms.Period;
import org.purl.dc.terms.Point;
import org.purl.dc.terms.RFC1766;
import org.purl.dc.terms.RFC3066;
import org.purl.dc.terms.RFC4646;
import org.purl.dc.terms.TGN;
import org.purl.dc.terms.UDC;
import org.purl.dc.terms.URI;
import org.purl.dc.terms.W3CDTF;
/**
*
* This is the default type for all of the DC elements.
* It permits text content only with optional
* xml:lang attribute.
* Text is allowed because mixed="true", but sub-elements
* are disallowed because minOccurs="0" and maxOccurs="0"
* are on the xs:any tag.
*
* This complexType allows for restriction or extension permitting
* child elements.
*
*
* Java class for SimpleLiteral complex type.
*
*
The following schema fragment specifies the expected content contained within this class.
*
*
* <complexType name="SimpleLiteral">
* <complexContent>
* <restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
* <sequence>
* <any processContents='lax' maxOccurs="0" minOccurs="0"/>
* </sequence>
* <attribute ref="{http://www.w3.org/XML/1998/namespace}lang"/>
* </restriction>
* </complexContent>
* </complexType>
*
*
*
*/
@XmlAccessorType(XmlAccessType.FIELD)
@XmlType(name = "SimpleLiteral", propOrder = {
"content"
})
@XmlSeeAlso({
LCSH.class,
MESH.class,
DDC.class,
LCC.class,
UDC.class,
Period.class,
W3CDTF.class,
DCMIType.class,
IMT.class,
URI.class,
ISO6392 .class,
ISO6393 .class,
RFC1766 .class,
RFC3066 .class,
RFC4646 .class,
Point.class,
ISO3166 .class,
Box.class,
TGN.class
})
public class SimpleLiteral implements Cloneable, CopyTo2
{
@XmlMixed
protected List content;
@XmlAttribute(name = "lang", namespace = "http://www.w3.org/XML/1998/namespace")
@XmlJavaTypeAdapter(CollapsedStringAdapter.class)
@XmlSchemaType(name = "language")
protected String lang;
/**
*
* This is the default type for all of the DC elements.
* It permits text content only with optional
* xml:lang attribute.
* Text is allowed because mixed="true", but sub-elements
* are disallowed because minOccurs="0" and maxOccurs="0"
* are on the xs:any tag.
*
* This complexType allows for restriction or extension permitting
* child elements.
* Gets the value of the content property.
*
*
* 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 set
method for the content property.
*
*
* For example, to add a new item, do as follows:
*
* getContent().add(newItem);
*
*
*
*
* Objects of the following type(s) are allowed in the list
* {@link String }
*
*
*/
public List getContent() {
if (content == null) {
content = new ArrayList();
}
return this.content;
}
/**
* Gets the value of the lang property.
*
* @return
* possible object is
* {@link String }
*
*/
public String getLang() {
return lang;
}
/**
* Sets the value of the lang property.
*
* @param value
* allowed object is
* {@link String }
*
*/
public void setLang(String value) {
this.lang = value;
}
public Object clone() {
return copyTo(createNewInstance());
}
public Object copyTo(Object target) {
final CopyStrategy2 strategy = JAXBCopyStrategy.INSTANCE;
return copyTo(null, target, strategy);
}
public Object copyTo(ObjectLocator locator, Object target, CopyStrategy2 strategy) {
final Object draftCopy = ((target == null)?createNewInstance():target);
if (draftCopy instanceof SimpleLiteral) {
final SimpleLiteral copy = ((SimpleLiteral) draftCopy);
{
Boolean contentShouldBeCopiedAndSet = strategy.shouldBeCopiedAndSet(locator, ((this.content!= null)&&(!this.content.isEmpty())));
if (contentShouldBeCopiedAndSet == Boolean.TRUE) {
List sourceContent;
sourceContent = (((this.content!= null)&&(!this.content.isEmpty()))?this.getContent():null);
@SuppressWarnings("unchecked")
List copyContent = ((List ) strategy.copy(LocatorUtils.property(locator, "content", sourceContent), sourceContent, ((this.content!= null)&&(!this.content.isEmpty()))));
copy.content = null;
if (copyContent!= null) {
List uniqueContentl = copy.getContent();
uniqueContentl.addAll(copyContent);
}
} else {
if (contentShouldBeCopiedAndSet == Boolean.FALSE) {
copy.content = null;
}
}
}
{
Boolean langShouldBeCopiedAndSet = strategy.shouldBeCopiedAndSet(locator, (this.lang!= null));
if (langShouldBeCopiedAndSet == Boolean.TRUE) {
String sourceLang;
sourceLang = this.getLang();
String copyLang = ((String) strategy.copy(LocatorUtils.property(locator, "lang", sourceLang), sourceLang, (this.lang!= null)));
copy.setLang(copyLang);
} else {
if (langShouldBeCopiedAndSet == Boolean.FALSE) {
copy.lang = null;
}
}
}
}
return draftCopy;
}
public Object createNewInstance() {
return new SimpleLiteral();
}
}