Skip to main content
aboutsummaryrefslogtreecommitdiffstats
blob: dd6b1202428f2436ee412638843d436bd8a583fb (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
/*******************************************************************************
 * Copyright (c) 2006 Oracle Corporation.
 * All rights reserved. This program and the accompanying materials
 * are made available under the terms of the Eclipse Public License 2.0
 * which accompanies this distribution, and is available at
 * https://www.eclipse.org/legal/epl-2.0/
 *
 * SPDX-License-Identifier: EPL-2.0
 *
 * Contributors:
 *    Cameron Bateman/Oracle - initial API and implementation
 *    
 ********************************************************************************/

package org.eclipse.jst.jsf.common.internal.types;

import org.eclipse.jdt.core.Signature;

/**
 * Package utility class
 * @author cbateman
 *
 */
/*package*/final class TypeUtil 
{
    /**
     * @param assignmentType
     * @return true if assignmentType has lhs flag set
     */
    public static boolean matchesLHS(int assignmentType)
    {
        return (assignmentType & IAssignable.ASSIGNMENT_TYPE_LHS) != 0;
    }
    
    /**
     * @param assignmentType
     * @return true if assignmentType has rhs flag set
     */
    public static boolean matchesRHS(int assignmentType)
    {
        return (assignmentType & IAssignable.ASSIGNMENT_TYPE_RHS) != 0;
    }

    /**
     * @param signature
     * @return true if the signature is a method signature
     */
    public static boolean isMethodSignature(final String signature)
    {
        // method signature must start with a "("
        return signature.charAt(0) == Signature.C_PARAM_START;
    }
    private TypeUtil() {/*not instantiable*/}
}

Back to the top