Fetch the complete definition of a given type name which is unique.

@param typeName name of a type which is unique.
348476
@GET
    @Path("{typeName}")
    @Produces(Servlets.JSON_MEDIA_TYPE)
    public Response getDefinition(@Context HttpServletRequest request, @PathParam("typeName") String typeName) {
        if (LOG.isDebugEnabled()) {
            LOG.debug("==> TypesResource.getDefinition({})", typeName);
        }

        AtlasPerfTracer perf = null;

        if (AtlasPerfTracer.isPerfTraceEnabled(PERF_LOG)) {
            perf = AtlasPerfTracer.getPerfTracer(PERF_LOG, "TypesResource.getDefinition(" + typeName + ")");
        }

        JSONObject response = new JSONObject();

        try {
            TypesDef typesDef       = TypeConverterUtil.toTypesDef(typeRegistry.getType(typeName), typeRegistry);;
            String   typeDefinition = TypesSerialization.toJson(typesDef);

            response.put(AtlasClient.TYPENAME, typeName);
            response.put(AtlasClient.DEFINITION, new JSONObject(typeDefinition));
            response.put(AtlasClient.REQUEST_ID, Servlets.getRequestId());

            return Response.ok(response).build();
        } catch (AtlasBaseException e) {
            LOG.error("Unable to get type definition for type {}", typeName, e);
            throw new WebApplicationException(Servlets.getErrorResponse(e));
        } catch (JSONException | IllegalArgumentException e) {
            LOG.error("Unable to get type definition for type {}", typeName, e);
            throw new WebApplicationException(Servlets.getErrorResponse(e, Response.Status.BAD_REQUEST));
        } catch (WebApplicationException e) {
            LOG.error("Unable to get type definition for type {}", typeName, e);
            throw e;
        } catch (Throwable e) {
            LOG.error("Unable to get type definition for type {}", typeName, e);
            throw new WebApplicationException(Servlets.getErrorResponse(e, Response.Status.INTERNAL_SERVER_ERROR));
        } finally {
            AtlasPerfTracer.log(perf);

            if (LOG.isDebugEnabled()) {
                LOG.debug("<== TypesResource.getDefinition({})", typeName);
            }
        }
    }
1096620
public Deferred<byte[]> getUIDAsync(final UniqueIdType type, final String name) {
    if (name == null || name.isEmpty()) {
      throw new IllegalArgumentException("Missing UID name");
    }
    switch (type) {
      case METRIC:
        return metrics.getIdAsync(name);
      case TAGK:
        return tag_names.getIdAsync(name);
      case TAGV:
        return tag_values.getIdAsync(name);
      default:
        throw new IllegalArgumentException("Unrecognized UID type");
    }
  }
285311
public static StatusGroup get(final String _typeName)
        throws CacheReloadException
    {
        final Cache<String, StatusGroup> cache = InfinispanCache.get().<String, StatusGroup>getCache(
                        Status.NAMECACHE4GRP);
        if (!cache.containsKey(_typeName)) {
            Status.getStatusGroupFromDB(Status.SQL_NAME4GRP, _typeName);
        }
        return cache.get(_typeName);
    }
1222526
public static BindTransform lookup(TypeName typeName) {
		BindTransform transform = cache.get(typeName);

		if (transform != null) {
			return transform;
		}

		transform = getTransform(typeName);

		AssertKripton.assertTrueOrUnsupportedFieldTypeException(transform != null, typeName);
		
		// transform will be always valorized
		cache.put(typeName, transform);

		return transform;
	}
1272803
public JavaClassModel getByName(String qualifiedName) throws NonUniqueResultException
    {
        ExecutionStatistics.get().begin("getUniqueByName(qualifiedName)");
        JavaClassModel result = resolveByQualifiedName(qualifiedName);
        ExecutionStatistics.get().end("getUniqueByName(qualifiedName)");
        return result;
    }
955891
public static String getNameWithTypeParameters(IType type) {
		assert type != null;
		final String superName = type.getFullyQualifiedName('.');
		if (!JavaModelUtil.is50OrHigher(type.getJavaProject())) {
			return superName;
		}
		try {
			final ITypeParameter[] typeParameters = type.getTypeParameters();
			if (typeParameters != null && typeParameters.length > 0) {
				final StringBuffer buf = new StringBuffer(superName);
				buf.append('<');
				for (int k = 0; k < typeParameters.length; ++k) {
					if (k != 0) {
						buf.append(',').append(' ');
					}
					buf.append(typeParameters[k].getElementName());
				}
				buf.append('>');
				return buf.toString();
			}
		} catch (JavaModelException e) {
			// ignore
		}
		return superName;

	}
