// Decompiled by Jad v1.5.8e. Copyright 2001 Pavel Kouznetsov. // Jad home page: http://www.geocities.com/kpdus/jad.html // Decompiler options: braces fieldsfirst space lnc package com.fasterxml.jackson.annotation; import java.lang.annotation.Annotation; import java.util.Locale; import java.util.TimeZone; // Referenced classes of package com.fasterxml.jackson.annotation: // JacksonAnnotationValue public interface JsonFormat extends Annotation { public static final class Feature extends Enum { private static final Feature $VALUES[]; public static final Feature ACCEPT_SINGLE_VALUE_AS_ARRAY; public static final Feature WRITE_DATES_WITH_ZONE_ID; public static final Feature WRITE_DATE_TIMESTAMPS_AS_NANOSECONDS; public static final Feature WRITE_SINGLE_ELEM_ARRAYS_UNWRAPPED; public static final Feature WRITE_SORTED_MAP_ENTRIES; public static Feature valueOf(String s) { return (Feature)Enum.valueOf(com/fasterxml/jackson/annotation/JsonFormat$Feature, s); } public static Feature[] values() { return (Feature[])$VALUES.clone(); } static { ACCEPT_SINGLE_VALUE_AS_ARRAY = new Feature("ACCEPT_SINGLE_VALUE_AS_ARRAY", 0); WRITE_DATE_TIMESTAMPS_AS_NANOSECONDS = new Feature("WRITE_DATE_TIMESTAMPS_AS_NANOSECONDS", 1); WRITE_DATES_WITH_ZONE_ID = new Feature("WRITE_DATES_WITH_ZONE_ID", 2); WRITE_SINGLE_ELEM_ARRAYS_UNWRAPPED = new Feature("WRITE_SINGLE_ELEM_ARRAYS_UNWRAPPED", 3); WRITE_SORTED_MAP_ENTRIES = new Feature("WRITE_SORTED_MAP_ENTRIES", 4); $VALUES = (new Feature[] { ACCEPT_SINGLE_VALUE_AS_ARRAY, WRITE_DATE_TIMESTAMPS_AS_NANOSECONDS, WRITE_DATES_WITH_ZONE_ID, WRITE_SINGLE_ELEM_ARRAYS_UNWRAPPED, WRITE_SORTED_MAP_ENTRIES }); } private Feature(String s, int i) { super(s, i); } } public static class Features { private static final Features EMPTY = new Features(0, 0); private final int disabled; private final int enabled; public static Features construct(JsonFormat jsonformat) { return construct(jsonformat.with(), jsonformat.without()); } public static Features construct(Feature afeature[], Feature afeature1[]) { int i = 0; int l = afeature.length; for (int j = 0; j < l; j++) { i |= 1 << afeature[j].ordinal(); } l = 0; int i1 = afeature1.length; for (int k = 0; k < i1; k++) { l |= 1 << afeature1[k].ordinal(); } return new Features(i, l); } public static Features empty() { return EMPTY; } public Boolean get(Feature feature) { int i = 1 << feature.ordinal(); if ((disabled & i) != 0) { return Boolean.FALSE; } if ((enabled & i) != 0) { return Boolean.TRUE; } else { return null; } } public transient Features with(Feature afeature[]) { int j = enabled; int k = afeature.length; for (int i = 0; i < k; i++) { j |= 1 << afeature[i].ordinal(); } if (j == enabled) { return this; } else { return new Features(j, disabled); } } public transient Features without(Feature afeature[]) { int j = disabled; int k = afeature.length; for (int i = 0; i < k; i++) { j |= 1 << afeature[i].ordinal(); } if (j == disabled) { return this; } else { return new Features(enabled, j); } } private Features(int i, int j) { enabled = i; disabled = j; } } public static final class Shape extends Enum { private static final Shape $VALUES[]; public static final Shape ANY; public static final Shape ARRAY; public static final Shape BOOLEAN; public static final Shape NUMBER; public static final Shape NUMBER_FLOAT; public static final Shape NUMBER_INT; public static final Shape OBJECT; public static final Shape SCALAR; public static final Shape STRING; public static Shape valueOf(String s) { return (Shape)Enum.valueOf(com/fasterxml/jackson/annotation/JsonFormat$Shape, s); } public static Shape[] values() { return (Shape[])$VALUES.clone(); } public boolean isNumeric() { return this == NUMBER || this == NUMBER_INT || this == NUMBER_FLOAT; } public boolean isStructured() { return this == OBJECT || this == ARRAY; } static { ANY = new Shape("ANY", 0); SCALAR = new Shape("SCALAR", 1); ARRAY = new Shape("ARRAY", 2); OBJECT = new Shape("OBJECT", 3); NUMBER = new Shape("NUMBER", 4); NUMBER_FLOAT = new Shape("NUMBER_FLOAT", 5); NUMBER_INT = new Shape("NUMBER_INT", 6); STRING = new Shape("STRING", 7); BOOLEAN = new Shape("BOOLEAN", 8); $VALUES = (new Shape[] { ANY, SCALAR, ARRAY, OBJECT, NUMBER, NUMBER_FLOAT, NUMBER_INT, STRING, BOOLEAN }); } private Shape(String s, int i) { super(s, i); } } public static class Value implements JacksonAnnotationValue { private TimeZone _timezone; private final Features features; private final Locale locale; private final String pattern; private final Shape shape; private final String timezoneStr; public static Value forPattern(String s) { return new Value(s, null, null, null, null, Features.empty()); } public Boolean getFeature(Feature feature) { return features.get(feature); } public Locale getLocale() { return locale; } public String getPattern() { return pattern; } public Shape getShape() { return shape; } public TimeZone getTimeZone() { TimeZone timezone2 = _timezone; TimeZone timezone1 = timezone2; if (timezone2 == null) { if (timezoneStr == null) { return null; } timezone1 = TimeZone.getTimeZone(timezoneStr); _timezone = timezone1; } return timezone1; } public boolean hasLocale() { return locale != null; } public boolean hasPattern() { return pattern != null && pattern.length() > 0; } public boolean hasShape() { return shape != Shape.ANY; } public boolean hasTimeZone() { return _timezone != null || timezoneStr != null && !timezoneStr.isEmpty(); } public String timeZoneAsString() { if (_timezone != null) { return _timezone.getID(); } else { return timezoneStr; } } public Class valueFor() { return com/fasterxml/jackson/annotation/JsonFormat; } public Value withFeature(Feature feature) { feature = features.with(new Feature[] { feature }); if (feature == features) { return this; } else { return new Value(pattern, shape, locale, timezoneStr, _timezone, feature); } } public Value withLocale(Locale locale1) { return new Value(pattern, shape, locale1, timezoneStr, _timezone, features); } public Value withPattern(String s) { return new Value(s, shape, locale, timezoneStr, _timezone, features); } public Value withShape(Shape shape1) { return new Value(pattern, shape1, locale, timezoneStr, _timezone, features); } public Value withTimeZone(TimeZone timezone1) { return new Value(pattern, shape, locale, null, timezone1, features); } public Value withoutFeature(Feature feature) { feature = features.without(new Feature[] { feature }); if (feature == features) { return this; } else { return new Value(pattern, shape, locale, timezoneStr, _timezone, feature); } } public Value() { this("", Shape.ANY, "", "", Features.empty()); } public Value(JsonFormat jsonformat) { this(jsonformat.pattern(), jsonformat.shape(), jsonformat.locale(), jsonformat.timezone(), Features.construct(jsonformat)); } public Value(String s, Shape shape1, String s1, String s2) { this(s, shape1, s1, s2, Features.empty()); } public Value(String s, Shape shape1, String s1, String s2, Features features1) { if (s1 == null || s1.length() == 0 || "##default".equals(s1)) { s1 = null; } else { s1 = new Locale(s1); } if (s2 == null || s2.length() == 0 || "##default".equals(s2)) { s2 = null; } this(s, shape1, ((Locale) (s1)), s2, null, features1); } public Value(String s, Shape shape1, Locale locale1, String s1, TimeZone timezone1) { this(s, shape1, locale1, s1, timezone1, Features.empty()); } public Value(String s, Shape shape1, Locale locale1, String s1, TimeZone timezone1, Features features1) { pattern = s; s = shape1; if (shape1 == null) { s = Shape.ANY; } shape = s; locale = locale1; _timezone = timezone1; timezoneStr = s1; s = features1; if (features1 == null) { s = Features.empty(); } features = s; } public Value(String s, Shape shape1, Locale locale1, TimeZone timezone1) { this(s, shape1, locale1, timezone1, Features.empty()); } public Value(String s, Shape shape1, Locale locale1, TimeZone timezone1, Features features1) { pattern = s; s = shape1; if (shape1 == null) { s = Shape.ANY; } shape = s; locale = locale1; _timezone = timezone1; timezoneStr = null; s = features1; if (features1 == null) { s = Features.empty(); } features = s; } } public static final String DEFAULT_LOCALE = "##default"; public static final String DEFAULT_TIMEZONE = "##default"; public abstract String locale(); public abstract String pattern(); public abstract Shape shape(); public abstract String timezone(); public abstract Feature[] with(); public abstract Feature[] without(); }