0N/A/*
2362N/A * Copyright (c) 2005, Oracle and/or its affiliates. All rights reserved.
0N/A * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
0N/A *
0N/A * This code is free software; you can redistribute it and/or modify it
0N/A * under the terms of the GNU General Public License version 2 only, as
2362N/A * published by the Free Software Foundation. Oracle designates this
0N/A * particular file as subject to the "Classpath" exception as provided
2362N/A * by Oracle in the LICENSE file that accompanied this code.
0N/A *
0N/A * This code is distributed in the hope that it will be useful, but WITHOUT
0N/A * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
0N/A * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
0N/A * version 2 for more details (a copy is included in the LICENSE file that
0N/A * accompanied this code).
0N/A *
0N/A * You should have received a copy of the GNU General Public License version
0N/A * 2 along with this work; if not, write to the Free Software Foundation,
0N/A * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
0N/A *
2362N/A * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
2362N/A * or visit www.oracle.com if you need additional information or have any
2362N/A * questions.
0N/A */
0N/A
0N/A/*
0N/A * ===========================================================================
0N/A *
0N/A * (C) Copyright IBM Corp. 2003 All Rights Reserved.
0N/A *
0N/A * ===========================================================================
0N/A */
0N/A/*
0N/A * $Id: XMLObject.java,v 1.5 2005/05/10 16:03:48 mullan Exp $
0N/A */
0N/Apackage javax.xml.crypto.dsig;
0N/A
0N/Aimport java.util.List;
0N/Aimport javax.xml.crypto.XMLStructure;
0N/A
0N/A/**
0N/A * A representation of the XML <code>Object</code> element as defined in
0N/A * the <a href="http://www.w3.org/TR/xmldsig-core/">
0N/A * W3C Recommendation for XML-Signature Syntax and Processing</a>.
0N/A * An <code>XMLObject</code> may contain any data and may include optional
0N/A * MIME type, ID, and encoding attributes. The XML Schema Definition is
0N/A * defined as:
0N/A *
0N/A * <pre><code>
0N/A * &lt;element name="Object" type="ds:ObjectType"/&gt;
0N/A * &lt;complexType name="ObjectType" mixed="true"&gt;
0N/A * &lt;sequence minOccurs="0" maxOccurs="unbounded"&gt;
0N/A * &lt;any namespace="##any" processContents="lax"/&gt;
0N/A * &lt;/sequence&gt;
0N/A * &lt;attribute name="Id" type="ID" use="optional"/&gt;
0N/A * &lt;attribute name="MimeType" type="string" use="optional"/&gt;
0N/A * &lt;attribute name="Encoding" type="anyURI" use="optional"/&gt;
0N/A * &lt;/complexType&gt;
0N/A * </code></pre>
0N/A *
0N/A * A <code>XMLObject</code> instance may be created by invoking the
0N/A * {@link XMLSignatureFactory#newXMLObject newXMLObject} method of the
0N/A * {@link XMLSignatureFactory} class; for example:
0N/A *
0N/A * <pre>
0N/A * XMLSignatureFactory fac = XMLSignatureFactory.getInstance("DOM");
0N/A * List content = Collections.singletonList(fac.newManifest(references)));
0N/A * XMLObject object = factory.newXMLObject(content, "object-1", null, null);
0N/A * </pre>
0N/A *
0N/A * <p>Note that this class is named <code>XMLObject</code> rather than
0N/A * <code>Object</code> to avoid naming clashes with the existing
0N/A * {@link java.lang.Object java.lang.Object} class.
0N/A *
0N/A * @author Sean Mullan
0N/A * @author JSR 105 Expert Group
0N/A * @author Joyce L. Leung
0N/A * @since 1.6
0N/A * @see XMLSignatureFactory#newXMLObject(List, String, String, String)
0N/A */
0N/Apublic interface XMLObject extends XMLStructure {
0N/A
0N/A /**
0N/A * URI that identifies the <code>Object</code> element (this can be
0N/A * specified as the value of the <code>type</code> parameter of the
0N/A * {@link Reference} class to identify the referent's type).
0N/A */
0N/A final static String TYPE = "http://www.w3.org/2000/09/xmldsig#Object";
0N/A
0N/A /**
0N/A * Returns an {@link java.util.Collections#unmodifiableList unmodifiable
0N/A * list} of {@link XMLStructure}s contained in this <code>XMLObject</code>,
0N/A * which represent elements from any namespace.
0N/A *
0N/A *<p>If there is a public subclass representing the type of
0N/A * <code>XMLStructure</code>, it is returned as an instance of that class
0N/A * (ex: a <code>SignatureProperties</code> element would be returned
0N/A * as an instance of {@link javax.xml.crypto.dsig.SignatureProperties}).
0N/A *
0N/A * @return an unmodifiable list of <code>XMLStructure</code>s (may be empty
0N/A * but never <code>null</code>)
0N/A */
0N/A List getContent();
0N/A
0N/A /**
0N/A * Returns the Id of this <code>XMLObject</code>.
0N/A *
0N/A * @return the Id (or <code>null</code> if not specified)
0N/A */
0N/A String getId();
0N/A
0N/A /**
0N/A * Returns the mime type of this <code>XMLObject</code>. The
0N/A * mime type is an optional attribute which describes the data within this
0N/A * <code>XMLObject</code> (independent of its encoding).
0N/A *
0N/A * @return the mime type (or <code>null</code> if not specified)
0N/A */
0N/A String getMimeType();
0N/A
0N/A /**
0N/A * Returns the encoding URI of this <code>XMLObject</code>. The encoding
0N/A * URI identifies the method by which the object is encoded.
0N/A *
0N/A * @return the encoding URI (or <code>null</code> if not specified)
0N/A */
0N/A String getEncoding();
0N/A}