private Matcher getMatcher(final Pattern pattern, final String value) throws EdmPrimitiveTypeException { final Matcher matcher = pattern.matcher(value); if (!matcher.matches()) { throw new EdmPrimitiveTypeException("The literal '" + value + "' has illegal content."); } Geospatial.Dimension _dimension = null; Geospatial.Type _type = null; try { _dimension = Geospatial.Dimension.valueOf(matcher.group(1).toUpperCase()); _type = Geospatial.Type.valueOf(matcher.group(3).toUpperCase()); } catch (IllegalArgumentException e) { throw new EdmPrimitiveTypeException("The literal '" + value + "' has illegal content.", e); } if (_dimension != this.dimension || (!pattern.equals(COLLECTION_PATTERN) && _type != this.type)) { throw new EdmPrimitiveTypeException("The literal '" + value + "' has illegal content."); } return matcher; }
switch (Geospatial.Type.valueOf(matcher.group(3).toUpperCase())) { case POINT: item = newPoint(SRID.valueOf(matcher.group(2)), matcher.group(4),
switch (Geospatial.Type.valueOf(matcher.group(3).toUpperCase())) { case POINT: item = newPoint(SRID.valueOf(matcher.group(2)), matcher.group(4),
private Matcher getMatcher(final Pattern pattern, final String value) throws EdmPrimitiveTypeException { final Matcher matcher = pattern.matcher(value); if (!matcher.matches()) { throw new EdmPrimitiveTypeException("The literal '" + value + "' has illegal content."); } Geospatial.Dimension _dimension = null; Geospatial.Type _type = null; try { _dimension = Geospatial.Dimension.valueOf(matcher.group(1).toUpperCase()); _type = Geospatial.Type.valueOf(matcher.group(3).toUpperCase()); } catch (IllegalArgumentException e) { throw new EdmPrimitiveTypeException("The literal '" + value + "' has illegal content.", e); } if (_dimension != this.dimension || (!pattern.equals(COLLECTION_PATTERN) && _type != this.type)) { throw new EdmPrimitiveTypeException("The literal '" + value + "' has illegal content."); } return matcher; }