
net.javapla.jawn.core.AbstractContext Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of jawn-core Show documentation
Show all versions of jawn-core Show documentation
java-web-planet / jawn - A simple web framework in Java
The newest version!
package net.javapla.jawn.core;
import java.lang.reflect.Type;
import java.nio.charset.Charset;
import java.nio.charset.StandardCharsets;
import java.util.HashMap;
import java.util.LinkedHashMap;
import java.util.List;
import java.util.Map;
import java.util.Optional;
import net.javapla.jawn.core.util.StringUtil;
import net.javapla.jawn.core.util.URLCodec;
public abstract class AbstractContext implements Context {
// session
// flash
// attributes
/* Attributes */
private HashMap attributes;
private void instantiateAttributes() {
if (attributes == null) attributes = new HashMap<>(3);
}
private Object attributeOrNull(final String name) {
if (attributes == null || attributes.isEmpty()) return null;
return attributes.get(name);
}
@Override
public Context attribute(final String name, final Object value) {
instantiateAttributes();
attributes.put(name, value);
return this;
}
@Override
public Optional
© 2015 - 2025 Weber Informatics LLC | Privacy Policy