本文整理汇总了Java中org.omg.CORBA.CustomMarshal类的典型用法代码示例。如果您正苦于以下问题:Java CustomMarshal类的具体用法?Java CustomMarshal怎么用?Java CustomMarshal使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
CustomMarshal类属于org.omg.CORBA包,在下文中一共展示了CustomMarshal类的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: writeIDLValue
import org.omg.CORBA.CustomMarshal; //导入依赖的package包/类
private void writeIDLValue(Serializable object, String repID)
{
if (object instanceof StreamableValue) {
((StreamableValue)object)._write(parent);
} else if (object instanceof CustomValue) {
((CustomValue)object).marshal(parent);
} else {
BoxedValueHelper helper = Utility.getHelper(object.getClass(), null, repID);
boolean isCustom = false;
if (helper instanceof ValueHelper && object instanceof CustomMarshal) {
try {
if (((ValueHelper)helper).get_type().type_modifier() == VM_CUSTOM.value)
isCustom = true;
} catch(BadKind ex) {
throw wrapper.badTypecodeForCustomValue( CompletionStatus.COMPLETED_MAYBE,
ex ) ;
}
}
if (isCustom)
((CustomMarshal)object).marshal(parent);
else
helper.write_value(parent, object);
}
}
示例2: writeSelf
import org.omg.CORBA.CustomMarshal; //导入依赖的package包/类
/**
* Try to write value supposing that it implements self-streamable interfaces.
* Return false if it does not or true on success.
*/
static boolean writeSelf(OutputStream output, Serializable value)
{
// User defined write method is present.
if (value instanceof CustomMarshal)
{
((CustomMarshal) value).marshal((DataOutputStream) output);
return true;
}
else if (value instanceof Streamable)
{
((Streamable) value)._write(output);
return true;
}
return false;
}
示例3: isCustomMarshaled
import org.omg.CORBA.CustomMarshal; //导入依赖的package包/类
/**
* Checks if an instance of this class can write its fields itself.
*/
public boolean isCustomMarshaled(Class clz)
{
return CustomMarshal.class.isAssignableFrom(clz)
|| Streamable.class.isAssignableFrom(clz);
}