Called to compile java, css etc.

@param _type type tobe compiled
@return Response
198044
@GET
    public Response compile(@QueryParam("type") final String _type)
    {
        boolean success = false;
        try {
            if (hasAccess()) {
                AbstractRest.LOG.info("===Starting Compiler via REST===");
                if ("java".equalsIgnoreCase(_type)) {
                    AbstractRest.LOG.info("==Compiling Java==");
                    new ESJPCompiler(getClassPathElements()).compile(null, false);
                } else if ("css".equalsIgnoreCase(_type)) {
                    AbstractRest.LOG.info("==Compiling CSS==");
                    new CSSCompiler().compile();
                } else if ("js".equalsIgnoreCase(_type)) {
                    AbstractRest.LOG.info("==Compiling Javascript==");
                    new JavaScriptCompiler().compile();
                } else if ("wiki".equalsIgnoreCase(_type)) {
                    AbstractRest.LOG.info("==Compiling Wiki==");
                    new WikiCompiler().compile();
                } else if ("jasper".equalsIgnoreCase(_type)) {
                    AbstractRest.LOG.info("==Compiling JasperReports==");
                    new JasperReportCompiler(getClassPathElements()).compile();
                }
                success = true;
                AbstractRest.LOG.info("===Ending Compiler via REST===");
            }
        } catch (final InstallationException e) {
            AbstractRest.LOG.error("InstallationException", e);
        } catch (final EFapsException e) {
            AbstractRest.LOG.error("EFapsException", e);
        }
        return success ? Response.ok().build() : Response.noContent().build();
    }
940179
public void addType(final Type... _type)
        throws EFapsException
    {
        final List<Type> allType = new ArrayList<>();
        if (this.types.isEmpty()) {
            final Type type = Type.get(this.typeUUID);
            if (type.isAbstract()) {
                final List<Type> childTypes = type.getChildTypes()
                                .stream()
                                .filter(t -> !t.isAbstract())
                                .collect(Collectors.toList());
                allType.addAll(childTypes);
            } else {
                allType.add(type);
            }
        }
        for (final UUID type : this.types) {
            allType.add(Type.get(type));
        }
        for (final Type type : _type) {
            if (type.isAbstract()) {
                final List<Type> childTypes = type.getChildTypes()
                                .stream()
                                .filter(t -> !t.isAbstract())
                                .collect(Collectors.toList());
                allType.addAll(childTypes);
            } else {
                allType.add(type);
            }
        }

        //make for every type a list of types up to the parent
        final List<List<Type>> typeLists = new ArrayList<>();
        for (final Type type : allType) {
            final List<Type> typesTmp = new ArrayList<>();
            typeLists.add(typesTmp);
            Type tmpType = type;
            while (tmpType != null) {
                typesTmp.add(tmpType);
                tmpType = tmpType.getParentType();
            }
        }

        final Set<Type> common = new LinkedHashSet<>();
        if (!typeLists.isEmpty()) {
            final Iterator<List<Type>> iterator = typeLists.iterator();
            common.addAll(iterator.next());
            while (iterator.hasNext()) {
                common.retainAll(iterator.next());
            }
        }
        if (common.isEmpty()) {
            throw new EFapsException(QueryBuilder.class, "noCommon", allType);
        } else {
            // first common type
            this.typeUUID = common.iterator().next().getUUID();
            for (final Type type : allType) {
                this.types.add(type.getUUID());
            }
        }
        // special case handling
        if (this.types.size() == 1 && this.types.iterator().next().equals(this.typeUUID)) {
            this.types.clear();
        }
    }
1150805
public <C> C mapTo(Class<C> type) {
    DataFormatMapper mapper = dataFormat.getMapper();
    return mapper.mapInternalToJava(jsonNode, type);
  }
392905
private static TYPE toTYPE(String type) {
        if (null == type || type.trim().isEmpty()) {
            return TYPE.OBJECT;
        } else {
            return TYPE.valueOf(type.toUpperCase());
        }
    }
