本文整理汇总了Java中org.apache.xerces.impl.dv.util.HexBin类的典型用法代码示例。如果您正苦于以下问题:Java HexBin类的具体用法?Java HexBin怎么用?Java HexBin使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
HexBin类属于org.apache.xerces.impl.dv.util包,在下文中一共展示了HexBin类的7个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: getActualValue
import org.apache.xerces.impl.dv.util.HexBin; //导入依赖的package包/类
public Object getActualValue(String content, ValidationContext context) throws InvalidDatatypeValueException {
byte[] decoded = HexBin.decode(content);
if (decoded == null)
throw new InvalidDatatypeValueException("cvc-datatype-valid.1.2.1", new Object[]{content, "hexBinary"});
return new XHex(decoded);
}
示例2: unparse
import org.apache.xerces.impl.dv.util.HexBin; //导入依赖的package包/类
/**
* Convert a value of this datatype out
* to lexical form.
*/
@Override
public String unparse(Object value) {
if (value instanceof byte[]) {
return HexBin.encode((byte[])value);
} else {
throw new DatatypeFormatException("hexBinary asked to encode a non-byte arrary");
}
}
示例3: getActualValue
import org.apache.xerces.impl.dv.util.HexBin; //导入依赖的package包/类
@Override
public Object getActualValue(String content)
throws XSDBuiltinTypeFormatException {
byte[] decoded = HexBin.decode(content);
if(decoded == null) throw new XSDBuiltinTypeFormatException(content, "invalid HEXBIN value");
return decoded;
}
示例4: ReviewStatus
import org.apache.xerces.impl.dv.util.HexBin; //导入依赖的package包/类
public ReviewStatus(Review review, User reviewer, String reviewComment, boolean completed, byte[] coverage, Date created, Date modified) {
this.review = review;
this.reviewer = reviewer;
this.reviewComment = reviewComment;
this.completed = completed;
this.coverage = HexBin.encode(coverage);
this.created = created;
this.modified = modified;
}
示例5: toString
import org.apache.xerces.impl.dv.util.HexBin; //导入依赖的package包/类
public synchronized String toString() {
if (canonical == null) {
canonical = HexBin.encode(data);
}
return canonical;
}
示例6: getCoverage
import org.apache.xerces.impl.dv.util.HexBin; //导入依赖的package包/类
public byte[] getCoverage() {
if (coverageCache == null) {
coverageCache = HexBin.decode(coverage);
}
return coverageCache;
}
示例7: setCoverage
import org.apache.xerces.impl.dv.util.HexBin; //导入依赖的package包/类
public void setCoverage(byte[] coverage) {
coverageCache = coverage;
this.coverage = HexBin.encode(coverage);
}