1 17 package com.sun.org.apache.xml.internal.security.signature; 18 19 20 21 import com.sun.org.apache.xml.internal.security.exceptions.XMLSecurityException; 22 import com.sun.org.apache.xml.internal.security.utils.Constants; 23 import com.sun.org.apache.xml.internal.security.utils.IdResolver; 24 import com.sun.org.apache.xml.internal.security.utils.SignatureElementProxy; 25 import org.w3c.dom.Document ; 26 import org.w3c.dom.Element ; 27 import org.w3c.dom.Node ; 28 29 30 38 public class ObjectContainer extends SignatureElementProxy { 39 40 41 static java.util.logging.Logger log = 42 java.util.logging.Logger.getLogger(ObjectContainer.class.getName()); 43 44 49 public ObjectContainer(Document doc) { 50 51 super(doc); 52 } 53 54 61 public ObjectContainer(Element element, String BaseURI) 62 throws XMLSecurityException { 63 64 super(element, BaseURI); 65 } 66 67 72 public void setId(String Id) { 73 74 if ((this._state == MODE_SIGN) && (Id != null)) { 75 this._constructionElement.setAttributeNS(null, Constants._ATT_ID, Id); 76 IdResolver.registerElementById(this._constructionElement, Id); 77 } 78 } 79 80 85 public String getId() { 86 return this._constructionElement.getAttributeNS(null, Constants._ATT_ID); 87 } 88 89 94 public void setMimeType(String MimeType) { 95 96 if ((this._state == MODE_SIGN) && (MimeType != null)) { 97 this._constructionElement.setAttributeNS(null, Constants._ATT_MIMETYPE, 98 MimeType); 99 } 100 } 101 102 107 public String getMimeType() { 108 return this._constructionElement.getAttributeNS(null, Constants._ATT_MIMETYPE); 109 } 110 111 116 public void setEncoding(String Encoding) { 117 118 if ((this._state == MODE_SIGN) && (Encoding != null)) { 119 this._constructionElement.setAttributeNS(null, Constants._ATT_ENCODING, 120 Encoding); 121 } 122 } 123 124 129 public String getEncoding() { 130 return this._constructionElement.getAttributeNS(null, Constants._ATT_ENCODING); 131 } 132 133 139 public Node appendChild(Node node) { 140 141 Node result = null; 142 143 if (this._state == MODE_SIGN) { 144 result = this._constructionElement.appendChild(node); 145 } 146 147 return result; 148 } 149 150 151 public String getBaseLocalName() { 152 return Constants._TAG_OBJECT; 153 } 154 } 155 | Popular Tags |