Get or create a named descriptor.

@param type
The descriptor type.
@param name
The name.
@param descriptors
The map of known named descriptors.
@param store
The store.
@return The servlet descriptor.
499709
private <T extends NamedDescriptor> T getOrCreateNamedDescriptor(Class<T> type, String name, Map<String, T> descriptors, Store store) {
        T descriptor = descriptors.get(name);
        if (descriptor == null) {
            descriptor = store.create(type);
            descriptor.setName(name);
            descriptors.put(name, descriptor);
        }
        return descriptor;
    }
713728
FieldDescriptor getFieldDescriptor(TypeCache.CachedType<?> cachedType, String signature) {
        FieldDescriptor fieldDescriptor = cachedType.getField(signature);
        if (fieldDescriptor == null) {
            fieldDescriptor = scannerContext.getStore().create(FieldDescriptor.class);
            fieldDescriptor.setSignature(signature);
            cachedType.addMember(signature, fieldDescriptor);
        }
        return fieldDescriptor;
    }
1041903
public <T> T getHeader(String name, Class<T> type) {
    return (T) headers.get(name);
  }
382371
public static TypeSignature ofNamed(String name, Object namedTypeDescriptor) {
        return new TypeSignature(requireNonNull(name, "name"),
                                 requireNonNull(namedTypeDescriptor, "namedTypeDescriptor"));
    }
95233
public PropertyDataReader forProperty(InternalQName name, int type)
   {
      if (nodePropertyReader == null)
      {
         nodePropertyReader = new PropertyDataReader(parent, dataManager);
      }
      return nodePropertyReader.forProperty(name, type);
   }
964739
public ITypeParameterBuilder addTypeParameter(String name) {
		ITypeParameterBuilder builder = this.iTypeParameterBuilderProvider.get();
		final SarlConstructor object = getSarlConstructor();
		builder.eInit(object, name, getTypeResolutionContext());
		object.getTypeParameters().add(builder.getJvmTypeParameter());
		return builder;
	}
918887
@CheckForNull
    public Descriptor getDescriptor(Class<? extends Describable> type) {
        for( Descriptor d : getExtensionList(Descriptor.class) )
            if(d.clazz==type)
                return d;
        return null;
    }
585322
public static DataStore create(Map<String, Object> parameters) throws IOException {
		Object url = parameters.get(ShapefileDataStoreFactory.URLP.key);
		Logger log = LoggerFactory.getLogger(DataStoreFactory.class);
		if (url instanceof String) {
			parameters.put(ShapefileDataStoreFactory.URLP.key, ResourceUtils.getURL((String) url).toExternalForm());
		}
		if (DATASTORE_CACHE.containsKey(parameters)) {
			return DATASTORE_CACHE.get(parameters);
		}
		DataStore store = DataStoreFinder.getDataStore(parameters);
		Object typed = parameters.get(USE_TYPED_FIDS);
		if (typed instanceof String) {
			Boolean t = Boolean.valueOf((String) typed);
			if (!t) {
				if (store != null) {
					log.warn("Non-typed FIDs are only supported by first-generation JDBC datastores, "
							+ "using default fid format for datastore class " + store.getClass().getName());
				}
			}
		}
		if (null == store) {
			StringBuilder availableStr = new StringBuilder();
			StringBuilder missingStr = new StringBuilder();
			Iterator<DataStoreFactorySpi> all = DataStoreFinder.getAllDataStores();
			while (all.hasNext()) {
				DataStoreFactorySpi factory = all.next();
				if (!factory.isAvailable()) {
					log.warn("Datastore factory " + factory.getDisplayName() + "(" + factory.getDescription()
							+ ") is not available");
					if (missingStr.length() != 0) {
						missingStr.append(",");
					}
					missingStr.append(factory.getDisplayName());
				} else {
					if (availableStr.length() != 0) {
						availableStr.append(",");
					}
					availableStr.append(factory.getDisplayName());
				}
			}
			throw new IOException(
					"No datastore found. Possible causes are missing factory or missing library for your datastore"
							+ " (e.g. database driver).\nCheck the isAvailable() method of your"
							+ " DataStoreFactory class to find out which libraries are needed.\n"
							+ "Unavailable factories : " + missingStr + "\n" + "Available factories : " + availableStr
							+ "\n");
		}
		DATASTORE_CACHE.put(parameters, store);
		return store;
	}
