private void generatePropertyInjectionMapping(Property property, Map<String, Map<String, InjectionSite>> mappings) { Map<String, InjectionSite> mapping = mappings.get(property.getName()); if (mapping == null) { mapping = new HashMap<>(); mappings.put(property.getName(), mapping); } // inject the property into the session context // we don't need to do the type mappings from schema to Java so set Object as the type WebContextInjectionSite site = new WebContextInjectionSite(Object.class, SERVLET_CONTEXT); mapping.put(SESSION_CONTEXT_SITE, site); }
/** * Add a property defined by the implementation. * * @param property the property to add */ public void add(Property property) { property.setParent(this); properties.put(property.getName(), property); }
/** * Add a property and its associated with an injection site. * * @param property the property to add * @param injectionSite the injection site for the property */ public void add(Property property, InjectionSite injectionSite) { super.add(property); Injectable injectable = new Injectable(InjectableType.PROPERTY, property.getName()); addInjectionSite(injectionSite, injectable); injectionSiteMapping.put(property, injectionSite); }
private void includeProperty(Property property, LogicalCompositeComponent domain, InstantiationContext context) { String name = property.getName(); if (domain.getAllProperties().containsKey(name)) { DuplicateProperty error = new DuplicateProperty(name, domain); context.addError(error); } else { Document value = property.getDefaultValue(); boolean many = property.isMany(); QName type = property.getType(); LogicalProperty logicalProperty = LogicalProperty.Builder.newBuilder(name, domain).xmlValue(value).many(many).type(type).build(); domain.setProperties(logicalProperty); } }
private void includeProperty(Property property, LogicalCompositeComponent domain, InstantiationContext context) { String name = property.getName(); if (domain.getAllProperties().containsKey(name)) { DuplicateProperty error = new DuplicateProperty(name, domain); context.addError(error); } else { Document value = property.getDefaultValue(); boolean many = property.isMany(); QName type = property.getType(); LogicalProperty logicalProperty = LogicalProperty.Builder.newBuilder(name, domain).xmlValue(value).many(many).type(type).build(); domain.setProperties(logicalProperty); } }