public abstract class FileToEntityLookup<T> extends Object implements Lookup, ChangeGenerator<Object>
File, identify which Product it related to. Uses Query to run all Queries for matching.
List<T>, File}
ChangeGenerator; it will also generate Events of Type| Modifier and Type | Field and Description |
|---|---|
protected List<ChangeListener<Object>> |
listeners |
| Constructor and Description |
|---|
FileToEntityLookup() |
FileToEntityLookup(FileToEntityLookup<T> parent) |
| Modifier and Type | Method and Description |
|---|---|
void |
addChangeListener(ChangeListener<Object> changeListener)
Allow Notify all
ChangeListeners about a change |
protected String |
deriveIdRelatedInfo(File file)
Given a file, identify the related info.
|
protected abstract List<T> |
getEntities(Query<T> entityQuery)
Override to implement custom services that will execute the
Query and return result(s) |
org.apache.commons.collections.Transformer |
getExtractedNameTransformer()
Once the name is extracted from
extractionPattern we can apply any custom Transformer over it
before it is compared to the values in the database. |
Pattern |
getExtractionPattern()
In a File name, extract part of the name that matches this pattern
|
List |
getListeners()
Get list directly.
|
protected abstract T |
getQueryInstance()
Construct Query Object; get base instance entity for
Query |
String |
getRelatedFieldName()
Field name of the entity to be looked up the extracted pattern will relate to
This field should be Queryable |
void |
notifyAllListeners(Object object)
Whenever a node is selected/updated, it also notifies its listeners.
|
void |
setExtractedNameTransformer(org.apache.commons.collections.Transformer extractedNameTransformer)
Once the name is extracted from
extractionPattern we can apply any custom Transformer over it
before it is compared to the values in the database. |
void |
setExtractionPattern(Pattern extractionPattern)
In a File name, extract part of the name that matches this pattern
|
void |
setListeners(List listeners)
Set list directly.
|
void |
setRelatedFieldName(String relatedFieldName)
Field name of the entity to be looked up the extracted pattern will relate to
This field should be Queryable |
Object |
transform(Object in)
For a Given String, Lookup a value for it
|
protected transient List<ChangeListener<Object>> listeners
public FileToEntityLookup()
public FileToEntityLookup(FileToEntityLookup<T> parent) throws IllegalAccessException, InvocationTargetException, NoSuchMethodException
protected String deriveIdRelatedInfo(File file)
file - as Fileprotected abstract T getQueryInstance() throws Exception
QueryExceptionpublic Object transform(Object in)
Lookupprotected abstract List<T> getEntities(Query<T> entityQuery) throws Exception
Query and return result(s)public Pattern getExtractionPattern()
public void setExtractionPattern(Pattern extractionPattern)
public String getRelatedFieldName()
Queryablepublic void setRelatedFieldName(String relatedFieldName)
Queryablepublic org.apache.commons.collections.Transformer getExtractedNameTransformer()
extractionPattern we can apply any custom Transformer over it
before it is compared to the values in the database.public void setExtractedNameTransformer(org.apache.commons.collections.Transformer extractedNameTransformer)
extractionPattern we can apply any custom Transformer over it
before it is compared to the values in the database.public void addChangeListener(ChangeListener<Object> changeListener)
ChangeGeneratorChangeListeners about a changeaddChangeListener in interface ChangeGenerator<Object>public void notifyAllListeners(Object object)
ChangeGeneratornotifyAllListeners in interface ChangeGenerator<Object>public List getListeners()
ChangeGeneratorgetListeners in interface ChangeGenerator<Object>public void setListeners(List listeners)
ChangeGeneratorsetListeners in interface ChangeGenerator<Object>Copyright © 2018. All rights reserved.