1194670
@Nonnull
    public Descriptor getDescriptorOrDie(Class<? extends Describable> type) {
        Descriptor d = getDescriptor(type);
        if (d==null)
            throw new AssertionError(type+" is missing its descriptor");
        return d;
    }
235835
@GET
    @Path("/uniqueAttribute/type/{typeName}")
    @Consumes(Servlets.JSON_MEDIA_TYPE)
    @Produces(Servlets.JSON_MEDIA_TYPE)
    public AtlasEntityWithExtInfo getByUniqueAttributes(@PathParam("typeName") String typeName,
                                                        @Context HttpServletRequest servletRequest) throws AtlasBaseException {
        AtlasPerfTracer perf = null;

        try {
            Map<String, Object> attributes = getAttributes(servletRequest);

            if (AtlasPerfTracer.isPerfTraceEnabled(PERF_LOG)) {
                perf = AtlasPerfTracer.getPerfTracer(PERF_LOG, "EntityREST.getByUniqueAttributes(" + typeName + "," + attributes + ")");
            }

            AtlasEntityType entityType = ensureEntityType(typeName);

            validateUniqueAttribute(entityType, attributes);

            return entitiesStore.getByUniqueAttributes(entityType, attributes);
        } finally {
            AtlasPerfTracer.log(perf);
        }
    }
729804
public static String getDescription(TypeDeclaration type) {
		if (type == null || type.description() == null) {
			return null;
		} else {
			return type.description().value();
		}
	}
222105
public static Type get(final String _name)
        throws CacheReloadException
    {
        final Cache<String, Type> cache = InfinispanCache.get().<String, Type>getCache(Type.NAMECACHE);
        if (!cache.containsKey(_name)) {
            Type.getTypeFromDB(Type.SQL_NAME, _name);
        }
        Type ret = cache.get(_name);
        if (ret != null && ret.isDirty()) {
            Type.LOG.debug("Recaching dirty Type for name: {}", ret);
            Type.cacheType(ret);
            ret = cache.get(_name);
        }
        return ret;
    }
135088
protected static TypedPropertyDescriptor _buildPropertyDescriptor(
    String propertyName, Class beanClass, String getterName, String setterName )
  {
    try
    {
      return new TypedPropertyDescriptor( propertyName, beanClass, getterName, setterName );
    }
    catch( IntrospectionException e )
    {
      throw new RuntimeException( "Failed to create property \"" + propertyName + "\" on class \"" + beanClass +
                                  "\": " + e.getClass() + " - " + e.getMessage() );
    }
  }
919790
public <T> T getJsonHeader(java.lang.reflect.Type type, String name) {
        String v = getHeader(name);
        return v == null || v.isEmpty() ? null : jsonConvert.convertFrom(type, v);
    }
565524
public ModuleDescriptor[] descriptors(String name) {
        ModuleDeps moduleDeps = modules.keySet().stream()
            .filter(m -> m.name().equals(name))
            .map(modules::get)
            .findFirst().get();

        ModuleDescriptor[] descriptors = new ModuleDescriptor[3];
        descriptors[0] = moduleDeps.root.descriptor();
        descriptors[1] = moduleDeps.descriptor();
        descriptors[2] = moduleDeps.reduced();
        return descriptors;
    }
1008601
public static String descriptor(Type type, Types types) {
    SigGen sig = new SigGen(types);
    sig.assembleSig(types.erasure(type));
    return sig.toString();
  }
890598
public IndexDescriptorDef getIndexDescriptor(String name)
    {
        IndexDescriptorDef indexDef = null;

        for (Iterator it = _indexDescriptors.iterator(); it.hasNext(); )
        {
            indexDef = (IndexDescriptorDef)it.next();
            if (indexDef.getName().equals(name))
            {
                return indexDef;
            }
        }
        return null;
    }