public RequiredPropertyNotProvided(Property property, String componentName, XMLStreamReader reader) { super("Component " + componentName + " has a required property " + property.getName() + " that is not set", reader); this.componentName = componentName; }
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<String, InjectionSite>(); 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.getName(), SERVLET_CONTEXT); mapping.put(SESSION_CONTEXT_SITE, site); }
private void handleProperty(Composite type, XMLStreamReader reader, IntrospectionContext childContext) throws XMLStreamException, UnrecognizedElementException { Property property = propertyLoader.load(reader, childContext); if (property == null) { // errror encountered loading the property return; } String key = property.getName(); if (type.getProperties().containsKey(key)) { DuplicateProperty failure = new DuplicateProperty(key, reader); childContext.addError(failure); } else { type.add(property); } }
private void validateRequiredProperties(ComponentDefinition<? extends Implementation<?>> definition, XMLStreamReader reader, IntrospectionContext context) { AbstractComponentType<?, ?, ?, ?> type = definition.getImplementation().getComponentType(); Map<String, ? extends Property> properties = type.getProperties(); Map<String, PropertyValue> values = definition.getPropertyValues(); for (Property property : properties.values()) { if (property.isRequired() && !values.containsKey(property.getName())) { RequiredPropertyNotProvided failure = new RequiredPropertyNotProvided(property, definition.getName(), reader); context.addError(failure); } } }
private void includeProperties(Composite composite, LogicalCompositeComponent domain, InstantiationContext context) { for (Property property : composite.getProperties().values()) { 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 = new LogicalProperty(name, value, many, type, domain); domain.setProperties(logicalProperty); } } }