/** * {@inheritDoc} */ @Override public List<String> getQueryableProperties() { if (queryableProperties == null) { synchronized (queryablePropertiesLock) { if (queryableProperties == null) { Set<String> queryablePropertiesSet = new TLinkedHashSet<>(1); List<IComponentDescriptor<?>> ancestorDescs = getAncestorDescriptors(); if (ancestorDescs != null) { for (IComponentDescriptor<?> ancestorDescriptor : ancestorDescs) { queryablePropertiesSet.addAll(ancestorDescriptor.getQueryableProperties()); } } for (String renderedProperty : getRenderedProperties()) { IPropertyDescriptor declaredPropertyDescriptor = getDeclaredPropertyDescriptor(renderedProperty); if (declaredPropertyDescriptor != null && declaredPropertyDescriptor.isQueryable()) { queryablePropertiesSet.add(renderedProperty); } } queryableProperties = new ArrayList<>(queryablePropertiesSet); } } } return explodeComponentReferences(this, queryableProperties); }
/** * {@inheritDoc} */ @Override public Class<?> getModelType() { return getComponentContract(); }
/** * Is declared translatable. * * @return the boolean */ protected boolean isDeclaredTranslatable() { Collection<IPropertyDescriptor> propertyDescriptors = getDeclaredPropertyDescriptors(); if (propertyDescriptors != null) { for (IPropertyDescriptor pDesc : propertyDescriptors) { if (pDesc instanceof IStringPropertyDescriptor) { if (((IStringPropertyDescriptor) pDesc).isTranslatable()) { return true; } } } } return false; }
/** * Is translated. * * @return the boolean */ @Override public boolean isTranslatable() { if (isDeclaredTranslatable()) { return true; } if (getAncestorDescriptors() != null) { for (IComponentDescriptor<?> ancestorDescriptor : getAncestorDescriptors()) { if (ancestorDescriptor.isTranslatable()) { return true; } } } return false; }
/** * {@inheritDoc} */ @Override public IComponentService getServiceDelegate(Method targetMethod) { registerDelegateServicesIfNecessary(); IComponentService service = null; if (serviceDelegates != null) { service = serviceDelegates.get(targetMethod.getName()); } List<IComponentDescriptor<?>> ancestorDescs = getAncestorDescriptors(); if (service == null && ancestorDescs != null) { for (Iterator<IComponentDescriptor<?>> ite = ancestorDescs.iterator(); service == null && ite.hasNext(); ) { IComponentDescriptor<?> ancestorDescriptor = ite.next(); service = ancestorDescriptor.getServiceDelegate(targetMethod); } } return service; }
if (toStringProperty == null) { String tempToStringProperty = null; List<String> rp = getRenderedProperties(); if (rp != null && !rp.isEmpty()) { for (String renderedProperty : rp) { if (getPropertyDescriptor(renderedProperty) instanceof IStringPropertyDescriptor) { tempToStringProperty = renderedProperty; break; tempToStringProperty = rp.get(0); } else if (getPropertyDescriptor("id") != null) { tempToStringProperty = "id"; } else { tempToStringProperty = getPropertyDescriptors().iterator().next().getName();
if (isTranslatable()) { for (IPropertyDescriptor translatablePropertyDescriptor : getPropertyDescriptors()) { if (translatablePropertyDescriptor instanceof IStringPropertyDescriptor && ((IStringPropertyDescriptor) translatablePropertyDescriptor).isTranslatable() && !translatablePropertyDescriptor.getName().endsWith(NLS_SUFFIX)) { completeWithComputedNlsDescriptors(translatablePropertyDescriptor); if (!isPurelyAbstract()) { BasicCollectionPropertyDescriptor<IComponent> translationsPropertyDescriptor = getComponentTranslationsDescriptorTemplate() .clone(); translationsPropertyDescriptor.setSqlName("T"); translationsPropertyDescriptor.setReferencedDescriptor(translationsCollectionDescriptor); translationsCollectionDescriptor.setElementDescriptor(translationDescriptor); translationDescriptor.setName(getName() + "$Translation"); propertyDescriptorsMap.put(translationsPropertyDescriptor.getName(), translationsPropertyDescriptor); resetPropertyDescriptorCaches(); initializingPropertyDescriptorsMap = false;
@SuppressWarnings("rawtypes") private Map<String, IComponentDescriptor<?>> buildContractNameIdMap() { Map<String, IComponentDescriptor<?>> map = new HashMap<>(); Map<String, IComponentDescriptor> idToComponentDescriptors = componentApplicationContext.getBeansOfType( IComponentDescriptor.class, false, false); for (Map.Entry<String, IComponentDescriptor> descriptorEntry : idToComponentDescriptors.entrySet()) { IComponentDescriptor componentDescriptor = descriptorEntry.getValue(); if (componentDescriptor.getComponentContract() != null) { map.put(componentDescriptor.getComponentContract().getName(), componentDescriptor); if (componentDescriptor.isTranslatable()) { ICollectionPropertyDescriptor<?> collectionPropertyDescriptor = (ICollectionPropertyDescriptor<?>) componentDescriptor .getPropertyDescriptor(AbstractComponentDescriptor.getComponentTranslationsDescriptorTemplate().getName()); if (collectionPropertyDescriptor != null) { IComponentDescriptor<?> translationComponentDescriptor = collectionPropertyDescriptor .getReferencedDescriptor().getElementDescriptor(); if (translationComponentDescriptor.getComponentContract() != null) { map.put(translationComponentDescriptor.getComponentContract().getName(), translationComponentDescriptor); } } } } } map.put(BasicDescriptorDescriptor.INSTANCE.getName(), BasicDescriptorDescriptor.INSTANCE); return map; } }
((AbstractComponentDescriptor<E>) tempQueryDescriptor).isQueryDescriptor = true; List<IComponentDescriptor<?>> ancestorDescs = getAncestorDescriptors(); if (ancestorDescs != null) { List<IComponentDescriptor<?>> queryAncestorDescriptors = new ArrayList<>(); queryAncestorDescriptors.add(ancestorDescriptor.createQueryDescriptor()); ((AbstractComponentDescriptor<E>) tempQueryDescriptor).setAncestorDescriptors(queryAncestorDescriptors); Collection<IPropertyDescriptor> declaredPropertyDescs = getDeclaredPropertyDescriptors(); if (declaredPropertyDescs != null) { Collection<IPropertyDescriptor> queryPropertyDescriptors = new ArrayList<>(); queryPropertyDescriptors.add(propertyDescriptor.createQueryDescriptor()); ((AbstractComponentDescriptor<E>) tempQueryDescriptor).setPropertyDescriptors(queryPropertyDescriptors);
if (autoCompleteProperty == null) { String tempAutoCompleteProperty = null; IPropertyDescriptor lpd = getPropertyDescriptor(getToStringProperty()); if (lpd != null && !lpd.isComputed()) { tempAutoCompleteProperty = lpd.getName(); } else { List<String> rp = getRenderedProperties(); if (rp != null && !rp.isEmpty()) { for (String renderedProperty : rp) { if (getPropertyDescriptor(renderedProperty) instanceof IStringPropertyDescriptor) { tempAutoCompleteProperty = renderedProperty; break; Collection<IPropertyDescriptor> allProps = getPropertyDescriptors(); for (IPropertyDescriptor pd : allProps) { if (pd instanceof IStringPropertyDescriptor && !IEntity.ID.equals(pd.getName())) {
IPropertyDescriptor rootProp = getPropertyDescriptor(propertyName.substring(0, nestedDotIndex)); if (rootProp instanceof IComponentDescriptorProvider<?>) { IComponentDescriptor<?> componentDescriptor = ((IComponentDescriptorProvider<?>) rootProp) descriptor = getDeclaredPropertyDescriptor(propertyName); List<IComponentDescriptor<?>> ancestorDescs = getAncestorDescriptors(); descriptor = refinePropertyDescriptor(descriptor); if (descriptor == null) { propertyDescriptorsCache.put(propertyName, NULL_PROPERTY_DESCRIPTOR);
List<IComponentDescriptor<?>> ancestorDescs = getAncestorDescriptors(); if (ancestorDescs != null) { for (IComponentDescriptor<?> ancestorDescriptor : ancestorDescs) { Collection<IPropertyDescriptor> declaredPropertyDescriptors = getDeclaredPropertyDescriptors(); if (declaredPropertyDescriptors != null) { for (IPropertyDescriptor propertyDescriptor : declaredPropertyDescriptors) { propertyDescriptor = refinePropertyDescriptor(propertyDescriptor); allDescriptors.put(propertyDescriptor.getName(), propertyDescriptor);
if (renderedProperties == null) { Set<String> renderedPropertiesSet = new TLinkedHashSet<>(1); List<IComponentDescriptor<?>> ancestorDescs = getAncestorDescriptors(); if (ancestorDescs != null) { for (IComponentDescriptor<?> ancestorDescriptor : ancestorDescs) { Collection<IPropertyDescriptor> declaredPropertyDescriptors = getDeclaredPropertyDescriptors(); if (declaredPropertyDescriptors != null) { for (IPropertyDescriptor propertyDescriptor : declaredPropertyDescriptors) { return explodeComponentReferences(this, renderedProperties);
/** * Gets the lifecycleInterceptors. * * @return the lifecycleInterceptors. */ @Override public List<ILifecycleInterceptor<?>> getLifecycleInterceptors() { List<ILifecycleInterceptor<?>> allInterceptors = new ArrayList<>(); List<IComponentDescriptor<?>> ancestorDescs = getAncestorDescriptors(); if (ancestorDescs != null) { for (IComponentDescriptor<?> ancestorDescriptor : ancestorDescs) { allInterceptors.addAll(ancestorDescriptor.getLifecycleInterceptors()); } } registerLifecycleInterceptorsIfNecessary(); if (lifecycleInterceptors != null) { allInterceptors.addAll(lifecycleInterceptors); } return allInterceptors; }
/** * {@inheritDoc} */ @Override public Map<String, ESort> getOrderingProperties() { Map<String, ESort> properties = new LinkedHashMap<>(); if (orderingProperties != null) { properties.putAll(orderingProperties); } List<IComponentDescriptor<?>> ancestorDescs = getAncestorDescriptors(); if (ancestorDescs != null) { for (IComponentDescriptor<?> ancestorDescriptor : ancestorDescs) { if (ancestorDescriptor.getOrderingProperties() != null) { properties.putAll(ancestorDescriptor.getOrderingProperties()); } } } if (properties.isEmpty()) { return null; } return reworkOrderingProperties(properties); }
/** * {@inheritDoc} */ @Override public List<String> getQueryableProperties() { if (queryableProperties == null) { return getReferencedDescriptor().getQueryableProperties(); } return AbstractComponentDescriptor.explodeComponentReferences( getReferencedDescriptor(), queryableProperties); // return queryableProperties; }
/** * Returns the component contract class name. * <p/> * {@inheritDoc} */ @Override public String getPermId() { return getName(); }
/** * The properties returned include the uncloned properties of the ancestors. * <p/> * {@inheritDoc} */ @Override public Collection<String> getUnclonedProperties() { Set<String> properties = new THashSet<>(1); if (unclonedProperties != null) { properties.addAll(unclonedProperties); } List<IComponentDescriptor<?>> ancestorDescs = getAncestorDescriptors(); if (ancestorDescs != null) { for (IComponentDescriptor<?> ancestorDescriptor : ancestorDescs) { properties.addAll(ancestorDescriptor.getUnclonedProperties()); } } return properties; }
public Map<String, ESort> reworkOrderingProperties(Map<String, ESort> properties) { Map<String, ESort> reworkedProperties = new LinkedHashMap<>(); for (Entry<String, ESort> ord : properties.entrySet()) { IPropertyDescriptor propertyDescriptor = getPropertyDescriptor(ord.getKey()); String alternativeSortProperty = propertyDescriptor.getAlternativeSortProperty(); if (alternativeSortProperty != null) { reworkedProperties.put(alternativeSortProperty, ord.getValue()); } else { reworkedProperties.put(ord.getKey(), ord.getValue()); } } return reworkedProperties; }
AbstractComponentDescriptor.getComponentTranslationsDescriptorTemplate().getName()); if (translations != null && isInitialized(translations)) { String sessionLanguage = locale.getLanguage();