src/share/classes/org/jcp/xml/dsig/internal/dom/DOMSignatureProperty.java

Print this page




 106         if (attr != null) {
 107             id = attr.getValue();
 108             propElem.setIdAttributeNode(attr, true);
 109         } else {
 110             id = null;
 111         }
 112 
 113         NodeList nodes = propElem.getChildNodes();
 114         int length = nodes.getLength();
 115         List<XMLStructure> content = new ArrayList<XMLStructure>(length);
 116         for (int i = 0; i < length; i++) {
 117             content.add(new javax.xml.crypto.dom.DOMStructure(nodes.item(i)));
 118         }
 119         if (content.isEmpty()) {
 120             throw new MarshalException("content cannot be empty");
 121         } else {
 122             this.content = Collections.unmodifiableList(content);
 123         }
 124     }
 125 
 126     public List getContent() {
 127         return content;
 128     }
 129 
 130     public String getId() {
 131         return id;
 132     }
 133 
 134     public String getTarget() {
 135         return target;
 136     }
 137 
 138     public void marshal(Node parent, String dsPrefix, DOMCryptoContext context)
 139         throws MarshalException
 140     {
 141         Document ownerDoc = DOMUtils.getOwnerDocument(parent);
 142         Element propElem = DOMUtils.createElement(ownerDoc, "SignatureProperty",
 143                                                   XMLSignature.XMLNS, dsPrefix);
 144 
 145         // set attributes
 146         DOMUtils.setAttributeID(propElem, "Id", id);




 106         if (attr != null) {
 107             id = attr.getValue();
 108             propElem.setIdAttributeNode(attr, true);
 109         } else {
 110             id = null;
 111         }
 112 
 113         NodeList nodes = propElem.getChildNodes();
 114         int length = nodes.getLength();
 115         List<XMLStructure> content = new ArrayList<XMLStructure>(length);
 116         for (int i = 0; i < length; i++) {
 117             content.add(new javax.xml.crypto.dom.DOMStructure(nodes.item(i)));
 118         }
 119         if (content.isEmpty()) {
 120             throw new MarshalException("content cannot be empty");
 121         } else {
 122             this.content = Collections.unmodifiableList(content);
 123         }
 124     }
 125 
 126     public List<XMLStructure> getContent() {
 127         return content;
 128     }
 129 
 130     public String getId() {
 131         return id;
 132     }
 133 
 134     public String getTarget() {
 135         return target;
 136     }
 137 
 138     public void marshal(Node parent, String dsPrefix, DOMCryptoContext context)
 139         throws MarshalException
 140     {
 141         Document ownerDoc = DOMUtils.getOwnerDocument(parent);
 142         Element propElem = DOMUtils.createElement(ownerDoc, "SignatureProperty",
 143                                                   XMLSignature.XMLNS, dsPrefix);
 144 
 145         // set attributes
 146         DOMUtils.setAttributeID(propElem, "Id", id);