protected MetadataTools getMetadataTools() { return beanLocator.get(MetadataTools.NAME); }
@SuppressWarnings("unchecked") protected <T> TypedQuery<T> createQueryInstance(boolean isNative, Class<T> resultClass) { return (TypedQuery<T>) beanLocator.getPrototype(Query.NAME,this, isNative, resultClass); }
/** * Return the bean instances that match the given object type (including * subclasses). * <p>The Map returned by this method should always return bean names and * corresponding bean instances <i>in the order of definition</i> in the * backend configuration, as far as possible. * @param beanType the class or interface to match, or <code>null</code> for all concrete beans * @return a Map with the matching beans, containing the bean names as * keys and the corresponding bean instances as values */ public static <T> Map<String, T> getAll(Class<T> beanType) { return getBeanLocator().getAll(beanType); }
public QueryTransformer transformer(String query) { if (useAst) { if (domainModel == null) { DomainModelBuilder builder = beanLocator.get(DomainModelBuilder.NAME); domainModel = builder.produce(); } return beanLocator.getPrototype(QueryTransformer.NAME, domainModel, query); } else { return new QueryTransformerRegex(query); } }
@PostConstruct public void init() { theme = themeConstantsManager.getConstants(); windowManager = windowManagerProvider.get(); if (beanLocator.containsBean(FtsFilterHelper.NAME)) { ftsFilterHelper = beanLocator.get(FtsFilterHelper.class); } filterMode = FilterMode.GENERIC_MODE; conditionsLocation = clientConfig.getGenericFilterConditionsLocation(); createLayout(); }
/** * Whether a bean with the given name is present. */ public static boolean containsBean(String name) { return getBeanLocator().containsBean(name); }
@Override public void run() { DomainDescriptionService service = beanLocator.get(DomainDescriptionService.NAME); String description = service.getDomainDescription(); ExportDisplay exportDisplay = beanLocator.getPrototype(ExportDisplay.NAME, true); exportDisplay.show(new ByteArrayDataProvider(description.getBytes(StandardCharsets.UTF_8)), "domain-description.html", ExportFormat.HTML); }
protected DynamicAttributesGuiTools getDynamicAttributesGuiTools() { return beanLocator.get(DynamicAttributesGuiTools.NAME); }
protected App createApplication() { return beanLocator.getPrototype(App.NAME); }
protected GuiActionSupport getGuiActionSupport() { return beanLocator.get(GuiActionSupport.NAME); }
protected Connection createConnection() { return beanLocator.getPrototype(Connection.NAME); }
protected Metadata getMetadata() { return beanLocator.get(Metadata.NAME); }
protected EntityManager createEntityManager(javax.persistence.EntityManager jpaEm) { return (EntityManager) beanLocator.getPrototype(EntityManager.NAME, jpaEm); }
protected Configuration getConfiguration() { return beanLocator.get(Configuration.NAME); }
/** * Return an instance of prototype bean, specifying explicit constructor arguments. * @param name the name of the bean to retrieve * @param args constructor arguments * @return bean instance */ @SuppressWarnings("unchecked") public static <T> T getPrototype(String name, Object... args) { return (T) getBeanLocator().getPrototype(name, args); }
protected UserSessionSource getUserSessionSource() { return beanLocator.get(UserSessionSource.NAME); } }
@Override public void loadMenuConfig() { SideMenuBuilder menuBuilder = beanLocator.getPrototype(SideMenuBuilder.NAME); menuBuilder.build(this); }
protected WindowConfig getWindowConfig() { return beanLocator.get(WindowConfig.NAME); } }
@Nullable protected Element getWindowElement(String src) throws FileNotFoundException { String text = resources.getResourceAsString(src); if (StringUtils.isNotEmpty(text)) { try { Document document = Dom4j.readDocument(text); XmlInheritanceProcessor processor = beanLocator.getPrototype(XmlInheritanceProcessor.NAME, document, emptyMap()); Element root = processor.getResultRoot(); if (root.getName().equals(Window.NAME)) { return root; } } catch (RuntimeException e) { log.error("Can't parse screen file: ", src); } } else { throw new FileNotFoundException("File doesn't exist or empty: " + src); } return null; }