{@inheritDoc}

@see org.jboss.shrinkwrap.api.Archive#getAsType(java.lang.Class, org.jboss.shrinkwrap.api.Filter,
org.jboss.shrinkwrap.api.ArchiveFormat)
972945
@Override
    public <X extends Archive<X>> Collection<X> getAsType(Class<X> type, Filter<ArchivePath> filter,
        final ArchiveFormat archiveFormat) {
        Validate.notNull(type, "Type must be specified");
        Validate.notNull(filter, "Filter must be specified");
        Validate.notNull(archiveFormat, "ArchiveFormat must be specified");

        Collection<X> archives = new ArrayList<X>();

        Map<ArchivePath, Node> matches = getContent(filter);
        for (ArchivePath path : matches.keySet()) {
            archives.add(getAsType(type, path, archiveFormat));
        }
        return archives;
    }
874766
public Class<?> getArrayOrCollectionComponentType() {
        if (!isCollection() && !isArray()) {
            throw new IllegalStateException();
        }

        if (isCollection()) {
            Type type = field.getGenericType();
            if (type instanceof ParameterizedType) {
                return toClass(((ParameterizedType) type).getActualTypeArguments()[0]);
            } else {
                String message = String.format("Cannot determine the type parameter of the collection-typed field %s. Raw types are not supported", field);
                throw new IllegalArgumentException(message);
            }
        } else {
            return field.getType().getComponentType();
        }
    }
1351981
public <T extends Archive<T>> ArchiveFormat getArchiveFormatFromExtensionMapping(final Class<T> type) {
        ExtensionWrapper extensionWrapper = extensionMappings.get(type);
        if (extensionWrapper == null) {
            loadExtensionMapping(type);
        }
        extensionWrapper = extensionMappings.get(type);
        if (extensionWrapper == null) {
            throw UnknownExtensionTypeExceptionDelegator.newExceptionInstance(type);
        }
        String archiveFormat = extensionWrapper.getProperty("archiveFormat");
        return ArchiveFormat.valueOf(archiveFormat);
    }
391345
final String getSerialVersionUID(TypeElement type) {
    TypeMirror serializable = elementUtils().getTypeElement(Serializable.class.getName()).asType();
    if (typeUtils().isAssignable(type.asType(), serializable)) {
      List<VariableElement> fields = ElementFilter.fieldsIn(type.getEnclosedElements());
      for (VariableElement field : fields) {
        if (field.getSimpleName().contentEquals("serialVersionUID")) {
          Object value = field.getConstantValue();
          if (field.getModifiers().containsAll(Arrays.asList(Modifier.STATIC, Modifier.FINAL))
              && field.asType().getKind() == TypeKind.LONG
              && value != null) {
            return value + "L";
          } else {
            errorReporter.reportError(
                "serialVersionUID must be a static final long compile-time constant", field);
            break;
          }
        }
      }
    }
    return "";
  }
111583
public JType getGenericReturnType()
  {
    try {
      Type retType = _method.getGenericReturnType();

      if (retType instanceof Class)
  return _loader.forName(((Class) retType).getName());
      else
  return new JTypeWrapper(_loader, (ParameterizedType) retType);
    } catch (NoSuchMethodError e) {
      return getReturnType();
    }

  }
184385
private Class getMapType()
  {
    Class mapType = Map.class;
    IParsedElement parent = getParsedElement().getParent();
    if( parent instanceof NewExpression )
    {
      IType newType = ((NewExpression)parent).getType();
      IJavaClassInfo classInfo = IRTypeResolver.getJavaBackedClass(newType);
      Class javaBackedClass = classInfo != null ? classInfo.getBackingClass() : null;
      if( classInfo != null && javaBackedClass != null )
      {
        mapType = javaBackedClass;
      }
      else if( JavaTypes.getJreType(AbstractMap.class).isAssignableFrom( newType ) )
      {
        mapType = AbstractMap.class;
      }
    }
    return mapType;
  }
816037
public Class<?> getWrapperType(Class<?> primitiveType) {
        for(PrimitiveEnum p : PrimitiveEnum.values()) {
            if(p.getType().equals(primitiveType)) {
                return p.getClazz();
            }
        }

        return primitiveType; // if not primitive, return it as is
    }
1244875
@Override
    public Map<ArchivePath, Node> getContent(Filter<ArchivePath> filter) {
        return this.getArchive().getContent(filter);
    }
1302739
public static Set<Type> getTypedTypes(Map<Class<?>, Type> typeClosure, Class<?> rawType, Typed typed) {
        Set<Type> types = new HashSet<Type>();
        for (Class<?> specifiedClass : typed.value()) {
            Type tmp = typeClosure.get(specifiedClass);
            if (tmp != null) {
                types.add(tmp);
            } else {
                throw BeanLogger.LOG.typedClassNotInHierarchy(specifiedClass.getName(), rawType, Formats.formatTypes(typeClosure.values()));
            }
        }
        types.add(Object.class);
        return types;
    }
1371544
@SuppressWarnings("unchecked")
    public <T> FieldFormatter<T> getFormatter(final Class<T> requiredType) {
        return (FieldFormatter<T>)typeMap.get(requiredType);
    }
