public interface XMLObject extends XMLStructure
Object元素的表示 。
XMLObject可以包含任何数据,并且可以包括可选的MIME类型,ID和编码属性。
XML模式定义定义为:
<element name="Object" type="ds:ObjectType"/> <complexType name="ObjectType" mixed="true"> <sequence minOccurs="0" maxOccurs="unbounded"> <any namespace="##any" processContents="lax"/> </sequence> <attribute name="Id" type="ID" use="optional"/> <attribute name="MimeType" type="string" use="optional"/> <attribute name="Encoding" type="anyURI" use="optional"/> </complexType>
可以通过调用XMLSignatureFactory类的newXMLObject方法创建一个XMLObject实例;
例如:
XMLSignatureFactory fac = XMLSignatureFactory.getInstance("DOM");
List content = Collections.singletonList(fac.newManifest(references)));
XMLObject object = factory.newXMLObject(content, "object-1", null, null);
请注意,此类名称为XMLObject而不是Object ,以避免与现有的java.lang.Object类命名冲突。
XMLSignatureFactory.newXMLObject(List, String, String, String)
| Modifier and Type | Field and Description |
|---|---|
static String |
TYPE
标识 Object元素的URI(可以指定为Reference类的type参数的值,以确定指示物的类型)。
|
| Modifier and Type | Method and Description |
|---|---|
List |
getContent()
|
String |
getEncoding()
返回此
XMLObject的编码URI。
|
String |
getId()
返回此
XMLObject的ID。
|
String |
getMimeType()
返回这个
XMLObject的MIME类型。
|
isFeatureSupportedstatic final String TYPE
Object元件(这可以被指定为值type所述的参数Reference类来识别引用的类型)。
List getContent()
XMLStructure的XMLObject ,它们代表任何命名空间中的元素。
如果有代表的类型的公共子类XMLStructure ,则返回为类的一个实例(例如:一个SignatureProperties元素将被返回的实例SignatureProperties )。
XMLStructure S(可能是空的,但从来没有
null )
String getId()
XMLObject的ID。
null如果未指定)
String getMimeType()
XMLObject的MIME类型。
mime类型是一个可选属性,用于描述此XMLObject内的数据(与其编码无关)。
null如果未指定)
String getEncoding()
XMLObject的编码URI。
编码URI标识对象被编码的方法。
null if not specified)
Submit a bug or feature
For further API reference and developer documentation, see Java SE Documentation. That documentation contains more detailed, developer-targeted descriptions, with conceptual overviews, definitions of terms, workarounds, and working code examples.
Copyright © 1993, 2014, Oracle and/or its affiliates. All rights reserved.