Package org.exbin.xbup.catalog
Class XBECatalog
- java.lang.Object
-
- org.exbin.xbup.catalog.XBECatalog
-
- All Implemented Interfaces:
org.exbin.xbup.core.catalog.XBCatalog
- Direct Known Subclasses:
XBAECatalog
@ParametersAreNonnullByDefault public class XBECatalog extends java.lang.Object implements org.exbin.xbup.core.catalog.XBCatalogBasic level 1 catalog class using Java persistence.
-
-
Field Summary
Fields Modifier and Type Field Description protected java.util.Map<java.lang.Class,org.exbin.xbup.core.catalog.base.manager.XBCManager<?>>catalogManagersprotected java.util.Map<java.lang.Class,org.exbin.xbup.core.catalog.base.service.XBCService<?>>catalogServicesprotected javax.persistence.EntityManagerem
-
Constructor Summary
Constructors Constructor Description XBECatalog()XBECatalog(javax.persistence.EntityManager em)Creates a new instance of XBECatalog.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description <T extends org.exbin.xbup.core.catalog.base.manager.XBCManager<?>>
voidaddCatalogManager(java.lang.Class<T> type, T manager)<T extends org.exbin.xbup.core.catalog.base.service.XBCService<?>>
voidaddCatalogService(java.lang.Class<T> type, T service)java.lang.LongfindBlockIdForGroup(org.exbin.xbup.core.block.declaration.XBGroupDecl group, org.exbin.xbup.core.block.declaration.XBBlockDecl decl)java.lang.LongfindBlockIdForGroup(org.exbin.xbup.core.block.declaration.XBGroup group, org.exbin.xbup.core.block.declaration.XBBlockDecl decl)XBEBlockSpecfindBlockSpecByPath(java.lang.Long[] xbCatalogPath)org.exbin.xbup.core.block.declaration.XBBlockDeclfindBlockTypeByPath(java.lang.Long[] blockSpecCatalogPath, int revision)XBEFormatSpecfindFormatSpecByPath(java.lang.Long[] xbCatalogPath)org.exbin.xbup.core.block.declaration.XBFormatDeclfindFormatTypeByPath(java.lang.Long[] xbCatalogPath, int revision)XBEGroupSpecfindGroupSpecByPath(java.lang.Long[] xbCatalogPath)org.exbin.xbup.core.block.declaration.XBGroupDeclfindGroupTypeByPath(java.lang.Long[] xbCatalogPath, int revision)org.exbin.xbup.core.block.XBBlockTypegetBasicBlockType(org.exbin.xbup.core.block.XBBasicBlockType blockType)java.util.List<org.exbin.xbup.core.block.declaration.XBBlockDecl>getBlocks(org.exbin.xbup.core.catalog.base.XBCGroupSpec spec)org.exbin.xbup.core.block.declaration.XBBlockDeclgetBlockType(org.exbin.xbup.core.block.declaration.XBContext context, int groupId, int blockId)Gets block type for specification defined by IDs in given context.<T extends org.exbin.xbup.core.catalog.base.manager.XBCManager<?>>
TgetCatalogManager(java.lang.Class<T> managerClass)java.util.List<org.exbin.xbup.core.catalog.base.manager.XBCManager<?>>getCatalogManagers()<T extends org.exbin.xbup.core.catalog.base.service.XBCService<?>>
TgetCatalogService(java.lang.Class<T> serviceClass)java.util.List<org.exbin.xbup.core.catalog.base.service.XBCService<?>>getCatalogServices()javax.persistence.EntityManagergetEntityManager()java.util.List<org.exbin.xbup.core.block.declaration.XBGroupDecl>getGroups(org.exbin.xbup.core.catalog.base.XBCFormatSpec spec)org.exbin.xbup.core.block.declaration.XBContextgetRootContext()java.lang.Long[]getSpecPath(org.exbin.xbup.core.catalog.base.XBCSpec spec)org.exbin.xbup.client.update.XBCUpdateHandlergetUpdateHandler()voidinitCatalog()booleanisShallInit()org.exbin.xbup.core.block.declaration.XBContextprocessDeclaration(org.exbin.xbup.core.block.declaration.XBContext parent, org.exbin.xbup.core.parser.token.pull.XBTPullProvider blockProvider)voidsetRootContext(org.exbin.xbup.core.block.declaration.XBContext context)voidsetUpdateHandler(org.exbin.xbup.client.update.XBCUpdateHandler updateHandler)
-
-
-
Field Detail
-
em
protected javax.persistence.EntityManager em
-
catalogManagers
protected java.util.Map<java.lang.Class,org.exbin.xbup.core.catalog.base.manager.XBCManager<?>> catalogManagers
-
catalogServices
protected java.util.Map<java.lang.Class,org.exbin.xbup.core.catalog.base.service.XBCService<?>> catalogServices
-
-
Method Detail
-
findFormatSpecByPath
@Nullable public XBEFormatSpec findFormatSpecByPath(java.lang.Long[] xbCatalogPath)
-
findGroupSpecByPath
@Nullable public XBEGroupSpec findGroupSpecByPath(java.lang.Long[] xbCatalogPath)
-
findBlockSpecByPath
@Nullable public XBEBlockSpec findBlockSpecByPath(java.lang.Long[] xbCatalogPath)
-
findFormatTypeByPath
@Nullable public org.exbin.xbup.core.block.declaration.XBFormatDecl findFormatTypeByPath(java.lang.Long[] xbCatalogPath, int revision)- Specified by:
findFormatTypeByPathin interfaceorg.exbin.xbup.core.catalog.XBCatalog
-
findGroupTypeByPath
@Nullable public org.exbin.xbup.core.block.declaration.XBGroupDecl findGroupTypeByPath(java.lang.Long[] xbCatalogPath, int revision)- Specified by:
findGroupTypeByPathin interfaceorg.exbin.xbup.core.catalog.XBCatalog
-
findBlockTypeByPath
@Nullable public org.exbin.xbup.core.block.declaration.XBBlockDecl findBlockTypeByPath(java.lang.Long[] blockSpecCatalogPath, int revision)- Specified by:
findBlockTypeByPathin interfaceorg.exbin.xbup.core.catalog.XBCatalog
-
getRootContext
@Nonnull public org.exbin.xbup.core.block.declaration.XBContext getRootContext()
- Specified by:
getRootContextin interfaceorg.exbin.xbup.core.catalog.XBCatalog
-
setRootContext
public void setRootContext(org.exbin.xbup.core.block.declaration.XBContext context)
-
initCatalog
public void initCatalog()
-
getGroups
public java.util.List<org.exbin.xbup.core.block.declaration.XBGroupDecl> getGroups(org.exbin.xbup.core.catalog.base.XBCFormatSpec spec)
- Specified by:
getGroupsin interfaceorg.exbin.xbup.core.catalog.XBCatalog
-
getBlocks
public java.util.List<org.exbin.xbup.core.block.declaration.XBBlockDecl> getBlocks(org.exbin.xbup.core.catalog.base.XBCGroupSpec spec)
- Specified by:
getBlocksin interfaceorg.exbin.xbup.core.catalog.XBCatalog
-
addCatalogManager
public <T extends org.exbin.xbup.core.catalog.base.manager.XBCManager<?>> void addCatalogManager(java.lang.Class<T> type, T manager)- Specified by:
addCatalogManagerin interfaceorg.exbin.xbup.core.catalog.XBCatalog
-
addCatalogService
public <T extends org.exbin.xbup.core.catalog.base.service.XBCService<?>> void addCatalogService(java.lang.Class<T> type, T service)- Specified by:
addCatalogServicein interfaceorg.exbin.xbup.core.catalog.XBCatalog
-
getEntityManager
@Nonnull public javax.persistence.EntityManager getEntityManager()
-
getCatalogServices
@Nonnull public java.util.List<org.exbin.xbup.core.catalog.base.service.XBCService<?>> getCatalogServices()
- Specified by:
getCatalogServicesin interfaceorg.exbin.xbup.core.catalog.XBCatalog
-
getCatalogManagers
@Nonnull public java.util.List<org.exbin.xbup.core.catalog.base.manager.XBCManager<?>> getCatalogManagers()
- Specified by:
getCatalogManagersin interfaceorg.exbin.xbup.core.catalog.XBCatalog
-
getUpdateHandler
public org.exbin.xbup.client.update.XBCUpdateHandler getUpdateHandler()
-
setUpdateHandler
public void setUpdateHandler(org.exbin.xbup.client.update.XBCUpdateHandler updateHandler)
-
isShallInit
public boolean isShallInit()
-
getCatalogManager
@Nonnull public <T extends org.exbin.xbup.core.catalog.base.manager.XBCManager<?>> T getCatalogManager(java.lang.Class<T> managerClass)
- Specified by:
getCatalogManagerin interfaceorg.exbin.xbup.core.catalog.XBCatalog
-
getCatalogService
@Nonnull public <T extends org.exbin.xbup.core.catalog.base.service.XBCService<?>> T getCatalogService(java.lang.Class<T> serviceClass)
- Specified by:
getCatalogServicein interfaceorg.exbin.xbup.core.catalog.XBCatalog
-
findBlockIdForGroup
public java.lang.Long findBlockIdForGroup(org.exbin.xbup.core.block.declaration.XBGroup group, org.exbin.xbup.core.block.declaration.XBBlockDecl decl)
-
findBlockIdForGroup
public java.lang.Long findBlockIdForGroup(org.exbin.xbup.core.block.declaration.XBGroupDecl group, org.exbin.xbup.core.block.declaration.XBBlockDecl decl)
-
getBlockType
public org.exbin.xbup.core.block.declaration.XBBlockDecl getBlockType(org.exbin.xbup.core.block.declaration.XBContext context, int groupId, int blockId)Gets block type for specification defined by IDs in given context.- Parameters:
context- current contextgroupId- group IDblockId- block ID- Returns:
- block type declaration
-
processDeclaration
public org.exbin.xbup.core.block.declaration.XBContext processDeclaration(org.exbin.xbup.core.block.declaration.XBContext parent, org.exbin.xbup.core.parser.token.pull.XBTPullProvider blockProvider)- Specified by:
processDeclarationin interfaceorg.exbin.xbup.core.catalog.XBCatalog
-
getSpecPath
public java.lang.Long[] getSpecPath(org.exbin.xbup.core.catalog.base.XBCSpec spec)
- Specified by:
getSpecPathin interfaceorg.exbin.xbup.core.catalog.XBCatalog
-
getBasicBlockType
public org.exbin.xbup.core.block.XBBlockType getBasicBlockType(org.exbin.xbup.core.block.XBBasicBlockType blockType)
- Specified by:
getBasicBlockTypein interfaceorg.exbin.xbup.core.catalog.XBCatalog
-
-