private String collectionNameFromType(SimpleFeatureType type) { String collectionName = (String) type.getUserData().get(KEY_collection); return collectionName != null ? collectionName : type.getTypeName(); }
synchronized (featureType) { Object cache = featureType.getUserData().get("indexLookup"); if (cache instanceof Map) { return (Map<String, Integer>) cache; Map<String, Integer> generatedIndex = SimpleFeatureTypeImpl.buildIndex(featureType); featureType.getUserData().put("indexLookup", generatedIndex); return generatedIndex;
/** Exact equality based on typeNames, namespace, attributes and ancestors */ static boolean equals( SimpleFeatureType typeA, SimpleFeatureType typeB, boolean compareUserMaps) { if (typeA == typeB) return true; if (typeA == null || typeB == null) { return false; } if (!typeA.equals(typeB)) { return false; } if (compareUserMaps) { if (!equals(typeA.getUserData(), typeB.getUserData())) return false; } return equalsId(typeA, typeB) && equals( typeA.getAttributeDescriptors(), typeB.getAttributeDescriptors(), compareUserMaps) && equalsAncestors(typeA, typeB); }
featureType.getUserData().put(MongoDataStore.KEY_collection, collection.getName());
/** * Creates a new instance of {@link JDBCFeatureStore}. * * @see ContentDataStore#createFeatureSource(ContentEntry) */ protected ContentFeatureSource createFeatureSource(ContentEntry entry) throws IOException { // grab the schema, it carries a flag telling us if the feature type is read only SimpleFeatureType schema = entry.getState(Transaction.AUTO_COMMIT).getFeatureType(); if (schema == null) { // if the schema still haven't been computed, force its computation so // that we can decide if the feature type is read only schema = new JDBCFeatureSource(entry, null).buildFeatureType(); entry.getState(Transaction.AUTO_COMMIT).setFeatureType(schema); } Object readOnlyMarker = schema.getUserData().get(JDBC_READ_ONLY); if (Boolean.TRUE.equals(readOnlyMarker)) { return new JDBCFeatureSource(entry, null); } return new JDBCFeatureStore(entry, null); }
&& simpleFeatureType.getUserData().get("prefix") != null) { String providedNamespace = simpleFeatureType.getName().getNamespaceURI(); String providedPrefix = (String) simpleFeatureType.getUserData().get("prefix"); xsd.getQNamePrefixToNamespaceMap().put(providedPrefix, providedNamespace); if (simpleFeatureType.getUserData().get("schemaURI") != null) { throw new IllegalArgumentException("Unable to support app-schema supplied types");
@Override public void postDropTable(String schemaName, SimpleFeatureType featureType, Connection cx) throws SQLException { super.postDropTable(schemaName, featureType, cx); FeatureEntry fe = (FeatureEntry) featureType.getUserData().get(FeatureEntry.class); if (fe == null) { fe = new FeatureEntry(); fe.setIdentifier(featureType.getTypeName()); fe.setDescription(featureType.getTypeName()); fe.setTableName(featureType.getTypeName()); } GeoPackage geopkg = geopkg(); try { geopkg.deleteGeoPackageContentsEntry(fe); geopkg.deleteGeometryColumnsEntry(fe); } catch (IOException e) { throw new SQLException(e); } }
ft.getUserData().put(KEY_collection, ft.getTypeName());
public static DBObject convert(SimpleFeatureType ft) { Map<String, String> ftUserData = typeCheck(ft.getUserData()); if (!ftUserData.isEmpty()) { ftDBO.put(KEY_userData, new BasicDBObject(ftUserData));
incoming.getUserData().put(KEY_collection, incoming.getTypeName());
if (TYPE.getName().getNamespaceURI() != null && TYPE.getUserData().get("prefix") != null) { String typeNamespace = TYPE.getName().getNamespaceURI(); String typePrefix = (String) TYPE.getUserData().get("prefix");
Map<Object, Object> ftUserData = ft.getUserData(); for (Map.Entry<?, ?> entry : ((Map<?, ?>) ftUserDataDBO.toMap()).entrySet()) { ftUserData.put(entry.getKey(), entry.getValue());
schema.getUserData().put(FeatureEntry.class, e);
throws SQLException, IOException { FeatureEntry fe = (FeatureEntry) featureType.getUserData().get(FeatureEntry.class); if (fe == null) { fe = new FeatureEntry();
/** * Get all the index names associated with the SimpleFeatureType referenced. * * @param type - SFT object which contains Index Names * @return List of index names */ public static final List<String> getIndexNames(final SimpleFeatureType type) { final Object obj = type.getUserData().get(INDEX_NAME); if (obj != null) { return Arrays.asList(obj.toString().split(",")); } return Collections.emptyList(); }
@SuppressWarnings("unchecked") private List<QName> featureTypeSchemaNames(SimpleFeatureType featureType) { Map<Object, Object> userData = featureType.getUserData(); if (userData.containsKey("schemanames")) { List<String> names = (List<String>) userData.get("schemanames"); List<QName> qnames = new ArrayList<QName>(names.size()); for (String name : names) { qnames.add(new QName(name)); } return qnames; } return Collections.emptyList(); }
@Override public void setUserDataOf(SimpleFeatureType compatibleFeatureType) { super.setUserDataOf(compatibleFeatureType); compatibleFeatureType.getUserData().put("trackPoints", "true"); }
ft.getUserData().put(JDBCDataStore.JDBC_READ_ONLY, Boolean.TRUE);
private void testSetUserDataOf(PlacemarkDescriptor descriptor, String expected) { final SimpleFeatureType ft = descriptor.getBaseFeatureType(); descriptor.setUserDataOf(ft); assertTrue(ft.getUserData().containsKey(AbstractPlacemarkDescriptor.PROPERTY_NAME_PLACEMARK_DESCRIPTOR)); assertEquals(expected, ft.getUserData().get(AbstractPlacemarkDescriptor.PROPERTY_NAME_PLACEMARK_DESCRIPTOR)); } }
@Override public SimpleFeatureType getBaseFeatureType() { SimpleFeatureTypeBuilder builder = new SimpleFeatureTypeBuilder(); builder.setName("kalle grabowski"); SimpleFeatureType simpleFeatureType = builder.buildFeatureType(); simpleFeatureType.getUserData().put(PlacemarkDescriptorRegistry.PROPERTY_NAME_PLACEMARK_DESCRIPTOR, "blub"); return simpleFeatureType; }