當前位置: 首頁>>代碼示例>>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;未經允許,請勿轉載。