org.deegree.commons.tom.ows.Version.getVersionsString()方法的使用及代码示例

x33g5p2x  于2022-02-01 转载在 其他  
字(15.4k)|赞(0)|评价(0)|浏览(93)

本文整理了Java中org.deegree.commons.tom.ows.Version.getVersionsString()方法的一些代码示例,展示了Version.getVersionsString()的具体用法。这些代码示例主要来源于Github/Stackoverflow/Maven等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Version.getVersionsString()方法的具体详情如下:
包路径:org.deegree.commons.tom.ows.Version
类名称:Version
方法名:getVersionsString

Version.getVersionsString介绍

[英]Returns a formatted string for presenting a series of versions to a human.
[中]返回一个格式化字符串,用于向用户呈现一系列版本。

代码示例

代码示例来源: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

/**
   * Parses a normalized KVP-map as a WFS {@link DescribeStoredQueries} request.
   * 
   * @param kvpParams
   *            normalized KVP-map; keys must be uppercase, each key only has one associated value
   * @return parsed {@link DescribeStoredQueries} request
   * @throws MissingParameterException
   *             if the request version is unsupported
   * @throws InvalidParameterValueException
   *             if a parameter contains a syntax error
   */
  public static DescribeStoredQueries parse( Map<String, String> kvpParams )
              throws MissingParameterException, InvalidParameterValueException {

    Version version = Version.parseVersion( KVPUtils.getRequired( kvpParams, "VERSION" ) );
    if ( !( VERSION_200.equals( version ) ) ) {
      String msg = Messages.get( "UNSUPPORTED_VERSION", version, Version.getVersionsString( VERSION_200 ) );
      throw new InvalidParameterValueException( msg );
    }

    String[] storedQueryIds = null;
    if ( kvpParams.get( "STOREDQUERY_ID" ) != null ) {
      storedQueryIds = StringUtils.split( kvpParams.get( "STOREDQUERY_ID" ), "," );
    }

    return new DescribeStoredQueries( version, null, storedQueryIds );
  }
}

代码示例来源:origin: deegree/deegree3

/**
 * Parses a WFS <code>GetGmlObject</code> document into a {@link GetGmlObject} request.
 * <p>
 * Supported versions:
 * <ul>
 * <li>WFS 1.1.0</li>
 * </ul>
 * 
 * @return parsed {@link GetGmlObject} request
 * @throws XMLParsingException
 *             if a syntax error occurs in the XML
 * @throws MissingParameterException
 *             if the request version is unsupported
 * @throws InvalidParameterValueException
 *             if a parameter contains a syntax error
 */
public GetGmlObject parse() {
  Version version = determineVersion110Safe();
  GetGmlObject result = null;
  if ( VERSION_110.equals( version ) ) {
    result = parse110();
  } else {
    String msg = Messages.get( "UNSUPPORTED_VERSION", version, Version.getVersionsString( VERSION_110 ) );
    throw new InvalidParameterValueException( msg );
  }
  return result;
}

代码示例来源:origin: deegree/deegree3

/**
 * Parses the {@link GetRecords} kvp request and decides which version has to parse because of the requested version
 * 
 * @param normalizedKVPParams
 *            that are requested as key to a value.
 * @return {@link GetRecords}
 */
public static GetRecords parse( Map<String, String> normalizedKVPParams, String defaultOutputFormat,
                String defaultOutputSchema ) {
  Version version = Version.parseVersion( KVPUtils.getRequired( normalizedKVPParams, "VERSION" ) );
  GetRecords result = null;
  if ( VERSION_202.equals( version ) ) {
    result = parse202( VERSION_202, normalizedKVPParams, defaultOutputFormat, defaultOutputSchema );
  } else {
    String msg = Messages.get( "UNSUPPORTED_VERSION", version, Version.getVersionsString( VERSION_202 ) );
    throw new InvalidParameterValueException( msg );
  }
  return result;
}

代码示例来源:origin: deegree/deegree3

/**
   * Parses a normalized KVP-map as a WFS {@link ListStoredQueries} request.
   * 
   * @param kvpParams
   *            normalized KVP-map; keys must be uppercase, each key only has one associated value
   * @return parsed {@link ListStoredQueries} request
   * @throws MissingParameterException
   *             if the request version is unsupported
   * @throws InvalidParameterValueException
   *             if a parameter contains a syntax error
   */
  public static ListStoredQueries parse( Map<String, String> kvpParams )
              throws MissingParameterException, InvalidParameterValueException {

    Version version = Version.parseVersion( KVPUtils.getRequired( kvpParams, "VERSION" ) );
    if ( !( VERSION_200.equals( version ) ) ) {
      String msg = Messages.get( "UNSUPPORTED_VERSION", version, Version.getVersionsString( VERSION_200 ) );
      throw new InvalidParameterValueException( msg );
    }
    return new ListStoredQueries( version, null );
  }
}

