Package org.adempiere.base
Class AnnotationBasedModelFactory
java.lang.Object
org.adempiere.base.AnnotationBasedFactory
org.adempiere.base.AnnotationBasedModelFactory
- All Implemented Interfaces:
IModelFactory
- Direct Known Subclasses:
WS_ModelFactory
Translates table names into model classes having the
This factory is designed to have a service rank higher than
Model annotation. Relies on
DefaultModelFactory for everything else.This factory is designed to have a service rank higher than
DefaultModelFactory, as class
discovery using SPI is preferred over reflection-based methods.- Author:
- Saulo Gil, Heng Sin
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidactivate(org.osgi.service.component.ComponentContext context) Scan annotation upon activation of componentprotected String[]Extension point.Class<?>Get Persistence Class for Tableprotected String[]Extension point.Get PO Class InstanceGet PO Class InstanceGet PO Class InstanceMethods inherited from class org.adempiere.base.AnnotationBasedFactory
blockWhileScanning, getExecutorService, getMaxThreads, getScanFailureHandler, signalScanCompletion
-
Constructor Details
-
AnnotationBasedModelFactory
public AnnotationBasedModelFactory()
-
-
Method Details
-
getPackages
Extension point. Subclasses might override this method in order to have faster model class scanning.- Returns:
- array of packages to be accepted during class scanning
- See Also:
-
ClassGraph.acceptPackagesNonRecursive(String...)
-
getAcceptClassesPatterns
Extension point. Provide a list of patterns to match against class names.- Returns:
- array of strings containing patterns
- See Also:
-
ClassGraph.acceptClasses(String...)
-
activate
public void activate(org.osgi.service.component.ComponentContext context) throws ClassNotFoundException Scan annotation upon activation of component- Parameters:
context-- Throws:
ClassNotFoundException
-
getClass
Get Persistence Class for Table- Specified by:
getClassin interfaceIModelFactory- Parameters:
tableName- table name- Returns:
- class or null
-
getPO
Get PO Class Instance- Specified by:
getPOin interfaceIModelFactoryRecord_ID- record- Returns:
- PO for Record or null
-
getPO
Get PO Class Instance- Specified by:
getPOin interfaceIModelFactoryRecord_UU- record UUID- Returns:
- PO for Record or null
-
getPO
Get PO Class Instance- Specified by:
getPOin interfaceIModelFactoryrs- result settrxName- transaction- Returns:
- PO for Record or null
-