org.jomc.modlet.Schemas Maven / Gradle / Ivy
//
// This file was generated by the JavaTM Architecture for XML Binding(JAXB) Reference Implementation, vhudson-jaxb-ri-2.1-2
// See http://java.sun.com/xml/jaxb
// Any modifications to this file will be lost upon recompilation of the source schema.
// Generated on: 2013.01.04 at 08:47:18 AM MEZ
//
package org.jomc.modlet;
import java.util.ArrayList;
import java.util.Iterator;
import java.util.List;
import javax.annotation.Generated;
import javax.xml.bind.annotation.XmlAccessType;
import javax.xml.bind.annotation.XmlAccessorType;
import javax.xml.bind.annotation.XmlElement;
import javax.xml.bind.annotation.XmlType;
/**
* List of schemas.
*
* Java class for Schemas complex type.
*
*
The following schema fragment specifies the expected content contained within this class.
*
*
* <complexType name="Schemas">
* <complexContent>
* <extension base="{http://jomc.org/modlet}ModletObject">
* <sequence>
* <element ref="{http://jomc.org/modlet}schema" maxOccurs="unbounded" minOccurs="0"/>
* </sequence>
* </extension>
* </complexContent>
* </complexType>
*
*
*
*/
@XmlAccessorType(XmlAccessType.FIELD)
@XmlType(name = "Schemas", namespace = "http://jomc.org/modlet", propOrder = {
"schema"
})
@Generated(value = "com.sun.tools.xjc.Driver", date = "2013-01-04T08:47:18+01:00", comments = "JAXB RI vhudson-jaxb-ri-2.1-2")
public class Schemas
extends ModletObject
implements Cloneable
{
@XmlElement(namespace = "http://jomc.org/modlet")
@Generated(value = "com.sun.tools.xjc.Driver", date = "2013-01-04T08:47:18+01:00", comments = "JAXB RI vhudson-jaxb-ri-2.1-2")
protected List schema;
/**
* Creates a new {@code Schemas} instance.
*
*/
public Schemas() {
// CC-XJC Version 2.0.1 Build 2012-03-02T12:09:12+0000
super();
}
/**
* Creates a new {@code Schemas} instance by deeply copying a given {@code Schemas} instance.
*
*
* @param o
* The instance to copy.
* @throws NullPointerException
* if {@code o} is {@code null}.
*/
public Schemas(final Schemas o) {
// CC-XJC Version 2.0.1 Build 2012-03-02T12:09:12+0000
super(o);
if (o == null) {
throw new NullPointerException("Cannot create a copy of 'Schemas' from 'null'.");
}
// 'Schema' collection.
if (o.schema!= null) {
copySchema(o.getSchema(), this.getSchema());
}
}
/**
* Gets the value of the schema 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 schema property.
*
*
* For example, to add a new item, do as follows:
*
* getSchema().add(newItem);
*
*
*
*
* Objects of the following type(s) are allowed in the list
* {@link Schema }
*
*
*/
@Generated(value = "com.sun.tools.xjc.Driver", date = "2013-01-04T08:47:18+01:00", comments = "JAXB RI vhudson-jaxb-ri-2.1-2")
public List getSchema() {
if (schema == null) {
schema = new ArrayList();
}
return this.schema;
}
/**
* Copies all values of property {@code Schema} deeply.
*
* @param source
* The source to copy from.
* @param target
* The target to copy {@code source} to.
* @throws NullPointerException
* if {@code target} is {@code null}.
*/
@SuppressWarnings("unchecked")
@Generated(value = "com.sun.tools.xjc.Driver", date = "2013-01-04T08:47:18+01:00", comments = "JAXB RI vhudson-jaxb-ri-2.1-2")
private static void copySchema(final List source, final List target) {
// CC-XJC Version 2.0.1 Build 2012-03-02T12:09:12+0000
if ((source!= null)&&(!source.isEmpty())) {
for (final Iterator> it = source.iterator(); it.hasNext(); ) {
final Object next = it.next();
if (next instanceof Schema) {
// CClassInfo: org.jomc.modlet.Schema
target.add(((Schema) next).clone());
continue;
}
// Please report this at https://apps.sourceforge.net/mantisbt/ccxjc/
throw new AssertionError((("Unexpected instance '"+ next)+"' for property 'Schema' of class 'org.jomc.modlet.Schemas'."));
}
}
}
/**
* Creates and returns a deep copy of this object.
*
*
* @return
* A deep copy of this object.
*/
@Override
@Generated(value = "com.sun.tools.xjc.Driver", date = "2013-01-04T08:47:18+01:00", comments = "JAXB RI vhudson-jaxb-ri-2.1-2")
public Schemas clone() {
{
// CC-XJC Version 2.0.1 Build 2012-03-02T12:09:12+0000
final Schemas clone = ((Schemas) super.clone());
// 'Schema' collection.
if (this.schema!= null) {
clone.schema = null;
copySchema(this.getSchema(), clone.getSchema());
}
return clone;
}
}
/**
* Gets a schema for a given public identifier from the list of schemas.
*
* @param publicId The public identifier of the schema to return.
*
* @return The first matching schema or {@code null}, if no such schema is found.
*
* @throws NullPointerException if {@code publicId} is {@code null}.
*
* @see #getSchema()
* @see Schema#getPublicId()
* @deprecated As of JOMC 1.2, replaced by method {@link #getSchemasByPublicId(java.net.URI)}. This method will be
* removed in version 2.0.
*/
@Deprecated
public Schema getSchemaByPublicId( final String publicId )
{
if ( publicId == null )
{
throw new NullPointerException( "publicId" );
}
for ( int i = 0, s0 = this.getSchema().size(); i < s0; i++ )
{
final Schema s = this.getSchema().get( i );
if ( publicId.equals( s.getPublicId() ) )
{
return s;
}
}
return null;
}
/**
* Gets a schema for a given system identifier from the list of schemas.
*
* @param systemId The system identifier of the schema to return.
*
* @return The first matching schema or {@code null}, if no such schema is found.
*
* @throws NullPointerException if {@code systemId} is {@code null}.
*
* @see #getSchema()
* @see Schema#getSystemId()
*/
public Schema getSchemaBySystemId( final String systemId )
{
if ( systemId == null )
{
throw new NullPointerException( "systemId" );
}
for ( int i = 0, s0 = this.getSchema().size(); i < s0; i++ )
{
final Schema s = this.getSchema().get( i );
if ( systemId.equals( s.getSystemId() ) )
{
return s;
}
}
return null;
}
/**
* Gets a list of schemas for a given public identifier from the list of schemas.
*
* @param publicId The public identifier of the schemas to return.
*
* @return An unmodifiable list of schemas matching {@code publicId} or an empty list, if no such schemas are found.
*
* @throws NullPointerException if {@code publicId} is {@code null}.
*
* @see #getSchema()
* @see Schema#getPublicIdUri()
* @since 1.2
*/
public List getSchemasByPublicId( final java.net.URI publicId )
{
if ( publicId == null )
{
throw new NullPointerException( "publicId" );
}
final List schemas = new ArrayList( this.getSchema().size() );
for ( int i = 0, s0 = this.getSchema().size(); i < s0; i++ )
{
final Schema s = this.getSchema().get( i );
if ( publicId.equals( s.getPublicIdUri() ) )
{
schemas.add( s );
}
}
return java.util.Collections.unmodifiableList( schemas );
}
}