102467
private static CSLType toType(String type) {
		if (type.equalsIgnoreCase(TYPE_BILL)) {
			return CSLType.BILL;
		} else if (type.equalsIgnoreCase(TYPE_BOOK)) {
			return CSLType.BOOK;
		} else if (type.equalsIgnoreCase(TYPE_BOOK_SECTION)) {
			return CSLType.CHAPTER;
		} else if (type.equalsIgnoreCase(TYPE_CASE)) {
			return CSLType.ARTICLE;
		} else if (type.equalsIgnoreCase(TYPE_COMPUTER_PROGRAM)) {
			return CSLType.ARTICLE;
		} else if (type.equalsIgnoreCase(TYPE_CONFERENCE_PROCEEDINGS)) {
			return CSLType.PAPER_CONFERENCE;
		} else if (type.equalsIgnoreCase(TYPE_ENCYCLOPEDIA_ARTICLE)) {
			return CSLType.ENTRY_ENCYCLOPEDIA;
		} else if (type.equalsIgnoreCase(TYPE_FILM)) {
			return CSLType.MOTION_PICTURE;
		} else if (type.equalsIgnoreCase(TYPE_GENERIC)) {
			return CSLType.ARTICLE;
		} else if (type.equalsIgnoreCase(TYPE_HEARING)) {
			return CSLType.SPEECH;
		} else if (type.equalsIgnoreCase(TYPE_JOURNAL)) {
			return CSLType.ARTICLE_JOURNAL;
		} else if (type.equalsIgnoreCase(TYPE_MAGAZINE_ARTICLE)) {
			return CSLType.ARTICLE_MAGAZINE;
		} else if (type.equalsIgnoreCase(TYPE_NEWSPAPER_ARTICLE)) {
			return CSLType.ARTICLE_NEWSPAPER;
		} else if (type.equalsIgnoreCase(TYPE_PATENT)) {
			return CSLType.PATENT;
		} else if (type.equalsIgnoreCase(TYPE_REPORT)) {
			return CSLType.REPORT;
		} else if (type.equalsIgnoreCase(TYPE_STATUTE)) {
			return CSLType.LEGISLATION;
		} else if (type.equalsIgnoreCase(TYPE_TELEVISION_BROADCAST)) {
			return CSLType.BROADCAST;
		} else if (type.equalsIgnoreCase(TYPE_THESIS)) {
			return CSLType.THESIS;
		} else if (type.equalsIgnoreCase(TYPE_WEB_PAGE)) {
			return CSLType.WEBPAGE;
		} else if (type.equalsIgnoreCase(TYPE_WORKING_PAPER)) {
			return CSLType.ARTICLE;
		}
		return CSLType.ARTICLE;
	}
509157
private List<PostConstructInfo> processPostConstruct(TypeElement type) {
        List<PostConstructInfo> postConstructs = new ArrayList<>();

        ElementFilter.methodsIn(type.getEnclosedElements()).stream()
                .filter(method -> MoreElements.isAnnotationPresent(method, PostConstruct.class))
                .forEach(method -> {

                    // verify method
                    if (method.getModifiers().contains(Modifier.PRIVATE)) {
                        abortWithError(method, "@%s method must not be private", PostConstruct.class.getSimpleName());
                    }
                    if (method.getModifiers().contains(Modifier.STATIC)) {
                        abortWithError(method, "@%s method must not be static", PostConstruct.class.getSimpleName());
                    }
                    if (!method.getReturnType().equals(typeUtils.getNoType(TypeKind.VOID))) {
                        abortWithError(method, "@%s method must return void", PostConstruct.class.getSimpleName());
                    }
                    if (!method.getParameters().isEmpty()) {
                        abortWithError(method, "@%s method must not have parameters",
                                PostConstruct.class.getSimpleName());
                    }

                    postConstructs.add(new PostConstructInfo(method.getSimpleName().toString()));
                });

        if (postConstructs.size() > 1) {
            warning(type, "%d methods annotated with @%s found. Order is not guaranteed!", postConstructs.size(),
                    PostConstruct.class.getSimpleName());
        }
        return postConstructs;
    }
1093220
public <T> T toBean(Type type, boolean ignoreError) {
		return JSONConverter.jsonConvert(type, this, ignoreError);
	}
406302
public static final ClassInfo get(Class<?> type) {
    ClassInfo exist = cache.get(type);
    if (null != exist) return exist;
    synchronized (cache) {
      exist = cache.get(type);
      if (null != exist) return exist;

      Set<MethodInfo> methods = CollectUtils.newHashSet();
      Class<?> nextClass = type;
      int index = 0;
      Map<String, Class<?>> nextParamTypes = null;
      while (null != nextClass && Object.class != nextClass) {
        Method[] declaredMethods = nextClass.getDeclaredMethods();
        for (int i = 0, n = declaredMethods.length; i < n; i++) {
          Method method = declaredMethods[i];
          if (!goodMethod(method)) continue;
          Type[] types = method.getGenericParameterTypes();
          Class<?>[] paramsTypes = new Class<?>[types.length];
          for (int j = 0; j < types.length; j++) {
            Type t = types[j];
            if (t instanceof ParameterizedType) {
              paramsTypes[j] = (Class<?>) ((ParameterizedType) t).getRawType();
            } else if (t instanceof TypeVariable) {
              paramsTypes[j] = nextParamTypes.get(((TypeVariable<?>) t).getName());
            } else {
              paramsTypes[j] = (Class<?>) t;
            }
            if (null == paramsTypes[j]) paramsTypes[j] = Object.class;
          }
          if (!methods.add(new MethodInfo(index++, method, paramsTypes))) index--;
        }

        Type nextType = nextClass.getGenericSuperclass();
        nextClass = nextClass.getSuperclass();
        if (nextType instanceof ParameterizedType) {
          Map<String, Class<?>> tmp = CollectUtils.newHashMap();
          Type[] ps = ((ParameterizedType) nextType).getActualTypeArguments();
          TypeVariable<?>[] tvs = nextClass.getTypeParameters();
          for (int k = 0; k < ps.length; k++) {
            if (ps[k] instanceof Class<?>) {
              tmp.put(tvs[k].getName(), (Class<?>) ps[k]);
            } else if (ps[k] instanceof TypeVariable) {
              tmp.put(tvs[k].getName(), nextParamTypes.get(((TypeVariable<?>) ps[k]).getName()));
            }
          }
          nextParamTypes = tmp;
        } else {
          nextParamTypes = Collections.emptyMap();
        }
      }
      exist = new ClassInfo(methods);
      cache.put(type, exist);
      return exist;
    }
  }
