org.eclipse.epp.internal.logging.aeri.ui.utils.EmfFieldExclusionStrategy.java Source code

Java tutorial

Introduction

Here is the source code for org.eclipse.epp.internal.logging.aeri.ui.utils.EmfFieldExclusionStrategy.java

Source

/**
 * Copyright (c) 2015 Codetrails GmbH.
 * All rights reserved. This program and the accompanying materials
 * are made available under the terms of the Eclipse Public License v1.0
 * which accompanies this distribution, and is available at
 * http://www.eclipse.org/legal/epl-v10.html
 *
 * Contributors:
 *    Marcel Bruch - initial API and implementation.
 */
package org.eclipse.epp.internal.logging.aeri.ui.utils;

import com.google.gson.ExclusionStrategy;
import com.google.gson.FieldAttributes;

public class EmfFieldExclusionStrategy implements ExclusionStrategy {
    @Override
    public boolean shouldSkipField(FieldAttributes f) {
        String name = f.getName();
        if (name.length() > 1 && name.charAt(0) == 'e' && Character.isUpperCase(name.charAt(1))) {
            return true;
        }
        return false;
    }

    @Override
    public boolean shouldSkipClass(Class<?> clazz) {
        return false;
    }
}