public class PropertyCompiler extends Object implements IPropertyCompiler
IProperty prop = PropertyCompiler.COMPILER.compile("prop.subProp.finalProp");
IPropertyCompiler
.Modifier and Type | Class and Description |
---|---|
protected static class |
PropertyCompiler.DefaultPropertyFactory |
protected static class |
PropertyCompiler.IPropertyComponent
Internal use only.
|
static interface |
PropertyCompiler.IPropertyFactory
Defines methods allowing to instantiate properties.
|
protected static class |
PropertyCompiler.SecuredPropertyFactory |
protected class |
PropertyCompiler.SecurePropertyCompiler
Internal use only.
|
Modifier | Constructor and Description |
---|---|
protected |
PropertyCompiler()
Declared as protected, as this compiler might be overridden to add some functionalities.
|
Modifier and Type | Method and Description |
---|---|
IProperty |
compile(String property)
Compiles a property into a compiled representation, with useCommonBeanUtilsSyntax to false.
|
IProperty |
compile(String property,
boolean useCommonBeanUtilsSyntax)
Compiles a property into a compiled representation.
|
protected PropertyCompiler.IPropertyFactory |
createPropertyFactory()
Might be overridden to change secured
PropertyCompiler.IPropertyFactory implementation. |
static IPropertyCompiler |
getInstance() |
protected PropertyCompiler.IPropertyFactory |
getPropertyFactory() |
protected IPropertyCompiler |
getSecureCompiler(MRulesUtilsSecurityManager securityManager)
Might be overridden to change secured
IPropertyCompiler implementation. |
protected PropertyCompiler.IPropertyComponent |
handleGetterSetterComponent(PropertyCompiler.IPropertyComponent prevComponent,
String property,
boolean useCommonBeanUtilsSyntax) |
protected PropertyCompiler.IPropertyComponent |
handleSimpleComponent(PropertyCompiler.IPropertyComponent prevComponent,
String property,
boolean useCommonBeanUtilsSyntax)
Handles a simple property component, i.e. a single element of the List provided
by
splitIntoSimpleComponents(String) . |
protected PropertyCompiler.IPropertyComponent |
handleStaticComponent(PropertyCompiler.IPropertyComponent prevComponent,
String property,
boolean useCommonBeanUtilsSyntax)
parses a static access property (field or method).
|
protected PropertyCompiler.IPropertyComponent |
handleStrictComponent(PropertyCompiler.IPropertyComponent prevComponent,
String property,
boolean useCommonBeanUtilsSyntax)
parses a strict access property (field or method).
|
IProperty |
secureCompile(String property)
Compiles a property into a compiled representation,
with useCommonBeanUtilsSyntax to false and checking against current default MRulesUtilsSecurityManager configuration
if the operations performed by the compiled property are allowed.
|
IProperty |
secureCompile(String property,
MRulesUtilsSecurityManager securityManager)
Compiles a property into a compiled representation,
with useCommonBeanUtilsSyntax to false and checking against provider MRulesUtilsSecurityManager configuration
if the operations performed by the compiled property are allowed.
|
protected List<String> |
splitIntoSimpleComponents(String property)
Splits the property into sub-components, splitting all "main" dots.
|
protected PropertyCompiler()
public static IPropertyCompiler getInstance()
public IProperty compile(String property) throws UtilsException
IPropertyCompiler
compile
in interface IPropertyCompiler
UtilsException
public IProperty secureCompile(String property) throws UtilsException
IPropertyCompiler
secureCompile
in interface IPropertyCompiler
UtilsException
public IProperty secureCompile(String property, MRulesUtilsSecurityManager securityManager) throws UtilsException
IPropertyCompiler
secureCompile
in interface IPropertyCompiler
UtilsException
public IProperty compile(String property, boolean useCommonBeanUtilsSyntax) throws UtilsException
IPropertyCompiler
compile
in interface IPropertyCompiler
UtilsException
protected PropertyCompiler.IPropertyComponent handleSimpleComponent(PropertyCompiler.IPropertyComponent prevComponent, String property, boolean useCommonBeanUtilsSyntax) throws UtilsException
splitIntoSimpleComponents(String)
.handleGetterSetterComponent(IPropertyComponent, String, boolean)
and handleStrictComponent(IPropertyComponent, String, boolean)
UtilsException
protected PropertyCompiler.IPropertyComponent handleStaticComponent(PropertyCompiler.IPropertyComponent prevComponent, String property, boolean useCommonBeanUtilsSyntax) throws UtilsException
handleStrictComponent(IPropertyComponent, String, boolean)
to parse access partUtilsException
protected PropertyCompiler.IPropertyComponent handleStrictComponent(PropertyCompiler.IPropertyComponent prevComponent, String property, boolean useCommonBeanUtilsSyntax) throws UtilsException
UtilsException
protected PropertyCompiler.IPropertyComponent handleGetterSetterComponent(PropertyCompiler.IPropertyComponent prevComponent, String property, boolean useCommonBeanUtilsSyntax) throws UtilsException
UtilsException
protected List<String> splitIntoSimpleComponents(String property) throws UtilsException
first.second[subFirst.subSecond].third
gives [first ; second[subFirst.subSecond] ; third]
.UtilsException
protected IPropertyCompiler getSecureCompiler(MRulesUtilsSecurityManager securityManager)
IPropertyCompiler
implementation.protected PropertyCompiler.IPropertyFactory createPropertyFactory()
PropertyCompiler.IPropertyFactory
implementation.protected PropertyCompiler.IPropertyFactory getPropertyFactory()