本文整理汇总了Java中com.caucho.hessian.io.AbstractHessianOutput.writeNull方法的典型用法代码示例。如果您正苦于以下问题:Java AbstractHessianOutput.writeNull方法的具体用法?Java AbstractHessianOutput.writeNull怎么用?Java AbstractHessianOutput.writeNull使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类com.caucho.hessian.io.AbstractHessianOutput
的用法示例。
在下文中一共展示了AbstractHessianOutput.writeNull方法的7个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: writeObject
import com.caucho.hessian.io.AbstractHessianOutput; //导入方法依赖的package包/类
@Override
public void writeObject(Object obj, AbstractHessianOutput out) throws IOException {
if(out.addRef(obj)) {
return;
}
@SuppressWarnings("unchecked")
SoftReference<Object> data=(SoftReference<Object>)obj;
int refV=out.writeObjectBegin(SoftReference.class.getName());
if(refV == -1) {
out.writeInt(1);
out.writeString("ref");
out.writeObjectBegin(SoftReference.class.getName());
}
if(data != null) {
Object ref=data.get();
if(null != ref) {
out.writeObject(ref);
} else {
out.writeNull();
}
} else {
out.writeNull();
}
}
示例2: write
import com.caucho.hessian.io.AbstractHessianOutput; //导入方法依赖的package包/类
void write(AbstractHessianOutput out, Sort.Order order) throws IOException {
if (order.getDirection() == null) {
out.writeNull();
}
else {
out.writeString(order.getDirection().name());
}
out.writeString(order.getProperty());
out.writeBoolean(order.isIgnoreCase());
if (order.getNullHandling() == null) {
out.writeNull();
}
else {
out.writeString(order.getNullHandling().name());
}
}
示例3: writeObject
import com.caucho.hessian.io.AbstractHessianOutput; //导入方法依赖的package包/类
@Override
public void writeObject(Object obj, AbstractHessianOutput out) throws IOException {
if(out.addRef(obj)) {
return;
}
@SuppressWarnings("unchecked")
WeakReference<Object> data=(WeakReference<Object>)obj;
int refV=out.writeObjectBegin(WeakReference.class.getName());
if(refV == -1) {
out.writeInt(1);
out.writeString("ref");
out.writeObjectBegin(WeakReference.class.getName());
}
if(data != null) {
Object ref=data.get();
if(null != ref) {
out.writeObject(ref);
} else {
out.writeNull();
}
} else {
out.writeNull();
}
}
示例4: writeObject
import com.caucho.hessian.io.AbstractHessianOutput; //导入方法依赖的package包/类
@Override
public void writeObject(Object obj, AbstractHessianOutput out) throws IOException {
if (obj == null)
out.writeNull();
else {
Class<?> cl = obj.getClass();
if (out.addRef(obj)) return;
int ref = out.writeObjectBegin(cl.getName());
Pageable dest = (Pageable) obj;
if (ref < -1) {
out.writeString("value");
write(out, dest);
out.writeMapEnd();
}
else {
if (ref == -1) {
out.writeInt(1);
out.writeString("value");
out.writeObjectBegin(cl.getName());
}
write(out, dest);
}
}
}
示例5: writeObject
import com.caucho.hessian.io.AbstractHessianOutput; //导入方法依赖的package包/类
@Override
public void writeObject(Object obj, AbstractHessianOutput out) throws IOException {
if (obj == null)
out.writeNull();
else {
Class<?> cl = obj.getClass();
if (out.addRef(obj)) return;
int ref = out.writeObjectBegin(cl.getName());
Sort.Order order = (Sort.Order) obj;
if (ref < -1) {
out.writeString("value");
write(out, order);
out.writeMapEnd();
}
else {
if (ref == -1) {
out.writeInt(1);
out.writeString("value");
out.writeObjectBegin(cl.getName());
}
write(out, order);
}
}
}
示例6: writeObject
import com.caucho.hessian.io.AbstractHessianOutput; //导入方法依赖的package包/类
@Override
public void writeObject(Object obj, AbstractHessianOutput out) throws IOException {
if (obj == null)
out.writeNull();
else {
Class<?> cl = obj.getClass();
if (out.addRef(obj)) return;
int ref = out.writeObjectBegin(cl.getName());
Sort dest = (Sort) obj;
if (ref < -1) {
out.writeString("value");
write(out, dest);
out.writeMapEnd();
}
else {
if (ref == -1) {
out.writeInt(1);
out.writeString("value");
out.writeObjectBegin(cl.getName());
}
write(out, dest);
}
}
}
示例7: writeObject
import com.caucho.hessian.io.AbstractHessianOutput; //导入方法依赖的package包/类
@Override
public void writeObject(Object obj, AbstractHessianOutput out) throws IOException {
if (obj == null) {
out.writeNull();
} else {
if (out.addRef(obj)) {
return;
}
Class<?> cl = obj.getClass();
int ref = out.writeObjectBegin(cl.getName());
if (ref < -1) {
out.writeString("value");
out.writeString(jodaObjectToString(obj));
out.writeMapEnd();
} else {
if (ref == -1) {
out.writeInt(1);
out.writeString("value");
out.writeObjectBegin(cl.getName());
}
out.writeString(jodaObjectToString(obj));
}
}
}