public class GsonLoader extends Object
Gson
.Constructor and Description |
---|
GsonLoader(Gson gson,
Plugin plugin) |
Modifier and Type | Method and Description |
---|---|
<T> T |
load(File file,
Type klass)
Loads the given resource.
|
<T> T |
load(File file,
TypeToken<T> typeToken)
Loads the given resource.
|
<T> T |
loadOrCreate(String filename,
Class<T> klass)
Loads if exists or creates the given resource.
|
<T> T |
loadOrCreate(String filename,
TypeToken<T> typeToken)
Loads if exists or creates the given resource.
|
void |
write(String filename,
Object instance)
Writes the given resource.
|
public GsonLoader(Gson gson, Plugin plugin)
public <T> T loadOrCreate(String filename, Class<T> klass) throws GsonLoadException
GsonLoadException
public <T> T loadOrCreate(String filename, TypeToken<T> typeToken) throws GsonLoadException
GsonLoadException
public <T> T load(File file, Type klass) throws GsonLoadException
GsonLoadException
public <T> T load(File file, TypeToken<T> typeToken) throws GsonLoadException
GsonLoadException
public void write(String filename, Object instance) throws GsonLoadException
GsonLoadException
Copyright © 2012. All Rights Reserved.