/** * Create an attribute, even for null id. * * @see org.geotools.feature.AbstractFeatureFactoryImpl#createAttribute(java.lang.Object, * org.opengis.feature.type.AttributeDescriptor, java.lang.String) */ @Override public Attribute createAttribute(Object value, AttributeDescriptor descriptor, String id) { return new AttributeImpl(value, descriptor, buildSafeGmlObjectId(id)); }
/** * Internal helper method for getting at the properties without wrapping in unmodifiable * collection. */ protected Collection properties() { return (Collection) super.getValue(); }
public GeometryDescriptor getDescriptor() { return (GeometryDescriptor) super.getDescriptor(); }
/** * Test xlink:href returns gml:id. * * @throws Exception */ public void testXlinkHref() throws Exception { AttributeType attType = new AttributeTypeImpl( new NameImpl("someAttributeType"), String.class, false, false, null, null, null); AttributeImpl node = new AttributeImpl(null, attType, null); final String ID = "something"; node.getUserData().put("gml:id", ID); ReferenceTypeBinding binding = new ReferenceTypeBinding(); Object xlink = binding.getProperty(node, XLINK.HREF); assertNotNull(xlink); assertEquals("#" + ID, xlink.toString()); } }
(AttributeDescriptor) fType.getDescriptor(SIMPLE_ATTRIBUTE); AttributeImpl simpleAttribute = new AttributeImpl("simple value", simpleAttributeDesc, null); properties.add(simpleAttribute); (AttributeDescriptor) rootAttType.getDescriptor(MULTI_LEAF_ATTRIBUTE); AttributeImpl leafOne = new AttributeImpl("multi leaf value 1", multiLeafDesc, null); rootPropertiesOne.add(leafOne); AttributeImpl leafTwo = new AttributeImpl("multi leaf value 2", multiLeafDesc, null); rootPropertiesOne.add(leafTwo); AttributeImpl singleLeaf = new AttributeImpl("single leaf value", singleLeafDesc, null); rootPropertiesOne.add(singleLeaf); singleLeaf.getUserData().put(Attributes.class, userData); userData.put(Types.typeName(EG, "att"), "test attribute");
public Attribute createAttribute(Object value, AttributeDescriptor descriptor, String id) { return new AttributeImpl(value, descriptor, id == null ? null : ff.gmlObjectId(id)); }
(AttributeDescriptor) fType.getDescriptor(SIMPLE_ATTRIBUTE); AttributeImpl simpleAttribute = new AttributeImpl("simple value", simpleAttributeDesc, null); properties.add(simpleAttribute); (AttributeDescriptor) rootAttType.getDescriptor(MULTI_LEAF_ATTRIBUTE); AttributeImpl leafOne = new AttributeImpl("multi leaf value 1", multiLeafDesc, null); rootPropertiesOne.add(leafOne); AttributeImpl leafTwo = new AttributeImpl("multi leaf value 2", multiLeafDesc, null); rootPropertiesOne.add(leafTwo); AttributeImpl singleLeaf = new AttributeImpl("single leaf value", singleLeafDesc, null); rootPropertiesOne.add(singleLeaf); singleLeaf.getUserData().put(Attributes.class, userData); userData.put(Types.typeName(EG, "att"), "test attribute");
private Object getValue(ReturnAttribute innerAttribute) { if (innerAttribute.value instanceof AttributeImpl) { return ((AttributeImpl) innerAttribute.value).getValue(); } return innerAttribute.value; }
public String toString() { StringBuffer sb = new StringBuffer(getClass().getSimpleName()).append(":"); sb.append(getDescriptor().getName().getLocalPart()); if (!getDescriptor() .getName() .getLocalPart() .equals(getDescriptor().getType().getName().getLocalPart()) || id != null) { sb.append("<"); sb.append(getDescriptor().getType().getName().getLocalPart()); if (id != null) { sb.append(" id="); sb.append(id); } sb.append(">"); } sb.append("="); sb.append(value); return sb.toString(); }
new AttributeImpl(Collections.<Property>emptyList(), expectedType, null); new AttributeImpl(Collections.<Property>emptyList(), expectedType, null);
AttributeImpl simpleAttribute = new AttributeImpl("simple value", simpleAttributeDesc, null); properties.add(simpleAttribute); AttributeDescriptor multiLeafDesc = (AttributeDescriptor) rootAttType.getDescriptor(MULTI_LEAF_ATTRIBUTE); AttributeImpl leafOne = new AttributeImpl("multi leaf value 1", multiLeafDesc, null); rootPropertiesOne.add(leafOne); AttributeImpl leafTwo = new AttributeImpl("multi leaf value 2", multiLeafDesc, null); rootPropertiesOne.add(leafTwo); AttributeImpl singleLeaf = new AttributeImpl("single leaf value", singleLeafDesc, null); rootPropertiesOne.add(singleLeaf); singleLeaf.getUserData().put(Attributes.class, userData); userData.put(Types.typeName(EG, "att"), "test attribute");
/** @deprecated */ public Geometry getValue() { return (Geometry) super.getValue(); }
public GeometryDescriptor getDescriptor() { return (GeometryDescriptor) super.getDescriptor(); }
private Property createProperty(String name) { Object value = name.equals(geomPropertyName) ? feature.getAttribute(backendGeomPropertyName) : feature.getAttribute(name); AttributeDescriptor attrDescr = featureTyp.getDescriptor(name); if (attrDescr == null) return null; if (attrDescr instanceof GeometryDescriptor) return new GeometryAttributeImpl(value, (GeometryDescriptor) attrDescr, null); else return new AttributeImpl(value, attrDescr, null); }
public void validate() { Types.validate(this, this.getValue()); }
public String toString() { StringBuffer sb = new StringBuffer(getClass().getSimpleName()).append(":"); sb.append(getDescriptor().getName().getLocalPart()); if(!getDescriptor().getName().getLocalPart().equals(getDescriptor().getType().getName().getLocalPart()) || id != null){ sb.append("<"); sb.append(getDescriptor().getType().getName().getLocalPart()); if( id != null ){ sb.append( " id="); sb.append( id ); } sb.append(">"); } sb.append("="); sb.append(value); return sb.toString(); }
private Attribute buildSimpleContentInternal(AttributeType simpleContentType, Object value) { Object convertedValue = FF.literal(value).evaluate(value, simpleContentType.getBinding()); AttributeDescriptor descriptor = new AttributeDescriptorImpl( simpleContentType, ComplexFeatureConstants.SIMPLE_CONTENT, 1, 1, true, (Object) null); return new AttributeImpl(convertedValue, descriptor, null); }
public Collection<? extends Property> getValue() { return FeatureImplUtils.unmodifiable((Collection) super.getValue()); }
do { Property nullProperty = new AttributeImpl( propertyDescriptor.getType().getBinding().cast(null), (AttributeDescriptor) propertyDescriptor,
public Collection<Property> getProperties() { return FeatureImplUtils.unmodifiable((Collection) super.getValue()); }