我正在反序列化
the MPEG Dash schema
使用jaxb2。
Java类的生成非常有效,但是Dash清单中的部分信息丢失了。即,包含在
ContentProtection
要素看起来像这样:
<ContentProtection schemeIdUri="urn:uuid:SomeIdHash" value="PlayReady">
<cenc:pssh>Base64EncodedBlob</cenc:pssh>
<mspr:pro>Base64EncodedBlob</mspr:pro>
</ContentProtection>
默认模式将内部字段抛出到
DescriptorType
使用类
@XmlAnyElement
产生如下对象列表的注释:
[[cenc:pssh: null], [mspr:pro: null]]
为了解决这个问题,我为
内容保护
像这样:
<jxb:bindings node="//xs:complexType[@name='RepresentationBaseType']/xs:sequence/xs:element[@name='ContentProtection']">
<jxb:class ref="com.jmeter.protocol.dash.sampler.ContentProtection"/>
</jxb:bindings>
然而,我还没有接近
Base64EncodedBlob
中包含的信息。我不知道如何在自定义类中设置注释以正确构造列表。这就是我所尝试的。
//@XmlAnyElement(lax = true) //[[cenc:pssh: null], [mspr:pro: null]]
// @XmlJavaTypeAdapter(Pssh.class) //DOESNT WORK
// @XmlValue //Empty List???
// @XmlSchemaType(name = "pssh")
// @XmlElementRef(name = "pssh") //Not matching annotations
// @XmlElement(name = "enc:pssh") //Not matching annotations
protected List<Pssh> pssh;
public List<Pssh> getPssh() {
if (pssh == null) {
pssh = new ArrayList<Pssh>();
}
return this.pssh;
}
我的Pssh课程看起来像:
package com.jmeter.protocol.dash.sampler;
import javax.xml.bind.annotation.XmlElement;
import javax.xml.bind.annotation.XmlRootElement;
import javax.xml.bind.annotation.XmlType;
@XmlType(name = "enc:pssh")
@XmlRootElement(name = "cenc:pssh")
public class Pssh {
private String psshValue;
public String getPsshValue() {
return psshValue;
}
public void setPsshValue(String psshValue) {
this.psshValue = psshValue;
}
}
我可以做些什么来列出
Pssh
对象是用base64 blob而不是null构建的?