Use this if the class does not have a {@link com.fasterxml.jackson.annotation.JsonTypeName} annotation.
@param klass
@param name
439207
protected void registerJacksonSubtype(Class<?> klass, String name) {
        jacksonSubTypesBinder().addBinding().toInstance(new NamedType(klass, name));
    }
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;
	}
883363
public static <T> JacksonParser<T> json(Class<T> contentType) {
        return new JacksonParser<>(null, contentType);
    }
427458
@XmlAttribute(name="name", required=true)
    public void setClassName(String className) {
        ArgUtils.notEmpty(className, "className");
        this.className = className;
    }
1255320
@SuppressWarnings("unchecked")
    static void registerAnnotationType(AnnotationClassValue<?> annotationClassValue) {
        final String name = annotationClassValue.getName();
        if (!ANNOTATION_TYPES.containsKey(name)) {
            annotationClassValue.getType().ifPresent((Consumer<Class<?>>) aClass -> {
                if (Annotation.class.isAssignableFrom(aClass)) {
                    ANNOTATION_TYPES.put(name, (Class<? extends Annotation>) aClass);
                }
            });
        }
    }
915274
public void addMatch(String name, PseudoClassType pseudoClass)
    {
        if (names == null)
            names = new HashMap<String, Set<PseudoClassType>>();
        
        Set<PseudoClassType> classes = names.get(name);
        if (classes == null)
        {
            classes = new HashSet<PseudoClassType>(2);
            names.put(name, classes);
        }
        classes.add(pseudoClass);
    }
1223071
public void importClass(final String name) {
        this.importedClasses.put(Name.suffix(name, 1), name);
        this.nameSpaceChanged();
    }
1223815
public static TypeDesc forClass(String name)
        throws IllegalArgumentException
    {
        // TODO: Figure out how to cache these. Using a plain IdentityMap poses
        // a problem. The back reference to the key causes a memory leak.

        if (name.length() < 1) {
            throw invalidName(name);
        }

        int index1 = name.lastIndexOf('[');
        int index2 = name.lastIndexOf(']');
        if (index2 >= 0) {
            if (index2 + 1 != name.length() || index1 + 1 != index2) {
                throw invalidName(name);
            }
            try {
                return forClass(name.substring(0, index1)).toArrayType();
            }
            catch (IllegalArgumentException e) {
                throw invalidName(name);
            }
        }
        else if (index1 >= 0) {
            throw invalidName(name);
        }

        switch (name.charAt(0)) {
        case 'v':
            if (name.equals("void")) {
                return VOID;
            }
            break;
        case 'b':
            if (name.equals("boolean")) {
                return BOOLEAN;
            }
            else if (name.equals("byte")) {
                return BYTE;
            }
            break;
        case 'c':
            if (name.equals("char")) {
                return CHAR;
            }
            break;
        case 's':
            if (name.equals("short")) {
                return SHORT;
            }
            break;
        case 'i':
            if (name.equals("int")) {
                return INT;
            }
            break;
        case 'l':
            if (name.equals("long")) {
                return LONG;
            }
            break;
        case 'f':
            if (name.equals("float")) {
                return FLOAT;
            }
            break;
        case 'd':
            if (name.equals("double")) {
                return DOUBLE;
            }
            break;
        }

        String desc = generateDescriptor(name);
        if (name.indexOf('/') >= 0) {
            name = name.replace('/', '.');
        }
        return intern(new ObjectType(desc, name));
    }
269449
public JsonPropertyBuilder<T, P> name(String name) {
		return new JsonPropertyBuilder<T, P>(coderClass, name, null, null);
	}
824384
@com.fasterxml.jackson.annotation.JsonProperty("clusterName")
    public void setClusterName(String clusterName) {
        this.clusterName = clusterName;
    }
674492
@Override
    public void visit(String name, Object value) {
        if (tc.isDebugEnabled()) {
            Tr.debug(tc, MessageFormat.format("visit [ {0} ] Name [ {1} ] Value [ 2 ]",
                                              getHashText(), name, value));
        }

        if (value instanceof Type) {
            Type valueAsType = (Type) value;

            // TODO: The value stored as the class name, not as an info object.
            //       For now, let the caller obtain the value as a class info.
            //
            //       Whether to allow resolution of class values as class info
            //       objects is an open question.  No particular value is known
            //       at this time for adding a class info type access API.
            //
            // See the similar code in 'InfoVisitor_DefaultValue.visit(String, Object)'.

            // value = infoStore.getDelayableClassInfo( valueAsType.getClassName() );

            value = valueAsType.getClassName();
        }

        AnnotationValueImpl newAnnotationValue = new AnnotationValueImpl(value);

        storeAnnotationValue(name, newAnnotationValue);
    }
682485
public void setElementType (Class type, String fieldName, Class elementType) {
		ObjectMap<String, FieldMetadata> fields = getFields(type);
		FieldMetadata metadata = fields.get(fieldName);
		if (metadata == null) throw new JsonException("Field not found: " + fieldName + " (" + type.getName() + ")");
		metadata.elementType = elementType;
	}
1087905
@Nullable
  public static <ENUMTYPE extends Enum <ENUMTYPE> & IHasName> ENUMTYPE getFromNameOrNull (@Nonnull final Class <ENUMTYPE> aClass,
                                                                                          @Nullable final String sName)
  {
    return getFromNameOrDefault (aClass, sName, null);
  }
870354
public static <T> T fromJSON(final Class<T> targetClass, final String json) {
        if (targetClass.equals(JsonObject.class)) {
            return (T) JsonObject.from(N.fromJSON(Map.class, json));
        } else if (targetClass.equals(JsonArray.class)) {
            return (T) JsonArray.from(N.fromJSON(List.class, json));
        } else if (targetClass.equals(JsonDocument.class)) {
            final JsonObject jsonObject = JsonObject.from(N.fromJSON(Map.class, json));
            final String id = N.stringOf(jsonObject.get(_ID));

            jsonObject.removeKey(_ID);

            return (T) JsonDocument.create(id, jsonObject);
        } else {
            throw new IllegalArgumentException("Unsupported type: " + ClassUtil.getCanonicalClassName(targetClass));
        }
    }
1046090
static Field field(final Class<?> klass, final String name) throws NoSuchFieldException {
        try {
            return klass.getDeclaredField(name);
        } catch (final NoSuchFieldException nsfe) {
            final Class<?> superclass = klass.getSuperclass();
            if (superclass == null) {
                throw nsfe;
            }
            return field(superclass, name);
        }
    }
727586
public ParameterizedTypeName nestedClass(String name) {
    checkNotNull(name, "name == null");
    return new ParameterizedTypeName(this, rawType.nestedClass(name), new ArrayList<>(),
        new ArrayList<>());
  }
557008
public JClass forName(String name)
  {
    SoftReference<JClass> jClassRef = _classMap.get(name);

    JClass jClass = jClassRef != null ? jClassRef.get() : null;

    if (jClass == null) {
      jClass = _staticClassMap.get(name);

      if (jClass == null) {
        if (name.startsWith("[")) {
          JClass subClass = descriptorToClass(name, 1);
          jClass = new JClassArray(subClass);
        }
        else
          jClass = loadClass(name);
      }
      
      _classMap.put(name, new SoftReference<JClass>(jClass));
    }

    return jClass;
  }