Returns the first IdentifierExtension found in the given collection of extensions,
or null if no IdentifierExtensions exist in the given collection.
978509
public static IdentifierExtension findFirst(Collection<? extends Extension> extensions)
    {
        for (Extension extension : extensions)
        {
            if (IDENTIFIER_EXTENSION_ID == extension.getId()) return (IdentifierExtension)extension;
        }
        return null;
    }
374108
public byte[] getExtensionValue(String oid) {
        try {
            ObjectIdentifier findOID = new ObjectIdentifier(oid);
            String extAlias = OIDMap.getName(findOID);
            Extension certExt = null;
            CertificateExtensions exts = (CertificateExtensions)info.get(
                                     CertificateExtensions.NAME);

            if (extAlias == null) { // may be unknown
                // get the extensions, search thru' for this oid
                if (exts == null) {
                    return null;
                }

                for (Extension ex : exts.getAllExtensions()) {
                    ObjectIdentifier inCertOID = ex.getExtensionId();
                    if (inCertOID.equals((Object)findOID)) {
                        certExt = ex;
                        break;
                    }
                }
            } else { // there's sub-class that can handle this extension
                try {
                    certExt = (Extension)this.get(extAlias);
                } catch (CertificateException e) {
                    // get() throws an Exception instead of returning null, ignore
                }
            }
            if (certExt == null) {
                if (exts != null) {
                    certExt = exts.getUnparseableExtensions().get(oid);
                }
                if (certExt == null) {
                    return null;
                }
            }
            byte[] extData = certExt.getExtensionValue();
            if (extData == null) {
                return null;
            }
            DerOutputStream out = new DerOutputStream();
            out.putOctetString(extData);
            return out.toByteArray();
        } catch (Exception e) {
            return null;
        }
    }
96200
public List<String> getExtensionPoints(String prefix,String suffix){
		return extensionPointsCache.get(prefix+"@"+suffix);
	}
701842
public <T> T getLocalExtension(Class<T> extensionType) {
        Object obj = extensions.get(extensionType);
        if (null != obj) {
            return extensionType.cast(obj);
        }
        return null;
    }
844688
private static IdentifierHandler<? extends Identifier> getExtendedIdentifierHandlerFor(Element element) {
		if (!checkExtendedIdentityElement(element)) {
			return null;
		}

		String name = element.getAttribute(IfmapStrings.IDENTITY_ATTR_NAME);

		Document extendedDocument;
		try {
			extendedDocument = DomHelpers.parseEscapedXmlString(name);
		} catch (UnmarshalException e) {
			return null;
		}
		Element extendedElement = extendedDocument.getDocumentElement();
		String nodeName = extendedElement.getLocalName();

		// try to find the most specific handler
		for (Entry<Class<? extends Identifier>, IdentifierHandler<? extends Identifier>> entry : sIdentifierHandlers
				.entrySet()) {

			String simpleClassName = entry.getKey().getSimpleName();

			if (simpleClassName.equalsIgnoreCase(nodeName)) {
				return entry.getValue();
			}
		}

		return null;
	}
596655
protected static function getTemplatePath($identifier, $extensionID = null)
    {
        if ($extensionID === true) {
            $extensionID = 'tao';
            common_Logger::d('Deprecated use of setView() using a boolean');
        }
        if($extensionID === null) {
            $extensionID = Context::getInstance()->getExtensionName();
        }
        $ext = common_ext_ExtensionsManager::singleton()->getExtensionById($extensionID);
        return $ext->getConstant('DIR_VIEWS').'templates'.DIRECTORY_SEPARATOR.$identifier;
    }
38764
public T getDefaultExtension() {
        getExtensionClasses();
        if (null == cachedDefaultName || cachedDefaultName.length() == 0 || "true".equals(cachedDefaultName)) {
            return null;
        }
        return getExtension(cachedDefaultName);
    }
212420
public List<Identification> getAssociatedOutputExtension(OutputPluginModel<?, ?> outputPlugin) {
        IdentifiableSet<OutputExtensionModel<?, ?>> outputExtensions = this.outputExtensions.get(outputPlugin.getID());
        IdentificationManagerM identificationManager = IdentificationManager.getInstance();
        return filterType(outputExtensions, outputPlugin).stream()
                .map(identificationManager::getIdentification)
                .filter(Optional::isPresent)
                .map(Optional::get)
                .collect(Collectors.toList());
    }
1169280
public static <T> ExtensionLoader<T> getExtensionLoader(Class<T> clazz) {
        return getExtensionLoader(clazz, null);
    }
555177
public static List<ScopeListExtension> findAll(Collection<? extends Extension> extensions)
    {
        List<ScopeListExtension> result = new ArrayList<ScopeListExtension>();
        for (Extension extension : extensions)
        {
            if (SCOPE_LIST_EXTENSION_ID == extension.getId())
                result.add((ScopeListExtension)extension);
        }
        return result;
    }
61008
public Extension get(String name) throws IOException {
        Extension obj = map.get(name);
        if (obj == null) {
            throw new IOException("No extension found with name " + name);
        }
        return (obj);
    }
1361880
public static Map<String,String> getExtensions() {
		 StackInfo result = MDC.get();
		 if (result == null) {
			 return StackInfo.collectExtensions();
		 } else {
			 return result.extensions;
		 }
	 }
870236
@SuppressWarnings("PMD.PrematureDeclaration")
    private void resolveExtensions(final ExtensionsHolder holder) {
        final Stopwatch timer = context.stat().timer(Stat.ExtensionsRecognitionTime);
        final boolean guiceFirstMode = context.option(JerseyExtensionsManagedByGuice);
        final List<Class<?>> manual = context.getEnabledExtensions();
        for (Class<?> type : manual) {
            if (!processType(type, holder, guiceFirstMode, false)) {
                throw new IllegalStateException("No installer found for extension " + type.getName()
                        + ". Available installers: " + holder.getInstallerTypes()
                        .stream().map(FeatureUtils::getInstallerExtName).collect(Collectors.joining(", ")));
            }
        }
        if (scanner != null) {
            scanner.scan(type -> {
                if (manual.contains(type)) {
                    // avoid duplicate extension installation, but register it's appearance in auto scan scope
                    context.getOrRegisterExtension(type, true);
                } else {
                    processType(type, holder, guiceFirstMode, true);
                }
            });
        }
        context.lifecycle().extensionsResolved(context.getEnabledExtensions(), context.getDisabledExtensions());
        timer.stop();
    }
227935
public static String getMimeTypeFromExtension(String extension) {
        if (extension == null || extension.length() == 0) {
            return null;
        }
        return extensionToMimeTypeMap.get(extension);
    }
1145798
@Override
    public boolean isExtension() {
        if (isExtension == null) {
            if (archive.getType() == ArchiveType.ON_DEMAND_LIB) {
                isExtension = false;
            } else {
                Set<String> extensionClazz = archive.getExtensionClasses();
                isExtension = extensionClazz.isEmpty() ? false : true;
            }
        }
        return isExtension;
    }
362164
public static LanguageExtension findFirst(Collection<? extends Extension> extensions)
    {
        for (Extension extension : extensions)
        {
            if (LANGUAGE_EXTENSION_ID == extension.getId())
                return (LanguageExtension)extension;
        }
        return null;
    }
1120666
private ExtensionDependency getDependency(Extension extension, String dependencyId)
    {
        for (ExtensionDependency dependency : extension.getDependencies()) {
            if (dependency.getId().equals(dependencyId)) {
                return dependency;
            }
        }

        return null;
    }