代码示例来源:origin: deegree/deegree3

/**
 * Parses the {@link GetRecordById} kvp request and decides which version has to parse because of the requested
 * version
 * 
 * @param normalizedKVPParams
 *            that are requested containing all mandatory and optional parts regarding CSW spec
 * @return {@link GetRecordById}
 * @throws MetadataStoreException
 */
public static GetRecordById parse( Map<String, String> normalizedKVPParams, String defaultOutputFormat,
                  String defaultOuputSchema ) {
  Version version = Version.parseVersion( KVPUtils.getRequired( normalizedKVPParams, "VERSION" ) );
  GetRecordById result = null;
  if ( VERSION_202.equals( version ) ) {
    result = parse202( VERSION_202, normalizedKVPParams, defaultOutputFormat, defaultOuputSchema );
  } else {
    String msg = Messages.get( "UNSUPPORTED_VERSION", version, Version.getVersionsString( VERSION_202 ) );
    throw new InvalidParameterValueException( msg );
  }
  return result;
}

代码示例来源: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

/**
   * Parses a normalized KVP-map as a WFS {@link DropStoredQuery} request.
   * 
   * @param kvpParams
   *            normalized KVP-map; keys must be uppercase, each key only has one associated value
   * @return parsed {@link DropStoredQuery} request
   * @throws MissingParameterException
   *             if the request version is unsupported
   * @throws InvalidParameterValueException
   *             if a parameter contains a syntax error
   */
  public static DropStoredQuery parse( Map<String, String> kvpParams )
              throws MissingParameterException, InvalidParameterValueException {

    Version version = Version.parseVersion( KVPUtils.getRequired( kvpParams, "VERSION" ) );
    if ( !( VERSION_200.equals( version ) ) ) {
      String msg = Messages.get( "UNSUPPORTED_VERSION", version, Version.getVersionsString( VERSION_200 ) );
      throw new InvalidParameterValueException( msg );
    }

    String id = KVPUtils.getRequired( kvpParams, "STOREDQUERY_ID" );
    return new DropStoredQuery( version, null, id );
  }
}

代码示例来源:origin: deegree/deegree3

/**
 * Parses the {@link DescribeRecord} XML request.
 * 
 * @param version
 * @return {@link DescribeRecord}
 */
public DescribeRecord parse( Version version ) {
  if ( version == null ) {
    version = Version.parseVersion( getRequiredNodeAsString( rootElement, new XPath( "@version", nsContext ) ) );
  }
  DescribeRecord result = null;
  if ( VERSION_202.equals( version ) ) {
    result = parse202();
  } else {
    String msg = Messages.get( "UNSUPPORTED_VERSION", version, Version.getVersionsString( VERSION_202 ) );
    throw new InvalidParameterValueException( msg );
  }
  return result;
}

代码示例来源:origin: deegree/deegree3

/**
 * Parses a normalized KVP-map as a WFS {@link GetGmlObject} request.
 * <p>
 * Supported versions:
 * <ul>
 * <li>WFS 1.1.0</li>
 * </ul>
 * 
 * @param kvpParams
 *            normalized KVP-map; keys must be uppercase, each key only has one associated value
 * @return parsed {@link GetGmlObject} request
 * @throws MissingParameterException
 *             if the request version is unsupported
 * @throws InvalidParameterValueException
 *             if a parameter contains a syntax error
 */
public static GetGmlObject parse( Map<String, String> kvpParams )
            throws MissingParameterException, InvalidParameterValueException {
  Version version = Version.parseVersion( KVPUtils.getRequired( kvpParams, "VERSION" ) );
  GetGmlObject result = null;
  if ( VERSION_110.equals( version ) ) {
    result = parse110( kvpParams );
  } else {
    String msg = Messages.get( "UNSUPPORTED_VERSION", version, Version.getVersionsString( VERSION_110 ) );
    throw new InvalidParameterValueException( msg );
  }
  return result;
}

代码示例来源:origin: deegree/deegree3

