private boolean checkForBoolean(final int oldPosition, final String rem_expr) { boolean isBoolean = false; if ("true".equals(rem_expr) || "false".equals(rem_expr)) { curPosition = curPosition + rem_expr.length(); tokens.appendEdmTypedToken(oldPosition, TokenKind.SIMPLE_TYPE, rem_expr, new EdmLiteral(EdmSimpleTypeFacadeImpl .getEdmSimpleType(EdmSimpleTypeKind.Boolean), rem_expr)); isBoolean = true; } return isBoolean; }
private boolean checkForBoolean(final int oldPosition, final String rem_expr) { boolean isBoolean = false; if ("true".equals(rem_expr) || "false".equals(rem_expr)) { curPosition = curPosition + rem_expr.length(); tokens.appendEdmTypedToken(oldPosition, TokenKind.SIMPLE_TYPE, rem_expr, new EdmLiteral(EdmSimpleTypeFacadeImpl .getEdmSimpleType(EdmSimpleTypeKind.Boolean), rem_expr)); isBoolean = true; } return isBoolean; }
private boolean checkForBoolean(final int oldPosition, final String rem_expr) { boolean isBoolean = false; if (rem_expr.equals("true") || rem_expr.equals("false")) { curPosition = curPosition + rem_expr.length(); tokens.appendEdmTypedToken(oldPosition, TokenKind.SIMPLE_TYPE, rem_expr, new EdmLiteral(EdmSimpleTypeFacadeImpl .getEdmSimpleType(EdmSimpleTypeKind.Boolean), rem_expr)); isBoolean = true; } return isBoolean; }
private static EdmLiteral createEdmLiteral(final EdmSimpleTypeKind typeKind, final String literal, final int prefixLength, final int suffixLength) throws EdmLiteralException { final EdmSimpleType type = getEdmSimpleType(typeKind); if (type.validate(literal, EdmLiteralKind.URI, null)) { return new EdmLiteral(type, literal.substring(prefixLength, literal.length() - suffixLength)); } else { throw new EdmLiteralException(EdmLiteralException.LITERALFORMAT.addContent(literal)); } }
private static EdmLiteral createEdmLiteral(final EdmSimpleTypeKind typeKind, final String literal, final int prefixLength, final int suffixLength) throws EdmLiteralException { final EdmSimpleType type = getEdmSimpleType(typeKind); if (type.validate(literal, EdmLiteralKind.URI, null)) { return new EdmLiteral(type, literal.substring(prefixLength, literal.length() - suffixLength)); } else { throw new EdmLiteralException(EdmLiteralException.LITERALFORMAT.addContent(literal)); } }
private static EdmLiteral createEdmLiteral(final EdmSimpleTypeKind typeKind, final String literal, final int prefixLength, final int suffixLength) throws EdmLiteralException { final EdmSimpleType type = getEdmSimpleType(typeKind); if (type.validate(literal, EdmLiteralKind.URI, null)) { return new EdmLiteral(type, literal.substring(prefixLength, literal.length() - suffixLength)); } else { throw new EdmLiteralException(EdmLiteralException.LITERALFORMAT.addContent(literal)); } }
@Override public EdmLiteral parseUriLiteral(final String uriLiteral) throws EdmLiteralException { if (uriLiteral == null || "null".equals(uriLiteral)) { return new EdmLiteral(getEdmSimpleType(EdmSimpleTypeKind.Null), uriLiteral); return new EdmLiteral(getEdmSimpleType(EdmSimpleTypeKind.Boolean), uriLiteral); try { final EdmSimpleType type = getEdmSimpleType(EdmSimpleTypeKind.String); return new EdmLiteral(type, type.valueOfString(uriLiteral, EdmLiteralKind.URI, null, String.class)); } catch (EdmSimpleTypeException e) { throw new EdmLiteralException(EdmLiteralException.LITERALFORMAT.addContent(uriLiteral), e); .valueOfString(uriLiteral, EdmLiteralKind.URI, null, Integer.class); if (i == 0 || i == 1) { return new EdmLiteral(getInternalEdmSimpleTypeByString("Bit"), uriLiteral); return new EdmLiteral(getInternalEdmSimpleTypeByString("Uint7"), uriLiteral); return new EdmLiteral(getEdmSimpleType(EdmSimpleTypeKind.SByte), uriLiteral); } else if (i > Byte.MAX_VALUE && i <= 255) { return new EdmLiteral(getEdmSimpleType(EdmSimpleTypeKind.Byte), uriLiteral); } else if (i >= Short.MIN_VALUE && i <= Short.MAX_VALUE) { return new EdmLiteral(getEdmSimpleType(EdmSimpleTypeKind.Int16), uriLiteral); } else { return new EdmLiteral(getEdmSimpleType(EdmSimpleTypeKind.Int32), uriLiteral); return new EdmLiteral(getEdmSimpleType(EdmSimpleTypeKind.Single), uriLiteral); final EdmSimpleType type = getEdmSimpleType(EdmSimpleTypeKind.Binary);
@Override public EdmLiteral parseUriLiteral(final String uriLiteral) throws EdmLiteralException { if (uriLiteral == null || "null".equals(uriLiteral)) { return new EdmLiteral(getEdmSimpleType(EdmSimpleTypeKind.Null), uriLiteral); return new EdmLiteral(getEdmSimpleType(EdmSimpleTypeKind.Boolean), uriLiteral); try { final EdmSimpleType type = getEdmSimpleType(EdmSimpleTypeKind.String); return new EdmLiteral(type, type.valueOfString(uriLiteral, EdmLiteralKind.URI, facets, String.class)); } catch (EdmSimpleTypeException e) { throw new EdmLiteralException(EdmLiteralException.LITERALFORMAT.addContent(uriLiteral), e); .valueOfString(uriLiteral, EdmLiteralKind.URI, facets, Integer.class); if (i == 0 || i == 1) { return new EdmLiteral(getInternalEdmSimpleTypeByString("Bit"), uriLiteral); return new EdmLiteral(getInternalEdmSimpleTypeByString("Uint7"), uriLiteral); return new EdmLiteral(getEdmSimpleType(EdmSimpleTypeKind.SByte), uriLiteral); } else if (i > Byte.MAX_VALUE && i <= 255) { return new EdmLiteral(getEdmSimpleType(EdmSimpleTypeKind.Byte), uriLiteral); } else if (i >= Short.MIN_VALUE && i <= Short.MAX_VALUE) { return new EdmLiteral(getEdmSimpleType(EdmSimpleTypeKind.Int16), uriLiteral); } else { return new EdmLiteral(getEdmSimpleType(EdmSimpleTypeKind.Int32), uriLiteral); return new EdmLiteral(getEdmSimpleType(EdmSimpleTypeKind.Single), uriLiteral); final EdmSimpleType type = getEdmSimpleType(EdmSimpleTypeKind.Binary);
@Override public EdmLiteral parseUriLiteral(final String uriLiteral) throws EdmLiteralException { if (uriLiteral == null || "null".equals(uriLiteral)) { return new EdmLiteral(getEdmSimpleType(EdmSimpleTypeKind.Null), uriLiteral); return new EdmLiteral(getEdmSimpleType(EdmSimpleTypeKind.Boolean), uriLiteral); try { final EdmSimpleType type = getEdmSimpleType(EdmSimpleTypeKind.String); return new EdmLiteral(type, type.valueOfString(uriLiteral, EdmLiteralKind.URI, null, String.class)); } catch (EdmSimpleTypeException e) { throw new EdmLiteralException(EdmLiteralException.LITERALFORMAT.addContent(uriLiteral), e); .valueOfString(uriLiteral, EdmLiteralKind.URI, null, Integer.class); if (i == 0 || i == 1) { return new EdmLiteral(getInternalEdmSimpleTypeByString("Bit"), uriLiteral); return new EdmLiteral(getInternalEdmSimpleTypeByString("Uint7"), uriLiteral); return new EdmLiteral(getEdmSimpleType(EdmSimpleTypeKind.SByte), uriLiteral); } else if (i > Byte.MAX_VALUE && i <= 255) { return new EdmLiteral(getEdmSimpleType(EdmSimpleTypeKind.Byte), uriLiteral); } else if (i >= Short.MIN_VALUE && i <= Short.MAX_VALUE) { return new EdmLiteral(getEdmSimpleType(EdmSimpleTypeKind.Int16), uriLiteral); } else { return new EdmLiteral(getEdmSimpleType(EdmSimpleTypeKind.Int32), uriLiteral); return new EdmLiteral(getEdmSimpleType(EdmSimpleTypeKind.Single), uriLiteral); final EdmSimpleType type = getEdmSimpleType(EdmSimpleTypeKind.Binary);