495813
protected ClassInfoImpl getDelayableClassInfo(Type type) {
        String typeClassName = type.getClassName();

        if (tc.isDebugEnabled()) {
            // Type 'toString' answers the descriptor;
            // show the type class name, too, for clarity.

            Tr.debug(tc, MessageFormat.format("[ {0} ] ENTER [ {1} ] [ {2} ]",
                                              new Object[] { getHashText(), type, typeClassName }));
        }

        // Now that we have the type class name, pass it along instead
        // of recomputing when needed.

        ClassInfoImpl classInfo;
        String classInfoCase;

        int sort = type.getSort();
        if (sort == Type.ARRAY) {
            classInfo = getArrayClassInfo(typeClassName, type);
            classInfoCase = "array class";

        } else if (sort == Type.OBJECT) {
            classInfo = getDelayableClassInfo(typeClassName, DO_NOT_ALLOW_PRIMITIVE);

            if (classInfo.isJavaClass()) {
                if (classInfo.isDelayedClass()) {
                    classInfoCase = "java delayed";
                } else {
                    classInfoCase = "java non-delayed";
                }
            } else {
                if (classInfo.isDelayedClass()) {
                    classInfoCase = "non-java delayed";
                } else {
                    classInfoCase = "non-java non-delayed";
                }
            }

        } else {
            classInfo = getPrimitiveClassInfo(typeClassName, type);
            classInfoCase = "primitive class";
        }

        if (tc.isDebugEnabled()) {
            Tr.debug(tc, MessageFormat.format("[ {0} ] RETURN [ {1} ] [ {2} ]",
                                              new Object[] { getHashText(),
                                                            classInfo.getHashText(),
                                                            classInfoCase }));
        }
        return classInfo;
    }
1202550
function toTypeRef(type) {
    if (!type) {
      return (0, _typeOf.typeOf)(type);
    } else if (type.constructor === String || type instanceof Function) {
      return type;
    }

    return (0, _typeOf.typeOf)(type);
  }
179589
public static String print(Type type) {
        return type.match(new Type.MatchBlock<String>(){
            @Override
            public String _case(Ref x) {
                return print(x.type);
            }

            @Override
            public String _case(Primitive x) {
                return print(x.type);
            }
            
        });
    }
907232
public final void setType(final NotifyType type) {
        setType((type != null) ? type.getCssName() : NotifyType.INFO.getCssName());
    }
536218
public static String classDescriptor(Type type, Types types) {
    SigGen sig = new SigGen(types);
    sig.assembleClassSig(types.erasure(type));
    return sig.toString();
  }
210719
public static boolean isObjClass(Class<?> type) {
        if (type.isPrimitive() || type.isEnum() || type.isArray()) {
            return false;
        }

        String block = BASIC_PACKAGE_PREFIX_LIST.stream().filter(prefix -> type.getName().startsWith(prefix)).findAny().orElse(null);
        if (block != null) {
            return false;
        }

        return !PRIMITIVE_CLASS_LIST.contains(type);
    }
608059
function getJavaType(type) {
    var result


    if (-1 == NativeTypes.indexOf(type.name)) {
        result = "<a href='javascript:showInterface(\"" + type.name + "\"); void(0);'>" + type.name + "</a>"
    }
    else {
        result = IDL2Java[type.name]
        if (!result) {
            result = "?" + type.name + "?"
            console.log("Unable to translate IDL type to Java: " + type.name)
        }
    }

    for (var i=0; i<type.rank; i++) {
        result += "[]"
    }

    return "<span class='type'>" + result + "</span>"
}
372471
private static BaseTypeConverter lookupTypeConverter(Class type) {
        BaseTypeConverter converter = (BaseTypeConverter)TYPE_CONVERTERS.get(type);
        if(converter == null) {
            String msg = "Could not find a TypeConverter for converting a String to an object of type \"" +
                (type != null ? type.getName() : null) + "\"";
            TypeConverterNotFoundException tcn = new TypeConverterNotFoundException(msg);

            if(type == null)
                msg = Bundle.getErrorString("TypeUtils_nullType");
            else
                msg = Bundle.getErrorString("TypeUtils_noConverterForType", new Object[]{type.getName()});
            tcn.setLocalizedMessage(msg);
            LOGGER.error(msg);

            throw tcn;
        }

        return converter;
    }
372335
public <T> T dataToType(Class<T> type) {
        return Reflection.toType(data, type);
    }