188471
@Override
	public List<RecordSessionUrl> getUrlsForType (int type) throws DatabaseException {
    	SqlPreparedStatementWrapper psGetAlluRLSForType = null;
        try {
        	psGetAlluRLSForType = DbSQL.getSingleton().getPreparedStatement("sessionurl.ps.geturlsfortype");
			psGetAlluRLSForType.getPs().setInt(1, type);
			try (ResultSet rs = psGetAlluRLSForType.getPs().executeQuery()) {
				List<RecordSessionUrl> result = new ArrayList<>();
				while (rs.next()) {
					result.add(new RecordSessionUrl(rs.getLong(URLID), rs.getInt(TYPE), rs.getString(URL)));
				}
				return result;
			}
		} catch (SQLException e) {
			throw new DatabaseException(e);
		} finally {
			DbSQL.getSingleton().releasePreparedStatement(psGetAlluRLSForType);
		}
    }
964572
@Override
    public Iterator<Object[]> getDataByFilter(DataProviderFilter dataFilter) {
        Preconditions.checkArgument(resource != null, "File resource cannot be null");
        logger.entering(dataFilter);
        Class<?> arrayType;
        JsonReader reader = null;
        try {
            reader = new JsonReader(getReader(resource));
            arrayType = Array.newInstance(resource.getCls(), 0).getClass();
            Gson myJson = new Gson();
            Object[] mappedData = myJson.fromJson(reader, arrayType);
            return prepareDataAsObjectArrayList(mappedData, dataFilter).iterator();
        } catch (Exception e) {
            throw new DataProviderException(e.getMessage(), e);
        } finally {
            IOUtils.closeQuietly(reader);
        }
    }
1085003
@SuppressWarnings("unchecked")
    public <T> Serializer<T> getSerializer(Class<T> type, String mediaType) throws SerializationException {
        checkNotNull(type, "Type (Class<T>) cannot be null.");
        checkNotNull(mediaType, "Media-Type cannot be null.");

        final String typeName = getClassName(type);
        final Key key = new Key(typeName, mediaType);

        logger.log(Level.FINE, "Querying for Serializer of type '" + typeName + "' and " + "media-type '" + mediaType
                + "'.");

        ArrayList<SerializerHolder> holders = serializers.get(typeName);
        if (holders != null) {
            for (SerializerHolder holder : holders) {
                if (holder.key.matches(key)) {
                    logger.log(Level.FINE, "Serializer for type '" + holder.serializer.handledType() + "' and " +
                            "media-type '" + Arrays.toString(holder.serializer.mediaType()) + "' matched: " +
                            holder.serializer.getClass().getName());
                    return (Serializer<T>) holder.serializer;
                }
            }
        }

        logger.log(Level.WARNING, "There is no Serializer registered for type " + type.getName() +
                " and media-type " + mediaType + ". If you're relying on auto-generated serializers," +
                " please make sure you imported the correct GWT Module.");

        return null;
    }
191161
private Class getCollectionType()
  {
    Class collectionType = Collection.class;
    IParsedElement parent = getParsedElement().getParent();
    if( parent instanceof NewExpression )
    {
      IType newType = ((NewExpression)parent).getType();
      IJavaClassInfo classInfo = IRTypeResolver.getJavaBackedClass(newType);
      Class javaBackedClass = classInfo != null ? classInfo.getBackingClass() : null;
      if( classInfo != null && javaBackedClass != null )
      {
        collectionType = javaBackedClass;
      }
      else if( JavaTypes.getJreType(AbstractCollection.class).isAssignableFrom( newType ) )
      {
        collectionType = AbstractCollection.class;
      }
    }
    return collectionType;
  }
754310
@Override
    public <X extends Archive<X>> X getAsType(Class<X> type, String path) {
        return this.getArchive().getAsType(type, path);
    }
1290292
public static ArchetypeCatalog getArchetypeCatalog(Artifact artifact) throws Exception {
        File file = artifact.getFile();
        if (file != null) {
            URL url = new URL("file", (String) null, file.getAbsolutePath());
            URLClassLoader loader = new URLClassLoader(new URL[]{url});
            InputStream is = loader.getResourceAsStream("archetype-catalog.xml");
            if (is != null) {
                return (new ArchetypeCatalogXpp3Reader()).read(is);
            }
        }
        return null;
    }
1165989
private Supplier getFormatterForType(String type) {
    switch(type) {
      case "s":           //string stored in shared table
        if (!lastContents.isEmpty()) {
            int idx = Integer.parseInt(lastContents);
            return new StringSupplier(new XSSFRichTextString(sst.getEntryAt(idx)).toString());
        }
        return new StringSupplier(lastContents);
      case "inlineStr":   //inline string (not in sst)
      case "str":
        return new StringSupplier(new XSSFRichTextString(lastContents).toString());
      case "e":           //error type
        return new StringSupplier("ERROR:  " + lastContents);
      case "n":           //numeric type
        if(currentCell.getNumericFormat() != null && lastContents.length() > 0) {
          // the formatRawCellContents operation incurs a significant overhead on large sheets,
          // and we want to defer the execution of this method until the value is actually needed.
          // it is not needed in all cases..
          final String currentLastContents = lastContents;
          final int currentNumericFormatIndex = currentCell.getNumericFormatIndex();
          final String currentNumericFormat = currentCell.getNumericFormat();

          return new Supplier() {
            String cachedContent;

            @Override
            public Object getContent() {
              if (cachedContent == null) {
                cachedContent = dataFormatter.formatRawCellContents(
                        Double.parseDouble(currentLastContents),
                        currentNumericFormatIndex,
                        currentNumericFormat);
              }

              return cachedContent;
            }
          };
        } else {
          return new StringSupplier(lastContents);
        }
      default:
        return new StringSupplier(lastContents);
    }
  }