Java Code Examples for org.eclipse.jdt.core.dom.PrimitiveType#CHAR
The following examples show how to use
org.eclipse.jdt.core.dom.PrimitiveType#CHAR .
You can vote up the ones you like or vote down the ones you don't like,
and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source File: ParameterGuesser.java From eclipse.jdt.ls with Eclipse Public License 2.0 | 5 votes |
private PrimitiveType.Code getPrimitiveTypeCode(String type) { PrimitiveType.Code code= PrimitiveType.toCode(type); if (code != null) { return code; } if (fEnclosingElement != null && JavaModelUtil.is50OrHigher(fEnclosingElement.getJavaProject())) { if (code == PrimitiveType.SHORT) { if ("java.lang.Short".equals(type)) { //$NON-NLS-1$ return code; } } else if (code == PrimitiveType.INT) { if ("java.lang.Integer".equals(type)) { //$NON-NLS-1$ return code; } } else if (code == PrimitiveType.LONG) { if ("java.lang.Long".equals(type)) { //$NON-NLS-1$ return code; } } else if (code == PrimitiveType.FLOAT) { if ("java.lang.Float".equals(type)) { //$NON-NLS-1$ return code; } } else if (code == PrimitiveType.DOUBLE) { if ("java.lang.Double".equals(type)) { //$NON-NLS-1$ return code; } } else if (code == PrimitiveType.CHAR) { if ("java.lang.Character".equals(type)) { //$NON-NLS-1$ return code; } } else if (code == PrimitiveType.BYTE) { if ("java.lang.Byte".equals(type)) { //$NON-NLS-1$ return code; } } } return null; }
Example 2
Source File: ParameterGuesser.java From Eclipse-Postfix-Code-Completion with Eclipse Public License 1.0 | 5 votes |
private PrimitiveType.Code getPrimitiveTypeCode(String type) { PrimitiveType.Code code= PrimitiveType.toCode(type); if (code != null) { return code; } if (fEnclosingElement != null && JavaModelUtil.is50OrHigher(fEnclosingElement.getJavaProject())) { if (code == PrimitiveType.SHORT) { if ("java.lang.Short".equals(type)) { //$NON-NLS-1$ return code; } } else if (code == PrimitiveType.INT) { if ("java.lang.Integer".equals(type)) { //$NON-NLS-1$ return code; } } else if (code == PrimitiveType.LONG) { if ("java.lang.Long".equals(type)) { //$NON-NLS-1$ return code; } } else if (code == PrimitiveType.FLOAT) { if ("java.lang.Float".equals(type)) { //$NON-NLS-1$ return code; } } else if (code == PrimitiveType.DOUBLE) { if ("java.lang.Double".equals(type)) { //$NON-NLS-1$ return code; } } else if (code == PrimitiveType.CHAR) { if ("java.lang.Character".equals(type)) { //$NON-NLS-1$ return code; } } else if (code == PrimitiveType.BYTE) { if ("java.lang.Byte".equals(type)) { //$NON-NLS-1$ return code; } } } return null; }