Package com.cedarsoft.version

Examples of com.cedarsoft.version.VersionException


   * @throws IllegalArgumentException
   */
  @Nonnull
  public static Version parseVersionFromNamespace( @Nullable String namespaceURI ) throws IllegalArgumentException, VersionException {
    if ( namespaceURI == null || namespaceURI.isEmpty() ) {
      throw new VersionException( "No version information found" );
    }

    int index = namespaceURI.lastIndexOf( '/' );
    String versionString = namespaceURI.substring( index + 1 );
    return Version.parse( versionString );
View Full Code Here


   * @throws InvalidNamespaceException if the namespace is invalid
   * @throws VersionException          the if the version does not fit the expected range
   */
  public void verifyNamespace( @Nullable String namespace ) throws InvalidNamespaceException, VersionException {
    if ( namespace == null || namespace.trim().isEmpty() ) {
      throw new VersionException( "No version information available" );
    }
    String expectedBase = getNameSpaceBase();
    if ( !namespace.startsWith( expectedBase ) ) {
      throw new InvalidNamespaceException( namespace, expectedBase + "/" + getFormatVersion() );
    }
View Full Code Here

   * @throws IllegalArgumentException
   */
  @Nonnull
  public static Version parseVersionFromNamespace( @Nullable String namespaceURI ) throws IllegalArgumentException, VersionException {
    if ( namespaceURI == null || namespaceURI.length() == 0 ) {
      throw new VersionException( "No version information found" );
    }

    int index = namespaceURI.lastIndexOf( '/' );
    String versionString = namespaceURI.substring( index + 1 );
    return Version.parse( versionString );
View Full Code Here

   * @throws InvalidNamespaceException if the namespace is invalid
   * @throws VersionException          the if the version does not fit the expected range
   */
  public void verifyNamespace( @Nullable String namespace ) throws InvalidNamespaceException, VersionException {
    if ( namespace == null || namespace.trim().length() == 0 ) {
      throw new VersionException( "No version information available" );
    }
    String expectedBase = getNameSpaceBase();
    if ( !namespace.startsWith( expectedBase ) ) {
      throw new InvalidNamespaceException( namespace, expectedBase + "/$VERSION>" );
    }
View Full Code Here

  /**
   * Verifies the mapping
   */
  public void verify() throws VersionException {
    if ( entries.isEmpty() ) {
      throw new VersionException( "No mappings available" );
    }

    //Check whether the minimum equals the expected version range minimum
    {
      Version currentMin = entries.get( 0 ).getVersionRange().getMin();
View Full Code Here

   * @throws IllegalArgumentException
   */
  @Nonnull
  public static Version parseVersionFromNamespace( @Nullable String namespaceURI ) throws IllegalArgumentException, VersionException {
    if ( namespaceURI == null || namespaceURI.isEmpty() ) {
      throw new VersionException( "No version information found" );
    }

    int index = namespaceURI.lastIndexOf( '/' );
    String versionString = namespaceURI.substring( index + 1 );
    return Version.parse( versionString );
View Full Code Here

   * @throws InvalidNamespaceException if the namespace is invalid
   * @throws VersionException          the if the version does not fit the expected range
   */
  public void verifyNamespace( @Nullable String namespace ) throws InvalidNamespaceException, VersionException {
    if ( namespace == null || namespace.trim().isEmpty() ) {
      throw new VersionException( "No version information available" );
    }
    String expectedBase = getNameSpaceBase();
    if ( !namespace.startsWith( expectedBase ) ) {
      throw new InvalidNamespaceException( namespace, expectedBase + "/" + getFormatVersion() );
    }
View Full Code Here

  public boolean verify( @Nonnull ToString<T> toString ) throws VersionException {
    SortedSet<Version> mappedVersions = getMappedVersions();

    if ( mappings.isEmpty() ) {
      throw new VersionException( "No mappings available" );
    }

    for ( Map.Entry<T, VersionMapping> entry : mappings.entrySet() ) {
      VersionMapping mapping = entry.getValue();
View Full Code Here

  /**
   * Verifies the mapping
   */
  public void verify() throws VersionException {
    if ( entries.isEmpty() ) {
      throw new VersionException( "No mappings available" );
    }

    //Check whether the minimum equals the expected version range minimum
    {
      Version currentMin = entries.get( 0 ).getVersionRange().getMin();
View Full Code Here

   *
   */
  @Nonnull
  public static Version parseVersionFromNamespace( @Nullable String namespaceURI ) throws IllegalArgumentException, VersionException {
    if ( namespaceURI == null || namespaceURI.isEmpty() ) {
      throw new VersionException( "No version information found" );
    }

    int index = namespaceURI.lastIndexOf( '/' );
    String versionString = namespaceURI.substring( index + 1 );
    return Version.parse( versionString );
View Full Code Here

TOP

Related Classes of com.cedarsoft.version.VersionException

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.