org.w3._2005.atom.Link Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of legislation-gov-uk Show documentation
Show all versions of legislation-gov-uk Show documentation
Java library for consuming the Legislation.gov.uk API
The newest version!
//
// This file was generated by the JavaTM Architecture for XML Binding(JAXB) Reference Implementation, v2.2.4-2
// See http://java.sun.com/xml/jaxb
// Any modifications to this file will be lost upon recompilation of the source schema.
// Generated on: 2015.08.07 at 06:17:52 PM CEST
//
package org.w3._2005.atom;
import javax.xml.bind.annotation.*;
import javax.xml.bind.annotation.adapters.CollapsedStringAdapter;
import javax.xml.bind.annotation.adapters.XmlJavaTypeAdapter;
/**
* Java class for anonymous complex type.
*
*
The following schema fragment specifies the expected content contained within this class.
*
*
* <complexType>
* <complexContent>
* <extension base="{http://www.w3.org/2005/Atom}undefinedContent">
* <attGroup ref="{http://www.w3.org/2005/Atom}atomCommonAttributes"/>
* <attribute name="href" use="required" type="{http://www.w3.org/2001/XMLSchema}anySimpleType" />
* <attribute name="rel" type="{http://www.w3.org/2001/XMLSchema}anySimpleType" />
* <attribute name="type" type="{http://www.w3.org/2005/Atom}atomMediaType" />
* <attribute name="hreflang" type="{http://www.w3.org/2005/Atom}atomLanguageTag" />
* <attribute name="title" type="{http://www.w3.org/2001/XMLSchema}anySimpleType" />
* <attribute name="length" type="{http://www.w3.org/2001/XMLSchema}anySimpleType" />
* </extension>
* </complexContent>
* </complexType>
*
*/
@XmlAccessorType(XmlAccessType.FIELD)
@XmlType(name = "")
@XmlRootElement(name = "link")
public class Link
extends UndefinedContent {
public Link() {
}
/**
* URL to manifestation
*/
@XmlAttribute(name = "href", required = true)
@XmlSchemaType(name = "anySimpleType")
protected String href;
/**
* Type of link, for example {@code alternate} for different versions of the same law, or {@code http://purl.org/dc/terms/tableOfContents} for the table of contents.
*/
@XmlAttribute(name = "rel")
@XmlSchemaType(name = "anySimpleType")
protected String rel;
/**
* Documents type, for example {@code application/xml}
*/
@XmlAttribute(name = "type")
protected String type;
/**
* Language of document that this link refers to. For example {@code cy}. English by default (i.e., if not set).
*/
@XmlAttribute(name = "hreflang")
protected String hreflang;
/**
* Title of linked document, for example when in another language
*/
@XmlAttribute(name = "title")
@XmlSchemaType(name = "anySimpleType")
protected String title;
/**
* Doesn't seem to be used
*/
@XmlAttribute(name = "length")
@XmlSchemaType(name = "anySimpleType")
protected String length;
/**
* Doesn't seem to be used
*/
@XmlAttribute(name = "base", namespace = "http://www.w3.org/XML/1998/namespace")
@XmlSchemaType(name = "anyURI")
protected String base;
/**
* Doesn't seem to be used
*/
@XmlAttribute(name = "lang", namespace = "http://www.w3.org/XML/1998/namespace")
@XmlJavaTypeAdapter(CollapsedStringAdapter.class)
@XmlSchemaType(name = "language")
protected String lang;
/**
* Gets the value of the href property.
*
* @return possible object is
* {@link String }
*/
public String getHref() {
return href;
}
/**
* Sets the value of the href property.
*
* @param value allowed object is
* {@link String }
*/
public void setHref(String value) {
this.href = value;
}
/**
* Gets the value of the rel property.
*
* @return possible object is
* {@link String }
*/
public String getRel() {
return rel;
}
/**
* Sets the value of the rel property.
*
* @param value allowed object is
* {@link String }
*/
public void setRel(String value) {
this.rel = value;
}
/**
* Gets the value of the type property.
*
* @return possible object is
* {@link String }
*/
public String getType() {
return type;
}
/**
* Sets the value of the type property.
*
* @param value allowed object is
* {@link String }
*/
public void setType(String value) {
this.type = value;
}
/**
* Gets the value of the hreflang property.
*
* @return possible object is
* {@link String }
*/
public String getHreflang() {
return hreflang;
}
/**
* Like {@link #getHreflang()}, but returns @{code "en"} for null and empty values of hreflang
*
* @return normalized language
*/
public String getNormalizedHrefLang() {
return (hreflang == null || hreflang.length() <= 0) ? "en" : hreflang; //Default language is English
}
/**
* Sets the value of the hreflang property.
*
* @param value allowed object is
* {@link String }
*/
public void setHreflang(String value) {
this.hreflang = value;
}
/**
* Gets the value of the title property.
*
* @return possible object is
* {@link String }
*/
public String getTitle() {
return title;
}
/**
* Sets the value of the title property.
*
* @param value allowed object is
* {@link String }
*/
public void setTitle(String value) {
this.title = value;
}
/**
* Gets the value of the length property.
*
* @return possible object is
* {@link String }
*/
public String getLength() {
return length;
}
/**
* Sets the value of the length property.
*
* @param value allowed object is
* {@link String }
*/
public void setLength(String value) {
this.length = value;
}
/**
* Gets the value of the base property.
*
* @return possible object is
* {@link String }
*/
public String getBase() {
return base;
}
/**
* Sets the value of the base property.
*
* @param value allowed object is
* {@link String }
*/
public void setBase(String value) {
this.base = value;
}
/**
* Gets the value of the lang property.
*
* @return possible object is
* {@link String }
*/
public String getLang() {
return lang;
}
public Link(String href, String rel, String type, String hreflang, String title, String length, String base, String lang) {
this.href = href;
this.rel = rel;
this.type = type;
this.hreflang = hreflang;
this.title = title;
this.length = length;
this.base = base;
this.lang = lang;
}
/**
* Sets the value of the lang property.
*
* @param value allowed object is
* {@link String }
*/
public void setLang(String value) {
this.lang = value;
}
/**
* @return A new Link object set with exactly the same strings
*/
public Link copy() {
return new Link(
href,
rel,
type,
hreflang,
title,
length,
base,
lang
);
}
}