public AttributeNodeIterator(AttributeNodePointer pointer, Name name) { this.pointer = pointer; feature = (ComplexAttribute) pointer.getImmediateAttribute(); AttributeDescriptor descriptor = feature.getDescriptor(); Name attName = descriptor == null ? feature.getType().getName() : descriptor.getName(); if (attName.equals(name)) { children = Collections.<Property>singletonList(feature); } else { children = new ArrayList<Property>(feature.getProperties(name)); } position = children.size() > 0 ? 1 : 0; }
if (!content.isEmpty()) { throw new IllegalAttributeException( attribute.getDescriptor(), "Type indicates empty attribute collection, content does not");
protected Object getValues( boolean isMultiValued, Expression expression, Object sourceFeatureInput) { if (isMultiValued && sourceFeatureInput instanceof FeatureImpl && expression instanceof AttributeExpressionImpl) { // RA: Feature Chaining // complex features can have multiple nodes of the same attribute.. and if they are used // as input to an app-schema data access to be nested inside another feature type of a // different XML type, it has to be mapped like this: // <AttributeMapping> // <targetAttribute> // gsml:composition // </targetAttribute> // <sourceExpression> // <inputAttribute>mo:composition</inputAttribute> // <linkElement>gsml:CompositionPart</linkElement> // <linkField>gml:name</linkField> // </sourceExpression> // <isMultiple>true</isMultiple> // </AttributeMapping> // As there can be multiple nodes of mo:composition in this case, we need to retrieve // all of them AttributeExpressionImpl attribExpression = ((AttributeExpressionImpl) expression); String xpath = attribExpression.getPropertyName(); ComplexAttribute sourceFeature = (ComplexAttribute) sourceFeatureInput; StepList xpathSteps = XPath.steps(sourceFeature.getDescriptor(), xpath, namespaces); return getProperties(sourceFeature, xpathSteps); } return expression.evaluate(sourceFeatureInput); }
PropertyDescriptor descriptor = newComplexAtt.getDescriptor(); if (descriptor.getUserData() != null) { Object propertyElement = newComplexAtt.getDescriptor().getName().getLocalPart(); if (existingName.equals(newName)) { propertyExist = true;
public AttributeNodeIterator(AttributeNodePointer pointer, Name name) { this.pointer = pointer; feature = (ComplexAttribute) pointer.getImmediateNode(); AttributeDescriptor descriptor = feature.getDescriptor(); Name attName = descriptor == null ? feature.getType().getName() : descriptor.getName(); if (attName.equals(name)) { children = Collections.<Property>singletonList(feature); } else { children = new ArrayList<Property>(feature.getProperties(name)); } position = children.size() > 0 ? 1 : 0; }
public AttributeNodeIterator(AttributeNodePointer pointer, Name name) { this.pointer = pointer; feature = (ComplexAttribute) pointer.getImmediateAttribute(); AttributeDescriptor descriptor = feature.getDescriptor(); Name attName = descriptor == null ? feature.getType().getName() : descriptor.getName(); if (attName.equals(name)) { children = Collections.<Property>singletonList(feature); } else { children = new ArrayList<Property>(feature.getProperties(name)); } position = children.size() > 0 ? 1 : 0; }
throw new IllegalAttributeException(attribute.getDescriptor(), "Type indicates empty attribute collection, content does not");
protected Object getValues(boolean isMultiValued, Expression expression, Object sourceFeatureInput) { if (isMultiValued && sourceFeatureInput instanceof FeatureImpl && expression instanceof AttributeExpressionImpl) { // RA: Feature Chaining // complex features can have multiple nodes of the same attribute.. and if they are used // as input to an app-schema data access to be nested inside another feature type of a // different XML type, it has to be mapped like this: // <AttributeMapping> // <targetAttribute> // gsml:composition // </targetAttribute> // <sourceExpression> // <inputAttribute>mo:composition</inputAttribute> // <linkElement>gsml:CompositionPart</linkElement> // <linkField>gml:name</linkField> // </sourceExpression> // <isMultiple>true</isMultiple> // </AttributeMapping> // As there can be multiple nodes of mo:composition in this case, we need to retrieve // all of them AttributeExpressionImpl attribExpression = ((AttributeExpressionImpl) expression); String xpath = attribExpression.getPropertyName(); ComplexAttribute sourceFeature = (ComplexAttribute) sourceFeatureInput; StepList xpathSteps = XPath.steps(sourceFeature.getDescriptor(), xpath, namespaces); return getProperties(sourceFeature, xpathSteps); } return expression.evaluate(sourceFeatureInput); }
private void assertRecordElement(Feature f, String elementName, Object... values) { AttributeDescriptor identifierDescriptor = CSWRecordDescriptor.getDescriptor(elementName); Collection<Property> propertyList = f.getProperties(identifierDescriptor.getName()); Property[] properties = (Property[]) propertyList.toArray(new Property[propertyList.size()]); assertEquals(properties.length, values.length); for (int i = 0; i < properties.length; i++) { ComplexAttribute cad = (ComplexAttribute) properties[i]; assertEquals(identifierDescriptor, cad.getDescriptor()); assertEquals(values[i], cad.getProperty(CSWRecordDescriptor.SIMPLE_LITERAL_VALUE).getValue()); } }
PropertyDescriptor descriptor = newComplexAtt.getDescriptor(); if (descriptor.getUserData() != null) { Object propertyElement = descriptor.getUserData().get( String newName = newComplexAtt.getDescriptor().getName() .getLocalPart(); if (existingName.equals(newName)) {