/**
 * Parses the {@link Transaction} XML request by deciding which version has to be parsed because of the requested
 * version.
 * 
 * @param version
 * @return {@link Transaction}
 */
public Transaction parse( Version version ) {
  if ( version == null ) {
    version = Version.parseVersion( getRequiredNodeAsString( rootElement, new XPath( "@version", nsContext ) ) );
  }
  Transaction result = null;
  if ( VERSION_202.equals( version ) ) {
    result = parse202();
  } else {
    String msg = Messages.get( "UNSUPPORTED_VERSION", version, Version.getVersionsString( VERSION_202 ) );
    throw new InvalidParameterValueException( msg );
  }
  return result;
}

代码示例来源:origin: deegree/deegree3

/**
 * Parses the {@link GetRecords} XML request by deciding which version has to be parsed because of the requested
 * version.
 * 
 * @param version
 * @return {@Link GetRecords}
 */
public GetRecords parse( Version version, String defaultOutputFormat, String defaultOutputSchema ) {
  if ( version == null ) {
    version = Version.parseVersion( getRequiredNodeAsString( rootElement, new XPath( "@version", nsContext ) ) );
  }
  GetRecords result = null;
  if ( VERSION_202.equals( version ) ) {
    result = parse202( defaultOutputFormat, defaultOutputSchema );
  } else {
    String msg = Messages.get( "UNSUPPORTED_VERSION", version, Version.getVersionsString( VERSION_202 ) );
    throw new InvalidParameterValueException( msg );
  }
  return result;
}

代码示例来源:origin: deegree/deegree3

/**
 * Parses the {@link GetRecordById} XML request by deciding which version has to be parsed because of the requested
 * version.
 * 
 * @param requestVersion
 * @return {@link GetRecordById}
 */
public GetRecordById parse( Version requestVersion, String defaultOutputFormat, String defaultOutputSchema ) {
  if ( requestVersion == null ) {
    requestVersion = Version.parseVersion( getRequiredNodeAsString( rootElement, new XPath( "@version",
                                                nsContext ) ) );
  }
  GetRecordById result = null;
  if ( VERSION_202.equals( requestVersion ) ) {
    result = parse202( defaultOutputFormat, defaultOutputSchema );
  } else {
    String msg = Messages.get( "UNSUPPORTED_VERSION", requestVersion, Version.getVersionsString( VERSION_202 ) );
    throw new InvalidParameterValueException( msg );
  }
  return result;
}

代码示例来源:origin: deegree/deegree3

String msg = Messages.get( "UNSUPPORTED_VERSION", version, Version.getVersionsString( VERSION_200 ) );
throw new InvalidParameterValueException( msg );

代码示例来源:origin: deegree/deegree3

/**
   * Parses a WFS <code>ListStoredQueries</code> document into a {@link ListStoredQueries} request.
   * 
   * @return parsed {@link ListStoredQueries} request, never <code>null</code>
   * @throws InvalidParameterValueException
   *             if a parameter contains a syntax error
   */
  public ListStoredQueries parse()
              throws InvalidParameterValueException {

    // <xsd:attribute name="version" type="xsd:string" use="required" fixed="2.0.0"/>
    Version version = Version.parseVersion( getRequiredNodeAsString( rootElement, new XPath( "@version", nsContext ) ) );
    if ( !( VERSION_200.equals( version ) ) ) {
      String msg = Messages.get( "UNSUPPORTED_VERSION", version, Version.getVersionsString( VERSION_200 ) );
      throw new InvalidParameterValueException( msg );
    }

    // <xsd:attribute name="handle" type="xsd:string"/>
    String handle = getNodeAsString( rootElement, new XPath( "@handle", nsContext ), null );

    return new ListStoredQueries( version, handle );
  }
}

代码示例来源:origin: deegree/deegree3

/**
 * Parses a normalized KVP-map as a WFS {@link GetFeatureWithLock} request.
 * 
 * @param kvpParams
 *            normalized KVP-map; keys must be uppercase, each key only has one associated value
 * @return parsed {@link GetFeatureWithLock} request
 * @throws Exception
 */
public static GetFeatureWithLock parse( Map<String, String> kvpParams )
            throws Exception {
  Version version = Version.parseVersion( KVPUtils.getRequired( kvpParams, "VERSION" ) );
  GetFeatureWithLock result = null;
  if ( VERSION_100.equals( version ) ) {
    result = parse100( kvpParams );
  } else if ( VERSION_110.equals( version ) ) {
    result = parse110( kvpParams );
  } else if ( VERSION_200.equals( version ) ) {
    result = parse200( kvpParams );
  } else {
    String msg = Messages.get( "UNSUPPORTED_VERSION", version, Version.getVersionsString( VERSION_110 ) );
    throw new InvalidParameterValueException( msg );
  }
  return result;
}

