Package com.blackrook.archetext
Class ArcheTextRoot
- java.lang.Object
-
- com.blackrook.archetext.ArcheTextRoot
-
public class ArcheTextRoot extends Object
The root of an ArcheText Hierarchy. This is an object that contains other objects.- Author:
- Matthew Tropiano
-
-
Constructor Summary
Constructors Constructor Description ArcheTextRoot()
Creates a new root.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
add(ArcheTextObject object)
Adds an object.<T> T[]
exportByType(String type, Class<T> outputType)
Returns all ArcheTextObjects of a particular type exported as POJOs.ArcheTextObject
get(String type)
Gets a default object by type.ArcheTextObject
get(String type, String name)
Gets an object by type and name.ArcheTextObject[]
getAllByType(String type)
Returns all ArcheTextObjects of a particular type.String[]
getTypes()
boolean
remove(ArcheTextObject object)
Removes an ArcheText object from this root.
-
-
-
Method Detail
-
get
public ArcheTextObject get(String type)
Gets a default object by type.- Parameters:
type
- object type.- Returns:
- the corresponding object, or null if no default.
-
get
public ArcheTextObject get(String type, String name)
Gets an object by type and name. Empty name is default.- Parameters:
type
- object type.name
- object name.- Returns:
- the corresponding object, or null if not found.
-
getTypes
public String[] getTypes()
- Returns:
- all types that this root contains.
-
getAllByType
public ArcheTextObject[] getAllByType(String type)
Returns all ArcheTextObjects of a particular type.- Parameters:
type
- the type name.- Returns:
- all of the relevant objects found as an array. Never null.
-
exportByType
public <T> T[] exportByType(String type, Class<T> outputType)
Returns all ArcheTextObjects of a particular type exported as POJOs.- Type Parameters:
T
- the return type.- Parameters:
type
- the type name.outputType
- the output class type.- Returns:
- all of the relevant objects found as an array. Never null.
-
add
public void add(ArcheTextObject object)
Adds an object.- Parameters:
object
- the object to add.
-
remove
public boolean remove(ArcheTextObject object)
Removes an ArcheText object from this root.- Parameters:
object
- the object to remove.- Returns:
- true if removed, false if not.
-
-