/** * Get the map of {@link DataField} fields/parameters to {@link DataField} instances. */ private static Map<String, DataField> dataFieldAnnotationMap(final InjectionContext context, final MetaClass templateType) { final String dataFieldAnnoMapName = dataFieldAnnotationMapName(templateType); @SuppressWarnings("unchecked") Map<String, DataField> dataFieldTypes = (Map<String, DataField>) context.getAttribute(dataFieldAnnoMapName); if (dataFieldTypes == null) { dataFieldTypes = new LinkedHashMap<>(); context.setAttribute(dataFieldAnnoMapName, dataFieldTypes); } return dataFieldTypes; }
/** * Get the map of {@link DataField} names and {@link MetaClass} types. */ @SuppressWarnings("unchecked") private static Map<String, MetaClass> dataFieldTypeMap(final InjectionContext context, final MetaClass templateType) { final String dataFieldTypeMapName = dataFieldTypeMapName(templateType); Map<String, MetaClass> dataFieldTypes = (Map<String, MetaClass>) context.getAttribute( dataFieldTypeMapName); if (dataFieldTypes == null) { dataFieldTypes = new LinkedHashMap<>(); context.setAttribute(dataFieldTypeMapName, dataFieldTypes); } return dataFieldTypes; }
/** * Get the map of {@link DataField} fields/parameters to {@link DataField} instances. */ private static Map<String, DataField> dataFieldAnnotationMap(final InjectionContext context, final MetaClass templateType) { final String dataFieldAnnoMapName = dataFieldAnnotationMapName(templateType); @SuppressWarnings("unchecked") Map<String, DataField> dataFieldTypes = (Map<String, DataField>) context.getAttribute(dataFieldAnnoMapName); if (dataFieldTypes == null) { dataFieldTypes = new LinkedHashMap<>(); context.setAttribute(dataFieldAnnoMapName, dataFieldTypes); } return dataFieldTypes; }
/** * Get the map of {@link DataField} names and {@link MetaClass} types. */ @SuppressWarnings("unchecked") private static Map<String, MetaClass> dataFieldTypeMap(final InjectionContext context, final MetaClass templateType) { final String dataFieldTypeMapName = dataFieldTypeMapName(templateType); Map<String, MetaClass> dataFieldTypes = (Map<String, MetaClass>) context.getAttribute( dataFieldTypeMapName); if (dataFieldTypes == null) { dataFieldTypes = new LinkedHashMap<>(); context.setAttribute(dataFieldTypeMapName, dataFieldTypes); } return dataFieldTypes; }
/** * Get the map of {@link DataField} names and {@link Statement} instances. */ @SuppressWarnings("unchecked") private static Map<String, Statement> dataFieldMap(final InjectionContext context, final MetaClass templateType) { final String dataFieldMapName = dataFieldMapName(templateType); Map<String, Statement> dataFields = (Map<String, Statement>) context.getAttribute( dataFieldMapName); if (dataFields == null) { dataFields = new LinkedHashMap<>(); context.setAttribute(dataFieldMapName, dataFields); } return dataFields; }
/** * Get the map of {@link DataField} names and {@link Statement} instances. */ @SuppressWarnings("unchecked") private static Map<String, Statement> dataFieldMap(final InjectionContext context, final MetaClass templateType) { final String dataFieldMapName = dataFieldMapName(templateType); Map<String, Statement> dataFields = (Map<String, Statement>) context.getAttribute( dataFieldMapName); if (dataFields == null) { dataFields = new LinkedHashMap<>(); context.setAttribute(dataFieldMapName, dataFields); } return dataFields; }
/** * Get a map of all previously constructed {@link Template} object types */ @SuppressWarnings("unchecked") private Map<MetaClass, BuildMetaClass> getConstructedTemplateTypes(final Decorable decorable) { Map<MetaClass, BuildMetaClass> result = (Map<MetaClass, BuildMetaClass>) decorable.getInjectionContext().getAttribute( CONSTRUCTED_TEMPLATE_SET_KEY); if (result == null) { result = new LinkedHashMap<>(); decorable.getInjectionContext().setAttribute(CONSTRUCTED_TEMPLATE_SET_KEY, result); } return result; }
/** * Get a map of all previously constructed {@link Template} object types */ @SuppressWarnings("unchecked") private Map<MetaClass, BuildMetaClass> getConstructedTemplateTypes(final Decorable decorable) { Map<MetaClass, BuildMetaClass> result = (Map<MetaClass, BuildMetaClass>) decorable.getInjectionContext().getAttribute( CONSTRUCTED_TEMPLATE_SET_KEY); if (result == null) { result = new LinkedHashMap<>(); decorable.getInjectionContext().setAttribute(CONSTRUCTED_TEMPLATE_SET_KEY, result); } return result; }
/** * Get the aggregate map of {@link DataField} names and {@link Statement} * instances for the given {@link MetaClass} type and all ancestors returned * by {@link MetaClass#getSuperClass()}. */ @SuppressWarnings("unchecked") public static Map<String, Statement> aggregateDataFieldMap(final Decorable decorable, final MetaClass componentType) { final Map<String, Statement> result = new LinkedHashMap<>(); if (componentType.getSuperClass() != null) { result.putAll(aggregateDataFieldMap(decorable, componentType.getSuperClass())); } final Map<String, Statement> dataFields = (Map<String, Statement>) decorable.getInjectionContext().getAttribute( dataFieldMapName(componentType)); if (dataFields != null) { result.putAll(dataFields); } return result; }
/** * Get the aggregate map of {@link DataField} names to instances for the given {@link MetaClass} component type and * all ancestors returned by {@link MetaClass#getSuperClass()}. */ public static Map<String, DataField> aggregateDataFieldAnnotationMap(final Decorable decorable, final MetaClass componentType) { final Map<String, DataField> result = new LinkedHashMap<>(); if (componentType.getSuperClass() != null) { result.putAll(aggregateDataFieldAnnotationMap(decorable, componentType.getSuperClass())); } @SuppressWarnings("unchecked") final Map<String, DataField> dataFields = (Map<String, DataField>) decorable.getInjectionContext().getAttribute( dataFieldAnnotationMapName(componentType)); if (dataFields != null) { result.putAll(dataFields); } return result; }
/** * Get the aggregate map of {@link DataField} names to instances for the given {@link MetaClass} component type and * all ancestors returned by {@link MetaClass#getSuperClass()}. */ public static Map<String, DataField> aggregateDataFieldAnnotationMap(final Decorable decorable, final MetaClass componentType) { final Map<String, DataField> result = new LinkedHashMap<>(); if (componentType.getSuperClass() != null) { result.putAll(aggregateDataFieldAnnotationMap(decorable, componentType.getSuperClass())); } @SuppressWarnings("unchecked") final Map<String, DataField> dataFields = (Map<String, DataField>) decorable.getInjectionContext().getAttribute( dataFieldAnnotationMapName(componentType)); if (dataFields != null) { result.putAll(dataFields); } return result; }
/** * Get the aggregate map of {@link DataField} names and {@link MetaClass} * types for the given {@link MetaClass} component type and all ancestors * returned by {@link MetaClass#getSuperClass()}. */ @SuppressWarnings("unchecked") public static Map<String, MetaClass> aggregateDataFieldTypeMap(final Decorable decorable, final MetaClass componentType) { final Map<String, MetaClass> result = new LinkedHashMap<>(); if (componentType.getSuperClass() != null) { result.putAll(aggregateDataFieldTypeMap(decorable, componentType.getSuperClass())); } final Map<String, MetaClass> dataFields = (Map<String, MetaClass>) decorable.getInjectionContext().getAttribute( dataFieldTypeMapName(componentType)); if (dataFields != null) { result.putAll(dataFields); } return result; }
/** * Get the aggregate map of {@link DataField} names and {@link MetaClass} * types for the given {@link MetaClass} component type and all ancestors * returned by {@link MetaClass#getSuperClass()}. */ @SuppressWarnings("unchecked") public static Map<String, MetaClass> aggregateDataFieldTypeMap(final Decorable decorable, final MetaClass componentType) { final Map<String, MetaClass> result = new LinkedHashMap<>(); if (componentType.getSuperClass() != null) { result.putAll(aggregateDataFieldTypeMap(decorable, componentType.getSuperClass())); } final Map<String, MetaClass> dataFields = (Map<String, MetaClass>) decorable.getInjectionContext().getAttribute( dataFieldTypeMapName(componentType)); if (dataFields != null) { result.putAll(dataFields); } return result; }
/** * Get the aggregate map of {@link DataField} names and {@link Statement} * instances for the given {@link MetaClass} type and all ancestors returned * by {@link MetaClass#getSuperClass()}. */ @SuppressWarnings("unchecked") public static Map<String, Statement> aggregateDataFieldMap(final Decorable decorable, final MetaClass componentType) { final Map<String, Statement> result = new LinkedHashMap<>(); if (componentType.getSuperClass() != null) { result.putAll(aggregateDataFieldMap(decorable, componentType.getSuperClass())); } final Map<String, Statement> dataFields = (Map<String, Statement>) decorable.getInjectionContext().getAttribute( dataFieldMapName(componentType)); if (dataFields != null) { result.putAll(dataFields); } return result; }