代码示例来源:origin: deegree/deegree3

/**
 * Parses a normalized KVP-map as a WFS {@link GetFeature} request.
 * 
 * @param kvpParams
 *            normalized KVP-map; keys must be uppercase, each key only has one associated value
 * @param nsMap
 *            only for 1.0.0 version; the prefix-namespace map given in the NamespaceHints in the configuration
 * @return parsed {@link GetFeature} request
 * @throws Exception
 */
public static GetFeature parse( Map<String, String> kvpParams, Map<String, String> nsMap )
            throws Exception {
  Version version = Version.parseVersion( KVPUtils.getRequired( kvpParams, "VERSION" ) );
  GetFeature result = null;
  if ( VERSION_100.equals( version ) ) {
    result = parse100( kvpParams, nsMap );
  } else if ( VERSION_110.equals( version ) ) {
    result = parse110( kvpParams );
  } else if ( VERSION_200.equals( version ) ) {
    result = parse200( kvpParams );
  } else {
    String msg = Messages.get( "UNSUPPORTED_VERSION", version,
                  Version.getVersionsString( VERSION_100, VERSION_110, VERSION_200 ) );
    throw new InvalidParameterValueException( msg );
  }
  return result;
}

代码示例来源:origin: deegree/deegree3

/**
   * Parses a WFS <code>DescribeStoredQueries</code> document into a {@link DescribeStoredQueries} request.
   * 
   * @return parsed {@link DescribeStoredQueries} request, never <code>null</code>
   * @throws InvalidParameterValueException
   *             if a parameter contains a syntax error
   */
  public DescribeStoredQueries parse()
              throws InvalidParameterValueException {

    // <xsd:attribute name="version" type="xsd:string" use="required" fixed="2.0.0"/>
    Version version = Version.parseVersion( getRequiredNodeAsString( rootElement, new XPath( "@version", nsContext ) ) );
    if ( !( VERSION_200.equals( version ) ) ) {
      String msg = Messages.get( "UNSUPPORTED_VERSION", version, Version.getVersionsString( VERSION_200 ) );
      throw new InvalidParameterValueException( msg );
    }

    // <xsd:attribute name="handle" type="xsd:string"/>
    String handle = getNodeAsString( rootElement, new XPath( "@handle", nsContext ), null );

    // <xsd:element name="StoredQueryId" type="xsd:anyURI" minOccurs="0" maxOccurs="unbounded"/>
    String[] storedQueryIds = getNodesAsStrings( rootElement, new XPath( "wfs200:StoredQueryId", nsContext ) );

    return new DescribeStoredQueries( version, handle, storedQueryIds );
  }
}

代码示例来源:origin: deegree/deegree3

/**
   * Parses a WFS <code>DropStoredQuery</code> document into a {@link DropStoredQuery} request.
   * 
   * @return parsed {@link DropStoredQuery} request, never <code>null</code>
   * @throws InvalidParameterValueException
   *             if a parameter contains a syntax error
   */
  public DropStoredQuery parse()
              throws InvalidParameterValueException {

    // <xsd:attribute name="version" type="xsd:string" use="required" fixed="2.0.0"/>
    Version version = Version.parseVersion( getRequiredNodeAsString( rootElement, new XPath( "@version", nsContext ) ) );
    if ( !( VERSION_200.equals( version ) ) ) {
      String msg = Messages.get( "UNSUPPORTED_VERSION", version, Version.getVersionsString( VERSION_200 ) );
      throw new InvalidParameterValueException( msg );
    }

    // <xsd:attribute name="handle" type="xsd:string"/>
    String handle = getNodeAsString( rootElement, new XPath( "@handle", nsContext ), null );

    // xsd:attribute name="id" type="xsd:anyURI" use="required"/>
    String id = getNodeAsString( rootElement, new XPath( "@id", nsContext ), null );

    return new DropStoredQuery( version, handle, id );
  }
}

代码示例来源:origin: deegree/deegree3

} else {
  String msg = Messages.get( "UNSUPPORTED_VERSION", version,
                getVersionsString( VERSION_100, VERSION_110, VERSION_200 ) );
  throw new InvalidParameterValueException( msg );

相关文章