Package com.cedarsoft

Examples of com.cedarsoft.VersionException


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

    String[] parts = namespaceURI.split( "/" );
    String last = parts[parts.length - 1];

View Full Code Here


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

    String[] parts = namespaceURI.split( "/" );
    String last = parts[parts.length - 1];

View Full Code Here

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

    String[] parts = namespaceURI.split( "/" );
    String last = parts[parts.length - 1];

View Full Code Here

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

      }

      //Now get the namespace and verify the version
      String namespaceURI = reader.getNamespaceURI();
      if ( namespaceURI == null ) {
        throw new VersionException( "Version information is missing for <" + reader.getName().getLocalPart() + ">" );
      }

      //Parse and verify the version
      Version version = parseVersionFromNamespaceUri( namespaceURI );
      if ( !getFormatVersionRange().contains( version ) ) {
View Full Code Here

      }

      //Now get the namespace and verify the version
      String namespaceURI = reader.getNamespaceURI();
      if ( namespaceURI == null ) {
        throw new VersionException( "Version information is missing for <" + reader.getName().getLocalPart() + ">" );
      }

      //Parse and verify the version
      Version version = parseVersionFromNamespaceUri( namespaceURI );
      if ( !getFormatVersionRange().contains( 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
   */
  @NotNull
  public static Version parseVersionFromNamespace( @Nullable @NonNls 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 @NonNls 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

  public boolean verify( @NotNull 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

TOP

Related Classes of com.cedarsoft.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.