All Downloads are FREE. Search and download functionalities are using the official Maven repository.

org.nutz.mvc.impl.NutMessageMap Maven / Gradle / Ivy

Go to download

Nutz, which is a collections of lightweight frameworks, each of them can be used independently

There is a newer version: 1.r.72
Show newest version
package org.nutz.mvc.impl;

import java.util.HashMap;

import org.nutz.lang.Strings;
import org.nutz.lang.segment.Segment;
import org.nutz.lang.segment.Segments;
import org.nutz.lang.util.Context;

public class NutMessageMap extends HashMap {

	private static final long serialVersionUID = 3910572112957799492L;

	public Object get(Object key) {
		return Strings.sNull(super.get(key), key.toString());
	}

	public String get(String key, Context context) {
		Object obj = super.get(key);
		if (null == obj)
			return key;
		if (obj instanceof Segment)
			return Segments.replace((Segment) obj, context);
		return obj.toString();
	}

	public Object getObject(String key) {
		return super.get(key);
	}

}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy