public class ParserContext
extends java.lang.Object
MaskFactory
).
By default, isRestricted()
will return true.
Constructor and Description |
---|
ParserContext()
Create a new instance.
|
ParserContext(ParserContext other)
Creates a copy of another instance.
|
Modifier and Type | Method and Description |
---|---|
Actor |
getActor()
Get the
Actor set on this context. |
Extent |
getExtent()
Get the
Extent set on this context. |
LocalSession |
getSession()
Get the
LocalSession . |
World |
getWorld()
Get the
World set on this context. |
boolean |
isPreferringWildcard()
Get whether wildcards are preferred.
|
boolean |
isRestricted()
Returns whether there should be restrictions (as a result of
limits or permissions) considered when parsing the input.
|
boolean |
isTryingLegacy()
Get whether legacy IDs should be tried.
|
Actor |
requireActor()
Get the
Actor set on this context. |
Extent |
requireExtent()
Get the
Extent set on this context. |
LocalSession |
requireSession()
Get the
LocalSession . |
World |
requireWorld()
Get the
World set on this context. |
void |
setActor(Actor actor)
Set the actor.
|
void |
setExtent(Extent extent)
Set the extent.
|
void |
setPreferringWildcard(boolean preferringWildcard)
Set whether wildcards are preferred.
|
void |
setRestricted(boolean restricted)
Set whether there should be restrictions (as a result of
limits or permissions) considered when parsing the input.
|
void |
setSession(LocalSession session)
Set the session.
|
void |
setTryLegacy(boolean tryLegacy)
Set whether legacy IDs should be attempted.
|
void |
setWorld(World world)
Set the world.
|
public ParserContext()
public ParserContext(ParserContext other)
other
- the other instance@Nullable public Extent getExtent()
Extent
set on this context.public void setExtent(@Nullable Extent extent)
extent
- an extent, or null if none is available@Nullable public LocalSession getSession()
LocalSession
.public void setSession(@Nullable LocalSession session)
session
- a session, or null if none is availablepublic void setWorld(@Nullable World world)
world
- a world, or null if none is available@Nullable public Actor getActor()
Actor
set on this context.public void setActor(@Nullable Actor actor)
actor
- an actor, or null if none is availablepublic Extent requireExtent() throws InputParseException
Extent
set on this context.InputParseException
- thrown if no Extent
is setpublic LocalSession requireSession() throws InputParseException
LocalSession
.InputParseException
- thrown if no LocalSession
is setpublic World requireWorld() throws InputParseException
World
set on this context.InputParseException
- thrown if no World
is setpublic Actor requireActor() throws InputParseException
Actor
set on this context.InputParseException
- thrown if no Actor
is setpublic boolean isRestricted()
public void setRestricted(boolean restricted)
restricted
- true if restrictedpublic boolean isPreferringWildcard()
public void setPreferringWildcard(boolean preferringWildcard)
preferringWildcard
- true if wildcards are preferredpublic void setTryLegacy(boolean tryLegacy)
tryLegacy
- true if legacy IDs should be attemptedpublic boolean isTryingLegacy()