com.fasterxml.jackson.databind.util.NameTransformer.java Source code

Java tutorial

Introduction

Here is the source code for com.fasterxml.jackson.databind.util.NameTransformer.java

Source

package com.fasterxml.jackson.databind.util;

public abstract class NameTransformer {
    public static final NameTransformer NOP = new NameTransformer() {
        public String transform(String paramAnonymousString) {
            return paramAnonymousString;
        }
    };

    public static NameTransformer chainedTransformer(NameTransformer paramNameTransformer1,
            NameTransformer paramNameTransformer2) {
        return new Chained(paramNameTransformer1, paramNameTransformer2);
    }

    public static NameTransformer simpleTransformer(String paramString1, final String paramString2) {
        int i = 1;
        int j;
        if ((paramString1 != null) && (paramString1.length() > 0)) {
            j = i;
            if ((paramString2 == null) || (paramString2.length() <= 0))
                break label49;
        }
        while (true)
            if (j != 0) {
                if (i != 0) {
                    return new NameTransformer() {
                        public String toString() {
                            return "[PreAndSuffixTransformer('" + this.val$prefix + "','" + paramString2 + "')]";
                        }

                        public String transform(String paramAnonymousString) {
                            return this.val$prefix + paramAnonymousString + paramString2;
                        }
                    };
                    j = 0;
                    break;
                    label49: i = 0;
                    continue;
                }
                return new NameTransformer() {
                    public String toString() {
                        return "[PrefixTransformer('" + this.val$prefix + "')]";
                    }

                    public String transform(String paramAnonymousString) {
                        return this.val$prefix + paramAnonymousString;
                    }
                };
            }
        if (i != 0)
            return new NameTransformer() {
                public String toString() {
                    return "[SuffixTransformer('" + this.val$suffix + "')]";
                }

                public String transform(String paramAnonymousString) {
                    return paramAnonymousString + this.val$suffix;
                }
            };
        return NOP;
    }

    public abstract String transform(String paramString);

    public static class Chained extends NameTransformer {
        protected final NameTransformer _t1;
        protected final NameTransformer _t2;

        public Chained(NameTransformer paramNameTransformer1, NameTransformer paramNameTransformer2) {
            this._t1 = paramNameTransformer1;
            this._t2 = paramNameTransformer2;
        }

        public String toString() {
            return "[ChainedTransformer(" + this._t1 + ", " + this._t2 + ")]";
        }

        public String transform(String paramString) {
            return this._t1.transform(this._t2.transform(paramString));
        }
    }
}

/* Location:           /Users/dantheman/src/fffffffffattttt/basis/classes_dex2jar.jar
 * Qualified Name:     com.fasterxml.jackson.databind.util.NameTransformer
 * JD-Core Version:    0.6.2
 */