0N/A/*
0N/A * reserved comment block
0N/A * DO NOT REMOVE OR ALTER!
0N/A */
0N/A/*
0N/A * Copyright 1999-2004 The Apache Software Foundation.
0N/A *
0N/A * Licensed under the Apache License, Version 2.0 (the "License");
0N/A * you may not use this file except in compliance with the License.
0N/A * You may obtain a copy of the License at
0N/A *
0N/A * http://www.apache.org/licenses/LICENSE-2.0
0N/A *
0N/A * Unless required by applicable law or agreed to in writing, software
0N/A * distributed under the License is distributed on an "AS IS" BASIS,
0N/A * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
0N/A * See the License for the specific language governing permissions and
0N/A * limitations under the License.
0N/A *
0N/A */
0N/Apackage com.sun.org.apache.xml.internal.security.signature;
0N/A
0N/Aimport com.sun.org.apache.xml.internal.security.exceptions.XMLSecurityException;
0N/Aimport com.sun.org.apache.xml.internal.security.utils.Constants;
0N/Aimport com.sun.org.apache.xml.internal.security.utils.IdResolver;
0N/Aimport com.sun.org.apache.xml.internal.security.utils.SignatureElementProxy;
0N/Aimport org.w3c.dom.Document;
0N/Aimport org.w3c.dom.Element;
0N/Aimport org.w3c.dom.Node;
0N/A
0N/A
0N/A/**
0N/A * Handles <code>&lt;ds:Object&gt;</code> elements
0N/A * <code>Object<code> {@link Element} supply facility which can contain any kind data
0N/A *
0N/A * @author Christian Geuer-Pollmann
0N/A * $todo$ if we remove childen, the boolean values are not updated
0N/A */
0N/Apublic class ObjectContainer extends SignatureElementProxy {
0N/A
0N/A /**
0N/A * Constructs {@link ObjectContainer}
0N/A *
0N/A * @param doc the {@link Document} in which <code>Object</code> element is placed
0N/A */
0N/A public ObjectContainer(Document doc) {
0N/A
0N/A super(doc);
0N/A }
0N/A
0N/A /**
0N/A * Constructs {@link ObjectContainer} from {@link Element}
0N/A *
0N/A * @param element is <code>Object</code> element
0N/A * @param BaseURI the URI of the resource where the XML instance was stored
0N/A * @throws XMLSecurityException
0N/A */
0N/A public ObjectContainer(Element element, String BaseURI)
0N/A throws XMLSecurityException {
0N/A
0N/A super(element, BaseURI);
0N/A }
0N/A
0N/A /**
0N/A * Sets the <code>Id</code> attribute
0N/A *
0N/A * @param Id <code>Id</code> attribute
0N/A */
0N/A public void setId(String Id) {
0N/A
6385N/A if (Id != null) {
6385N/A setLocalIdAttribute(Constants._ATT_ID, Id);
0N/A }
0N/A }
0N/A
0N/A /**
0N/A * Returns the <code>Id</code> attribute
0N/A *
0N/A * @return the <code>Id</code> attribute
0N/A */
0N/A public String getId() {
0N/A return this._constructionElement.getAttributeNS(null, Constants._ATT_ID);
0N/A }
0N/A
0N/A /**
0N/A * Sets the <code>MimeType</code> attribute
0N/A *
0N/A * @param MimeType the <code>MimeType</code> attribute
0N/A */
0N/A public void setMimeType(String MimeType) {
0N/A
661N/A if ( (MimeType != null)) {
0N/A this._constructionElement.setAttributeNS(null, Constants._ATT_MIMETYPE,
0N/A MimeType);
0N/A }
0N/A }
0N/A
0N/A /**
0N/A * Returns the <code>MimeType</code> attribute
0N/A *
0N/A * @return the <code>MimeType</code> attribute
0N/A */
0N/A public String getMimeType() {
0N/A return this._constructionElement.getAttributeNS(null, Constants._ATT_MIMETYPE);
0N/A }
0N/A
0N/A /**
0N/A * Sets the <code>Encoding</code> attribute
0N/A *
0N/A * @param Encoding the <code>Encoding</code> attribute
0N/A */
0N/A public void setEncoding(String Encoding) {
0N/A
661N/A if ((Encoding != null)) {
0N/A this._constructionElement.setAttributeNS(null, Constants._ATT_ENCODING,
0N/A Encoding);
0N/A }
0N/A }
0N/A
0N/A /**
0N/A * Returns the <code>Encoding</code> attribute
0N/A *
0N/A * @return the <code>Encoding</code> attribute
0N/A */
0N/A public String getEncoding() {
0N/A return this._constructionElement.getAttributeNS(null, Constants._ATT_ENCODING);
0N/A }
0N/A
0N/A /**
661N/A * Adds child Node
0N/A *
661N/A * @param node child Node
0N/A * @return the new node in the tree.
0N/A */
0N/A public Node appendChild(Node node) {
0N/A
0N/A Node result = null;
0N/A
661N/A result = this._constructionElement.appendChild(node);
0N/A
0N/A return result;
0N/A }
0N/A
0N/A /** @inheritDoc */
0N/A public String getBaseLocalName() {
0N/A return Constants._TAG_OBJECT;
0N/A }
0N/A}