@Override public void encode( StyledLayerDescriptor sld, Version version, boolean pretty, OutputStream output) throws IOException { if (version != null && VERSION_11.compareTo(version) == 0) { encode11(sld, pretty, output); } else { encode10(sld, pretty, output); } }
public int compare(Object o1, Object o2) { Service s1 = (Service) o1; Service s2 = (Service) o2; return s1.getVersion().compareTo(s2.getVersion()); } };
@Override public List<Exception> validate(Object input, Version version, EntityResolver entityResolver) throws IOException { if (version == null) { Object[] versionAndReader = getVersionAndReader(input); version = (Version) versionAndReader[0]; input = versionAndReader[1]; } if (version != null && VERSION_11.compareTo(version) == 0) { return validate11(input, entityResolver); } else { return validate10(input, entityResolver); } }
@Override public StyledLayerDescriptor parse( Object input, Version version, ResourceLocator resourceLocator, EntityResolver entityResolver) throws IOException { if (version == null) { Object[] versionAndReader = getVersionAndReader(input); version = (Version) versionAndReader[0]; input = versionAndReader[1]; } if (VERSION_11.compareTo(version) == 0) { return parse11(input, resourceLocator, entityResolver); } else { return parse10(input, resourceLocator, entityResolver); } }
int versionCompare = v1.compareTo(v2);
if (securityVersion.compareTo(VERSION_2_2) < 0) { migratedFrom21 = migrateFrom21(); if (securityVersion.compareTo(VERSION_2_3) < 0) { removeErroneousAccessDeniedPage(); migrateFrom22(migratedFrom21); if (securityVersion.compareTo(VERSION_2_4) < 0) { migrateFrom23(); if (securityVersion.compareTo(VERSION_2_5) < 0) { migrateFrom24(); if (securityVersion.compareTo(CURR_VERSION) < 0) { writeCurrentVersion();
/** * Returns "ST_Force2D" if PostGIS version is >= 2.1.0, otherwise "ST_Force_2D" * * @return Force2D function name */ protected String getForce2DFunction() { return version == null || version.compareTo(V_2_1_0) >= 0 ? "ST_Force2D" : "ST_Force_2D"; }
/** * Returns "ST_EstimatedExtent" if PostGIS version is >= 2.1.0, otherwise "ST_Estimated_Extent" * * @return EstimatedExtent function name */ protected String getEstimatedExtentFunction() { return version == null || version.compareTo(V_2_1_0) >= 0 ? "ST_EstimatedExtent" : "ST_Estimated_Extent"; } }
/** * Compares this version with an other version object. This method performs the same comparaison * than {@link #compareTo(Version, int)} with no limit. * * @param other The other version object to compare with. * @return A negative value if this version is lower than the supplied version, a positive value * if it is higher, or 0 if they are equal. */ public int compareTo(final Version other) { return compareTo(other, Integer.MAX_VALUE); }
/** * Compare this version string with the specified object for equality. Two version are * considered equal if <code>{@linkplain #compareTo(Object) compareTo}(other) == 0</code>. * * @param other The object to compare with this version for equality. */ @Override public boolean equals(final Object other) { if (other != null && getClass().equals(other.getClass())) { return compareTo((Version) other) == 0; } return false; }
/** Returns true if the PostGIS version is >= 1.5.0 */ boolean supportsGeography(Connection cx) throws SQLException { return getVersion(cx).compareTo(V_1_5_0) >= 0; }
String dimFunction = getVersion(cx).compareTo(V_2_0_0) >= 0 ? "ST_DIMENSION" : "DIMENSION";
@Override public void encodeValue(Object value, Class type, StringBuffer sql) { if (byte[].class.equals(type)) { byte[] input = (byte[]) value; // check postgres version, if > 9 default encoding is hex if (pgsqlVersion.compareTo(PGSQL_V_9_1) >= 0) { encodeByteArrayAsHex(input, sql); } else { encodeByteArrayAsEscape(input, sql); } return; } if (BigDate.class.isAssignableFrom(type)) { if (value instanceof Date) { super.encodeValue(((Date) value).getTime(), Long.class, sql); return; } } if (type.isArray() && value != null) { this.encodeArray(value, type, sql); return; } super.encodeValue(value, type, sql); }
if (srid == null || (getVersion(cx).compareTo(V_2_0_0) >= 0 && srid == 0)) { String sqlStatement = "SELECT ST_SRID(\""
String preserveCollapsed = version.compareTo(V_2_2_0) >= 0 ? ", true" : "";
if (getVersion(cx).compareTo(V_2_0_0) >= 0) {
/** * Compares this version with an other version object. This method performs the same * comparaison than {@link #compareTo(Version, int)} with no limit. * * @param other The other version object to compare with. * @return A negative value if this version is lower than the supplied version, a positive * value if it is higher, or 0 if they are equal. */ public int compareTo(final Object other) { return compareTo((Version) other, Integer.MAX_VALUE); }
/** * Compare this version string with the specified object for equality. Two version are * considered equal if <code>{@linkplain #compareTo(Object) compareTo}(other) == 0</code>. */ public boolean equals(final Object other) { if (other != null && getClass().equals(other.getClass())) { return compareTo(other) == 0; } return false; }
/** * Returns true if the PostGIS version is >= 1.5.0 */ boolean supportsGeography(Connection cx) throws SQLException { return getVersion(cx).compareTo(V_1_5_0) >= 0; }