DOMManifest.java revision 2362
/*
* reserved comment block
* DO NOT REMOVE OR ALTER!
*/
/*
* Copyright 2005 The Apache Software Foundation.
*
* Licensed 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
*
*
* 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.
*
*/
/*
*/
/*
* $Id: DOMManifest.java,v 1.2 2008/07/24 15:20:32 mullan Exp $
*/
/**
* DOM-based implementation of Manifest.
*
* @author Sean Mullan
*/
private final List references;
/**
* Creates a <code>DOMManifest</code> containing the specified
* list of {@link Reference}s and optional id.
*
* @param references a list of one or more <code>Reference</code>s. The list
* is defensively copied to protect against subsequent modification.
* @param id the id (may be <code>null</code>
* @throws NullPointerException if <code>references</code> is
* <code>null</code>
* @throws IllegalArgumentException if <code>references</code> is empty
* @throws ClassCastException if <code>references</code> contains any
* entries that are not of type {@link Reference}
*/
if (references == null) {
throw new NullPointerException("references cannot be null");
}
throw new IllegalArgumentException("list of references must " +
"contain at least one entry");
}
throw new ClassCastException
("references["+i+"] is not a valid type");
}
}
}
/**
* Creates a <code>DOMManifest</code> from an element.
*
* @param manElem a Manifest element
*/
}
}
return id;
}
public List getReferences() {
return references;
}
throws MarshalException {
// add references
}
}
if (this == o) {
return true;
}
if (!(o instanceof Manifest)) {
return false;
}
}
}