private int getAttributeIndex(VectorDataNode pointDataSource, AttributeDescriptor dataField) { final String fieldName = dataField.getLocalName(); if (fieldName.equals(CorrelativeFieldSelector.NULL_NAME)) { return -1; } return pointDataSource.getFeatureType().indexOf(fieldName); }
private VectorDataLayer createLayerInternal(LayerContext ctx, VectorDataNode vectorDataNode) { final PropertySet configuration = createLayerConfig(ctx); // Save the name of the vectorDataNode, so that we can reconstruct the layer later (e.g. if // loaded from session file). configuration.setValue(PROPERTY_NAME_VECTOR_DATA, vectorDataNode.getName()); return createLayer(vectorDataNode, configuration); }
public static VectorDataLayer createLayer(LayerContext ctx, VectorDataNode vectorDataNode) { final VectorDataLayerType specialLayerType = vectorDataNode.getExtension(VectorDataLayerType.class); final VectorDataLayer layer; if (specialLayerType != null) { layer = specialLayerType.createLayerInternal(ctx, vectorDataNode); } else { final VectorDataLayerType fallbackLayerType = LayerTypeRegistry.getLayerType(VectorDataLayerType.class); if (fallbackLayerType == null) { throw new IllegalStateException( "fallbackLayerType == null (missing default VectorDataLayerType)"); } layer = fallbackLayerType.createLayerInternal(ctx, vectorDataNode); } return layer; }