当前位置: 首页>>代码示例>>Java>>正文


Java Fields类代码示例

本文整理汇总了Java中ch.njol.yggdrasil.Fields的典型用法代码示例。如果您正苦于以下问题:Java Fields类的具体用法?Java Fields怎么用?Java Fields使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。


Fields类属于ch.njol.yggdrasil包,在下文中一共展示了Fields类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: deserialize

import ch.njol.yggdrasil.Fields; //导入依赖的package包/类
@Override
protected JavaType deserialize(Fields fields) throws StreamCorruptedException,
    NotSerializableException {
  try {
    return new JavaType(LibraryLoader.getClassLoader().loadClass((String) fields.getObject("type")));
  } catch (ClassNotFoundException e) {
    throw new NotSerializableException();
  }
}
 
开发者ID:btk5h,项目名称:skript-mirror,代码行数:10,代码来源:Types.java

示例2: deserialize

import ch.njol.yggdrasil.Fields; //导入依赖的package包/类
@Override
public void deserialize(final Fields fields) throws StreamCorruptedException, NotSerializableException {
	final String codeName = fields.getAndRemoveObject("info.codeName", String.class);
	for (final SimpleEntityDataInfo i : types) {
		if (i.codeName.equals(codeName)) {
			info = i;
			super.deserialize(fields);
			return;
		}
	}
	throw new StreamCorruptedException("Invalid SimpleEntityDataInfo code name " + codeName);
}
 
开发者ID:nfell2009,项目名称:Skript,代码行数:13,代码来源:SimpleEntityData.java

示例3: serialize

import ch.njol.yggdrasil.Fields; //导入依赖的package包/类
@SuppressWarnings("null")
@Override
public Fields serialize() {
	final Fields f = new Fields();
	f.putPrimitive("id", claim.getID());
	return f;
}
 
开发者ID:nfell2009,项目名称:Skript,代码行数:8,代码来源:GriefPreventionHook.java

示例4: deserialize

import ch.njol.yggdrasil.Fields; //导入依赖的package包/类
@Override
public void deserialize(final Fields fields) throws StreamCorruptedException {
	final long id = fields.getPrimitive("id", long.class);
	final Claim c = getClaim(id);
	if (c == null)
		throw new StreamCorruptedException("Invalid claim " + id);
	claim = c;
}
 
开发者ID:nfell2009,项目名称:Skript,代码行数:9,代码来源:GriefPreventionHook.java

示例5: deserialize

import ch.njol.yggdrasil.Fields; //导入依赖的package包/类
@Override
public void deserialize(final Fields fields) throws StreamCorruptedException, NotSerializableException {
	final String r = fields.getAndRemoveObject("region", String.class);
	fields.setFields(this);
	final ProtectedRegion region = plugin.getRegionManager(world).getRegion(r);
	if (region == null)
		throw new StreamCorruptedException("Invalid region " + r + " in world " + world);
	this.region = region;
}
 
开发者ID:nfell2009,项目名称:Skript,代码行数:10,代码来源:WorldGuardHook.java

示例6: serialize

import ch.njol.yggdrasil.Fields; //导入依赖的package包/类
@Override
public Fields serialize() throws NotSerializableException {
	final Fields f = new Fields(this);
	// both are serialisable with Yggdrasil
	f.putObject("enchantments", enchantments);
	f.putObject("meta", meta);
	return f;
}
 
开发者ID:nfell2009,项目名称:Skript,代码行数:9,代码来源:ItemType.java

示例7: deserialize

import ch.njol.yggdrasil.Fields; //导入依赖的package包/类
@Override
public void deserialize(final Fields fields) throws StreamCorruptedException, NotSerializableException {
	enchantments = fields.getAndRemoveObject("enchantments", Map.class);
	meta = fields.getAndRemoveObject("meta", Object.class);
	if (meta != null && !(meta instanceof ItemMeta))
		throw new StreamCorruptedException();
	fields.setFields(this);
}
 
开发者ID:nfell2009,项目名称:Skript,代码行数:9,代码来源:ItemType.java

示例8: deserialize

import ch.njol.yggdrasil.Fields; //导入依赖的package包/类
@Override
public void deserialize(final T o, final Fields f) throws StreamCorruptedException, NotSerializableException {
	if (o instanceof YggdrasilExtendedSerializable)
		((YggdrasilExtendedSerializable) o).deserialize(f);
	else
		f.setFields(o);
}
 
开发者ID:nfell2009,项目名称:Skript,代码行数:8,代码来源:YggdrasilSerializer.java

示例9: deserialize

import ch.njol.yggdrasil.Fields; //导入依赖的package包/类
@SuppressWarnings({"unchecked", "null"})
@Override
public <E extends T> E deserialize(final Class<E> c, final Fields fields) throws StreamCorruptedException, NotSerializableException {
	final ClassInfo<? extends T> info = this.info;
	assert info != null;
	assert info.getC().isAssignableFrom(c);
	return (E) deserialize(fields);
}
 
开发者ID:nfell2009,项目名称:Skript,代码行数:9,代码来源:Serializer.java

示例10: deserialize

import ch.njol.yggdrasil.Fields; //导入依赖的package包/类
@SuppressWarnings("null")
@Override
protected T deserialize(final Fields fields) throws StreamCorruptedException {
	final String val = fields.getObject("value", String.class);
	if (val == null)
		throw new StreamCorruptedException();
	final ClassInfo<? extends T> info = this.info;
	assert info != null;
	final T t = deserializeCS(val, info.getC());
	if (t == null)
		throw new StreamCorruptedException();
	return t;
}
 
开发者ID:nfell2009,项目名称:Skript,代码行数:14,代码来源:ConfigurationSerializer.java

示例11: serialize

import ch.njol.yggdrasil.Fields; //导入依赖的package包/类
@Override
public Fields serialize(JavaType cls) throws NotSerializableException {
  Fields f = new Fields();
  f.putObject("type", cls.getJavaClass().getName());
  return f;
}
 
开发者ID:btk5h,项目名称:skript-mirror,代码行数:7,代码来源:Types.java

示例12: serialize

import ch.njol.yggdrasil.Fields; //导入依赖的package包/类
@Override
public Fields serialize() throws NotSerializableException {
	return new Fields(this);
}
 
开发者ID:nfell2009,项目名称:Skript,代码行数:5,代码来源:EntityData.java

示例13: deserialize

import ch.njol.yggdrasil.Fields; //导入依赖的package包/类
@Override
public void deserialize(final Fields fields) throws StreamCorruptedException, NotSerializableException {
	fields.setFields(this);
}
 
开发者ID:nfell2009,项目名称:Skript,代码行数:5,代码来源:EntityData.java

示例14: serialize

import ch.njol.yggdrasil.Fields; //导入依赖的package包/类
@Override
public Fields serialize() throws NotSerializableException {
	final Fields f = super.serialize();
	f.putObject("info.codeName", info.codeName);
	return f;
}
 
开发者ID:nfell2009,项目名称:Skript,代码行数:7,代码来源:SimpleEntityData.java

示例15: serialize

import ch.njol.yggdrasil.Fields; //导入依赖的package包/类
@Override
public Fields serialize() throws NotSerializableException {
	final Fields f = new Fields(this);
	f.putObject("region", region.getId());
	return f;
}
 
开发者ID:nfell2009,项目名称:Skript,代码行数:7,代码来源:WorldGuardHook.java


注:本文中的ch.njol.yggdrasil.Fields类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。