jdk/src/share/classes/com/sun/org/apache/xml/internal/security/utils/ElementProxy.java
equal
deleted
inserted
replaced
22 |
22 |
23 |
23 |
24 |
24 |
25 import java.math.BigInteger; |
25 import java.math.BigInteger; |
26 import java.util.HashMap; |
26 import java.util.HashMap; |
|
27 import java.util.Map; |
27 |
28 |
28 import com.sun.org.apache.xml.internal.security.exceptions.Base64DecodingException; |
29 import com.sun.org.apache.xml.internal.security.exceptions.Base64DecodingException; |
29 import com.sun.org.apache.xml.internal.security.exceptions.XMLSecurityException; |
30 import com.sun.org.apache.xml.internal.security.exceptions.XMLSecurityException; |
30 import org.w3c.dom.Attr; |
31 import org.w3c.dom.Attr; |
31 import org.w3c.dom.Document; |
32 import org.w3c.dom.Document; |
368 * @param localname |
369 * @param localname |
369 * @param namespace |
370 * @param namespace |
370 * @return the bytes |
371 * @return the bytes |
371 * @throws XMLSecurityException |
372 * @throws XMLSecurityException |
372 */ |
373 */ |
|
374 @Deprecated |
373 public byte[] getBytesFromChildElement(String localname, String namespace) |
375 public byte[] getBytesFromChildElement(String localname, String namespace) |
374 throws XMLSecurityException { |
376 throws XMLSecurityException { |
375 |
377 |
376 Element e = |
378 Element e = |
377 XMLUtils.selectNode( |
379 XMLUtils.selectNode( |
390 * @param namespace |
392 * @param namespace |
391 * @return the Text of the textNode |
393 * @return the Text of the textNode |
392 */ |
394 */ |
393 public String getTextFromChildElement(String localname, String namespace) { |
395 public String getTextFromChildElement(String localname, String namespace) { |
394 |
396 |
395 Text t = |
397 return XMLUtils.selectNode( |
396 (Text) XMLUtils.selectNode( |
398 this._constructionElement.getFirstChild(), |
397 this._constructionElement.getFirstChild(), |
399 namespace, |
398 namespace, |
400 localname, |
399 localname, |
401 0).getFirstChild().getNodeValue(); |
400 0).getFirstChild(); |
402 |
401 |
|
402 return t.getData(); |
|
403 } |
403 } |
404 |
404 |
405 /** |
405 /** |
406 * Method getBytesFromTextChild |
406 * Method getBytesFromTextChild |
407 * |
407 * |
491 this._constructionElement.setAttributeNS(Constants.NamespaceSpecNS, ns, |
491 this._constructionElement.setAttributeNS(Constants.NamespaceSpecNS, ns, |
492 uri); |
492 uri); |
493 } |
493 } |
494 |
494 |
495 /** Field _prefixMappings */ |
495 /** Field _prefixMappings */ |
496 static HashMap _prefixMappings = new HashMap(); |
496 static Map<String, String> _prefixMappings = new HashMap<String,String>(); |
497 static HashMap _prefixMappingsBindings = new HashMap(); |
497 static Map<String, String> _prefixMappingsBindings = new HashMap<String,String>(); |
498 |
498 |
499 /** |
499 /** |
500 * Method setDefaultPrefix |
500 * Method setDefaultPrefix |
501 * |
501 * |
502 * @param namespace |
502 * @param namespace |
531 * |
531 * |
532 * @param namespace |
532 * @param namespace |
533 * @return the default prefix bind to this element. |
533 * @return the default prefix bind to this element. |
534 */ |
534 */ |
535 public static String getDefaultPrefix(String namespace) { |
535 public static String getDefaultPrefix(String namespace) { |
536 return (String) ElementProxy._prefixMappings.get(namespace); |
536 return ElementProxy._prefixMappings.get(namespace); |
537 } |
537 } |
538 |
538 |
539 public static String getDefaultPrefixBindings(String namespace) { |
539 public static String getDefaultPrefixBindings(String namespace) { |
540 return (String) ElementProxy._prefixMappingsBindings.get(namespace); |
540 return ElementProxy._prefixMappingsBindings.get(namespace); |
541 } |
541 } |
542 } |
542 } |