/** * Test a newly found property */ private boolean testProperty(final ClassDescription current, final Map<String, PropertyDescription> allProperties, final PropertyDescription newProperty, final boolean isInspectedClass ) { final String propName = newProperty.getName(); if ( !StringUtils.isEmpty(propName) ) { if ( allProperties.containsKey(propName) ) { // if the current class is the class we are currently inspecting, we // have found a duplicate definition if ( isInspectedClass ) { iLog.addError("Duplicate definition for property " + propName + " in class " + current.getDescribedClass().getName(), current.getSource() ); } return false; } allProperties.put(propName, newProperty); } else { // no name - generate a unique one allProperties.put(UUID.randomUUID().toString(), newProperty); } return true; }
throws SAXException { final AttributesImpl ai = new AttributesImpl(); IOUtils.addAttribute(ai, ATTR_NAME, property.getName()); if ( property.getType() != PropertyType.String && property.getType() != PropertyType.Password) { IOUtils.addAttribute(ai, PROPERTY_ATTR_TYPE, property.getType());
final String name = pd.getName(); if ( org.osgi.framework.Constants.SERVICE_ID.equals(name) ) { iLog.addError("Class " + current.getDescribedClass().getName() + " is declaring " + final MetatypeAttributeDefinition ad = new MetatypeAttributeDefinition(); ocd.getProperties().add(ad); ad.setId(pd.getName()); ad.setType(pd.getType().name()); iLog.addWarning("Property " + pd.getName() + " in class " + current.getDescribedClass().getName() + " is set as private. " + "This is redundant as no metatype will be generated.", current.getSource() );
PropertyDescription found = null; for(final PropertyDescription current : existingProps) { if ( current.getName().equals(key) ) { found = current; break;
@Override public AbstractDescription clone() { final PropertyDescription cd = new PropertyDescription(this.annotation); cd.setName(this.getName()); cd.setLabel(this.getLabel()); cd.setDescription(this.getDescription()); if ( this.getValue() != null ) { cd.setValue(this.getValue()); } else { cd.setMultiValue(this.getMultiValue()); } cd.setType(this.getType()); cd.setUnbounded(this.getUnbounded()); cd.setCardinality(this.getCardinality()); cd.setPrivate(this.isPrivate()); cd.setOptions(this.getOptions()); return cd; } }