Package io.higson.runtime.context
Class AppCtx
java.lang.Object
io.higson.runtime.engine.core.context.DefaultContext
io.higson.runtime.core.HigsonContext
io.higson.runtime.context.AppCtx
- All Implemented Interfaces:
ParamContext
- Direct Known Subclasses:
PropertyAdapter
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionTries to resolve given path and return object from the context.static PropertyAdapterResolvergetCollection(String path) getContext(String path) static Objectstatic AppCtxstatic voidregisterAdapter(String type, PropertyAdapterFactory factory) static voidsetAdapterResolver(PropertyAdapterResolver adapterResolver) toString()static voidMethods inherited from class io.higson.runtime.core.HigsonContext
getBoolean, getBooleanHolder, getBooleanType, getDate, getDateHolder, getDatetime, getDatetimeHolder, getDatetimeType, getDateType, getDecimal, getFirst, getInteger, getIntegerHolder, getIntegerType, getLocalDate, getLocalDateHolder, getLocalDatetime, getLocalDatetimeHolder, getLocalDateTimeType, getLocalDateType, getNumber, getNumberHolder, getNumberType, getString, getStringHolder, getStringType, initialize, setMethods inherited from class io.higson.runtime.engine.core.context.DefaultContext
get, get, getLevelValues, has, set, setLevelValues, with, with, withLevelValues, withLevelValues
-
Constructor Details
-
AppCtx
-
AppCtx
-
AppCtx
-
-
Method Details
-
with
-
of
-
of
-
get
Description copied from class:HigsonContextTries to resolve given path and return object from the context. If the object is not found at first try, then method is looking for objects by resolving subPath. SubPath is created by stripping given path (between first occurrence of '.' character) into first token and the rest of the path. If stripping was successful and first token is an existing object in context, then algorithm tries to use it as a subContext for the subPath. The more objects exists in depth in context, the longer it might take to resolve them.
Examples:HigsonContext ctx = new HigsonContext("policy.status", "AA"); Object s1 = ctx.get("policy.status"); // found object Object s2 = ctx.get("policy.info"); // s2 is null here, since there is not object with this path defined in cotext // Sample with parent context and subContext HigsonContext policyCtx = new HigsonContext().set("status", "AA"); HigsonContext ctx = new HigsonContext().set("policy", policyCtx); assertThat(ctx.getString("policy.status"), is("AA")); assertThat(ctx.getString("policy.info"), nullValue()); assertThat(ctx.getString("user.name"), nullValue());- Overrides:
getin classHigsonContext- Parameters:
path- to be resolved when looking for object- Returns:
- object if path was successfully resolved, otherwise null
-
handle
-
handle
-
getAppCtx
-
getContext
-
getCollection
-
sub
-
getAdapterResolver
-
setAdapterResolver
-
registerAdapter
-
unregisterAdapters
public static void unregisterAdapters() -
toString
- Overrides:
toStringin classHigsonContext
-