547910
public SymbolType withName(String name) {
        return clone(marker, name, arrayCount, typeVariable, null, null);
    }
563236
public TypeDefinition getTypeDefinition(String typeId) {

        refresh();
        TypeDefinitionContainer tc = m_types.get(typeId);
        if (tc == null) {
            throw new CmisObjectNotFoundException("Type '" + typeId + "' is unknown!");
        }

        return copyTypeDefintion(tc.getTypeDefinition());
    }
1092004
public static JdbcType getJdbcTypeByName(String typeName)
    {
        JdbcType result = null;
        result = (JdbcType) jdbcObjectTypesFromName.get(typeName.toLowerCase());
        if (result == null)
        {
            throw new OJBRuntimeException("The type " + typeName + " can not be handled by OJB." +
                    " Please specify only types as defined by java.sql.Types.");
        }
        return result;
    }
31219
public Optional<FieldTypes.Type> mapType(String typeName) {
        return Optional.ofNullable(TYPE_MAP.get(typeName));
    }
1083642
public TypeName typeName(ProtoType protoType) {
    TypeName profileJavaName = profile.getTarget(protoType);
    if (profileJavaName != null) return profileJavaName;
    TypeName candidate = nameToJavaName.get(protoType);
    checkArgument(candidate != null, "unexpected type %s", protoType);
    return candidate;
  }
49040
def v_unique_name_defintions(ctx, stmt):
    """"""
    defs = [('typedef', 'TYPE_ALREADY_DEFINED', stmt.i_typedefs),
            ('grouping', 'GROUPING_ALREADY_DEFINED', stmt.i_groupings)]
    def f(s):
        for (keyword, errcode, dict) in defs:
            if s.keyword == keyword and s.arg in dict:
                err_add(ctx.errors, dict[s.arg].pos,
                        errcode, (s.arg, s.pos))

    for i in stmt.search('include'):
        submodulename = i.arg
        subm = ctx.get_module(submodulename)
        if subm is not None:
            for s in subm.substmts:
                for ss in s.substmts:
                    iterate_stmt(ss, f)
1295078
@Requires("element != null")
  @Ensures("result != null")
  TypeName getGenericTypeName(TypeParameterElement element) {
    String name = element.getSimpleName().toString();
    List<? extends TypeMirror> bounds = element.getBounds();
    if (bounds.isEmpty()
        || (bounds.size() == 1
            && bounds.get(0).toString().equals("java.lang.Object"))) {
      return new TypeName(name);
    }

    StringBuilder buffer = new StringBuilder();
    buffer.append(name);
    buffer.append(" extends ");

    Iterator<? extends TypeMirror> iter = bounds.iterator();
    for (;;) {
      buffer.append(iter.next().toString());
      if (!iter.hasNext()) {
        break;
      }
      buffer.append(" & ");
    }

    return new TypeName(buffer.toString());
  }
1162994
private static String getSimpleTypeName(TypeReference typ) {
    final Map<String, String> mapFullTypeName =
        ImmutableMap.<String, String>builder()
            .put("B", "byte")
            .put("C", "char")
            .put("D", "double")
            .put("F", "float")
            .put("I", "int")
            .put("J", "long")
            .put("S", "short")
            .put("Z", "boolean")
            .build();
    if (typ.isArrayType()) return "Array";
    String typName = typ.getName().toString();
    if (typName.startsWith("L")) {
      typName = typName.split("<")[0].substring(1); // handle generics
      typName = typName.substring(typName.lastIndexOf('/') + 1); // get unqualified name
      typName = typName.substring(typName.lastIndexOf('$') + 1); // handle inner classes
    } else {
      typName = mapFullTypeName.get(typName);
    }
    return typName;
  }
248315
public static String evaluateName(final String _typeName,
                                      final String _name)
    {
        final StringBuilder ret = new StringBuilder();
        ret.append(_typeName).append(":").append(_name).toString();
        return ret.toString();
    }
551224
protected String getUniqueIdentifier(JvmType type) {
		String typeIdentifier = type.getIdentifier();
		if (type instanceof JvmTypeParameter) {
			JvmIdentifiableElement declarator = (JvmIdentifiableElement) ((JvmTypeParameter) type).getDeclarator();
			// may happen in unit tests
			if (declarator != null) {
				typeIdentifier = typeIdentifier + ":" + declarator.getQualifiedName();
			} else {
				typeIdentifier = typeIdentifier + ":";
			}
		}
		return typeIdentifier;
	}
1254590
public TypeDefinition getType(String typeId) {

        refresh();
        TypeDefinitionContainer tc = m_types.get(typeId);
        if (tc == null) {
            return null;
        }

        return tc.getTypeDefinition();
    }