public class AliasPropertyPolicy extends BasePolicy
This policy establishes aliases for properties already in scope. The alias can be as simple as one property is equal to another, or can involve complicated property expressions . This is under the control of java properties of the form
alias.table-name. name=prop-expression
Where name must be the name of a property currently in scope. The
scope is defined as the properties that can be found in the
PropertyFinder provided during initialisation (in the
initFinder(uk.ac.ed.epcc.webapp.AppContext, uk.ac.ed.epcc.safe.accounting.properties.PropertyFinder, java.lang.String) method) as well as all properties
present in the base and batch property registers
located in BaseParser and BatchParser respectively.
Note that this allows the definition to be different for different accounting tables. Care needs to be taken to ensure that these different definitions are compatible if a UsageManager is going to be used.
| Constructor and Description |
|---|
AliasPropertyPolicy() |
| Modifier and Type | Method and Description |
|---|---|
PropExpressionMap |
getDerivedProperties(PropExpressionMap previous)
return a set of derived property definitions.
|
PropertyFinder |
initFinder(uk.ac.ed.epcc.webapp.AppContext ctx,
PropertyFinder origFinder,
java.lang.String table)
Generate a PropertyFinder that will find any PropertyTag generated by this class.
|
parseendParse, modifyDefaultTableSpecification, startParse, uniqueclone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitendParse, modifyDefaultTableSpecification, startParsepublic PropertyFinder initFinder(uk.ac.ed.epcc.webapp.AppContext ctx, PropertyFinder origFinder, java.lang.String table)
PropertyContainerUpdaterAll properties defined at run-time should have their PropertyTag objects constructed by the time the first call to this method returns. As some parsers properties will generate different things depending on the other properties already in scope this method is passed a PropertyFinder for any properties that may already be in scope. This will include any default parameters specified when the data was uploaded and any properties generated from the database meta-data. Though it is perfectly legal to return a PropertyFinder that returns a superset of the generated properties the only requirement is that the returned finder can find any property that this classes parse method may actually generate values for. So Normally the contents of the super-finder are not included in the result unless these values are actually generated by the parse. If values are generated then a MultiFinder can be populated with the PropertyRegistrys from the generated properties
origFinder - PropertyFinder for the higher levels in the call chain.table - String name of the destination table in case per-table customisation is neededpublic PropExpressionMap getDerivedProperties(PropExpressionMap previous)
PropertyContainerUpdaterDefinitions are allowed for properties that are also generated directly in the parse phase. In this case the parse value should always be used by preference and the derived definition only provides a fall-back implementation if the parse value is unavailable. For example if not persisted in the database layer. This allows one parser/policy to specify a default implementation as a derived property definition which is then overridden by having the same property generated in a parse method of a different policy/parser
getDerivedProperties in interface PropertyContainerUpdatergetDerivedProperties in class AbstractPropertyContainerUpdaterprevious - Previous definitions