本文整理了Java中org.deegree.commons.tom.ows.Version
类的一些代码示例,展示了Version
类的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Version
类的具体详情如下:
包路径:org.deegree.commons.tom.ows.Version
类名称:Version
[英]Version of an OWS operation or specification. Comparability of Version
objects simplifies tasks like version negotiation.
Description from owsCommon.xsd
, version 1.1.0: The string value shall contain one x.y.z "version" value (e.g., "2.1.3"). A version number shall contain three non-negative integers separated by decimal points, in the form "x.y.z". The integers y and z shall not exceed 99.
Each version shall be for the Implementation Specification (document) and the associated XML Schemas to which requested operations will conform. An Implementation Specification version normally specifies XML Schemas against which an XML encoded operation response must conform and should be validated.
[中]OWS操作或规范的版本。Version
对象的可比性简化了版本协商等任务。owsCommon.xsd
版本1.1.0中的说明:字符串值应包含一个x.y.z“版本”值(例如,“2.1.3”)。版本号应包含三个由小数点分隔的非负整数,格式为“x.y.z”。整数y和z不得超过99。
每个版本应适用于实施规范(文件)和相关的XML模式,请求的操作将符合这些模式。实现规范版本通常指定XML模式,XML编码的操作响应必须符合这些模式,并且应该进行验证。
代码示例来源:origin: deegree/deegree3
public static GetRepositoryItem parse( Map<String, String> normalizedKVPParams ) {
Version version = Version.parseVersion( KVPUtils.getRequired( normalizedKVPParams, "VERSION" ) );
if ( VERSION_202.equals( version ) || VERSION_100.equals( version ) ) {
return new GetRepositoryItem( KVPUtils.getRequired( normalizedKVPParams, "ID" ) );
} else {
String msg = Messages.get( "UNSUPPORTED_VERSION", version, Version.getVersionsString( VERSION_202 )
+ Version.getVersionsString( VERSION_100 ) );
throw new InvalidParameterValueException( msg );
}
}
代码示例来源:origin: deegree/deegree3
@Override
protected Version getServiceVersion() {
return new Version( 1, 3, 0 );
}
代码示例来源:origin: deegree/deegree3
private static Version parseVersion( Map<String, String> kvp )
throws OWSException {
String version = KVPUtils.getRequired( kvp, "VERSION" );
if ( !Version.parseVersion( version ).equals( VERSION_100 ) ) {
throw new OWSException( "Version must be: " + VERSION_100.toString(), OWSException.INVALID_PARAMETER_VALUE );
}
return VERSION_100;
}
}
代码示例来源:origin: deegree/deegree3
public TransactionXmlReader createReader( Version version ) {
if ( VERSION_100.equals( version ) ) {
return new TransactionXmlReader100();
} else if ( VERSION_110.equals( version ) ) {
return new TransactionXmlReader110();
} else if ( VERSION_200.equals( version ) ) {
return new TransactionXmlReader200();
}
String msg = Messages.get( "UNSUPPORTED_VERSION", version,
Version.getVersionsString( VERSION_100, VERSION_110, VERSION_200 ) );
throw new InvalidParameterValueException( msg );
}
代码示例来源:origin: deegree/deegree3
/**
* Returns the old-style version information (used by pre-OWS GetCapabilities requests, see section D.11 of OGC
* 06-121r3).
*
* @return old-style version information, may be <code>null</code> (if this is an OWS-style request or an pre-OWS
* request without version specification)
* @throws InvalidParameterValueException
* if any of the versions is not syntactically correct
*/
public Version getVersionAsVersion()
throws InvalidParameterValueException {
return Version.parseVersion( version );
}
代码示例来源:origin: deegree/deegree3
/**
* Constructs a new <code>GetCapabilities</code> request that specifies the requested version in a pre-OWS fashion
* (see section D.11 of OGC 06-121r3).
*
* @param version
* old-style version information, may be <code>null</code>
*/
public GetCapabilities( Version version ) {
if ( version != null ) {
this.version = version.toString();
}
}
代码示例来源:origin: deegree/deegree3
Version versionConstraint = Version.parseVersion( constraintStringVersion );
if ( versionConstraint.equals( new Version( 1, 1, 0 ) ) ) {
} else if ( versionConstraint.equals( new Version( 1, 0, 0 ) ) ) {
constraint = Filter100XMLDecoder.parse( xmlStream );
} else {
String msg = Messages.get( "CSW_FILTER_VERSION_NOT_SPECIFIED", versionConstraint,
Version.getVersionsString( new Version( 1, 1, 0 ) ),
Version.getVersionsString( new Version( 1, 0, 0 ) ) );
LOG.info( msg );
throw new InvalidParameterValueException( msg );
代码示例来源:origin: deegree/deegree3
if ( versionConstraintUpdate.equals( new Version( 1, 1, 0 ) ) ) {
constraintUpdate = Filter110XMLDecoder.parse( xmlStream );
} else if ( versionConstraintUpdate.equals( new Version( 1, 0, 0 ) ) ) {
constraintUpdate = Filter100XMLDecoder.parse( xmlStream );
} else {
String msg = Messages.get( "CSW_FILTER_VERSION_NOT_SPECIFIED", versionConstraintUpdate,
Version.getVersionsString( new Version( 1, 1, 0 ) ),
Version.getVersionsString( new Version( 1, 0, 0 ) ) );
LOG.info( msg );
throw new InvalidParameterValueException( msg );
代码示例来源:origin: deegree/deegree3
Version v = null;
try {
v = Version.parseVersion( version );
} catch ( InvalidParameterValueException n ) {
if ( v.compareTo( new Version( 2, 1, 2 ) ) <= 0 ) {
result = GML_2;
} else if ( v.compareTo( new Version( 3, 0, 1 ) ) <= 0 ) {
result = GML_30;
} else if ( v.compareTo( new Version( 3, 1, 1 ) ) <= 0 ) {
result = GML_31;
} else if ( v.compareTo( new Version( 3, 2, 1 ) ) <= 0 ) {
result = GML_32;
代码示例来源:origin: deegree/deegree3
if ( version.compareTo( new Version( 1, 1, 0 ) ) != 0 ) {
throw new IllegalArgumentException(
"Only WFS-GetGmlObject 1.1.0 serialization is supported by this encoder" );
writer.writeAttribute( "version", version.toString() );
代码示例来源:origin: deegree/deegree3
@Override
public Version checkVersion( Version version ) {
if ( VERSION_100.equals( version ) )
return VERSION_202;
return version;
}
代码示例来源:origin: deegree/deegree3
appendKVP( sb, "VERSION", version.toString() );
appendKVP( sb, "REQUEST", "DescribeFeatureType" );
if ( request.getOutputFormat() != null ) {
if ( !version.equals( VERSION_100 ) && nsBindings.size() > 0 ) {
StringBuffer namespaceList = new StringBuffer();
for ( String namespace : nsBindings.keySet() ) {
代码示例来源:origin: deegree/deegree3
protected WMSCapabilitiesAdapter getCapabilitiesAdapter( OMElement root, String version )
throws IOException {
if ( version != null ) {
wmsVersion = Version.parseVersion( version );
} else {
LOG.warn( "No version attribute in WMS capabilities document. Defaulting to 1.1.1." );
wmsVersion = VERSION_111;
}
if ( VERSION_111.equals( wmsVersion ) ) {
return new WMS111CapabilitiesAdapter( root );
} else if ( VERSION_130.equals( wmsVersion ) ) {
return new WMS130CapabilitiesAdapter( root );
}
throw new IllegalArgumentException( get( "WMSCLIENT.WRONG_VERSION_CAPABILITIES",
getIdentification().getServiceTypeVersion(), VERSION_111 + ", "
+ VERSION_130 ) );
}
代码示例来源:origin: deegree/deegree3
Version acceptableVersion = null;
try {
acceptableVersion = Version.parseVersion( acceptableVersionString );
} catch ( InvalidParameterValueException e ) {
throw new OWSException( "Version negotiation failed. Specified accept version: '"
String versionsString = Version.getVersionsString( request.getAcceptVersionsAsVersions().toArray( new Version[request.getAcceptVersions().size()] ) );
throw new OWSException( "Version negotiation failed. No support for version(s): " + versionsString,
OWSException.VERSION_NEGOTIATION_FAILED );
} else {
Version lowestOfferedVersion = offeredVersions.first();
if ( requestedVersion.compareTo( lowestOfferedVersion ) < 0 ) {
if ( offeredVersion.compareTo( requestedVersion ) > 0 ) {
break;
代码示例来源:origin: deegree/deegree3
Version version = new Version( 2, 0, 2 );
writer.writeStartElement( CSW_202_NS, "TransactionResponse" );
writer.writeDefaultNamespace( CSW_202_NS );
writer.writeAttribute( "version", version.toString() );
代码示例来源:origin: deegree/deegree3
private WFSVersion( String ogcVersion, String ns ) {
this.ogcVersion = Version.parseVersion( ogcVersion );
this.ns = ns;
}
代码示例来源:origin: deegree/deegree3
/**
* Returns the offered protocol versions.
*
* @return the offered protocol versions
*/
public List<String> getOfferedVersions() {
List<String> versions = new ArrayList<String>( offeredVersions.size() );
for ( Version version : offeredVersions ) {
versions.add( version.toString() );
}
return versions;
}
代码示例来源:origin: deegree/deegree3
if ( versionConstraint.equals( new Version( 1, 1, 0 ) ) ) {
} else if ( versionConstraint.equals( new Version( 1, 0, 0 ) ) ) {
constraint = Filter100XMLDecoder.parse( xmlStream );
} else {
String msg = Messages.get( "CSW_FILTER_VERSION_NOT_SPECIFIED", versionConstraint,
Version.getVersionsString( new Version( 1, 1, 0 ) ),
Version.getVersionsString( new Version( 1, 0, 0 ) ) );
LOG.info( msg );
throw new InvalidParameterValueException( msg );
代码示例来源:origin: deegree/deegree3
if ( version.compareTo( new Version( 1, 1, 0 ) ) != 0 ) {
throw new IllegalArgumentException(
"Only WFS-GetFeature 1.1.0 serialization is supported by this encoder" );
writer.writeAttribute( "version", version.toString() );
代码示例来源:origin: deegree/deegree3
@Override
public String getGetRecordByIdSchemaLocation( Version version ) {
if ( VERSION_202.equals( version ) ) {
return CSW_202_NS + " " + CSW_202_DISCOVERY_SCHEMA;
}
return null;
}
内容来源于网络,如有侵权,请联系作者删除!