Tabnine Logo
IllegalNameException
Code IndexAdd Tabnine to your IDE (free)

How to use
IllegalNameException
in
org.apache.sis.storage

Best Java code snippets using org.apache.sis.storage.IllegalNameException (Showing top 15 results out of 315)

origin: org.apache.sis.storage/sis-storage

/**
 * Returns the value associated to the given name.
 *
 * @param  store  the data store for which to get a value, or {@code null} if unknown.
 * @param  name   the name for which to get a value.
 * @return value associated to the given object.
 * @throws IllegalNameException if the given name was not found or is ambiguous.
 */
public E get(final DataStore store, final String name) throws IllegalNameException {
  final E value = values.get(name);
  if (value != null) {
    return value;
  }
  final short key;
  final Object[] params;
  final List<String> nc = aliases.get(name);
  if (nc == null) {
    key = Resources.Keys.FeatureNotFound_2;
    params = new CharSequence[] {name(store), name};
  } else if (nc.size() >= 2) {
    key = Resources.Keys.AmbiguousName_4;
    params = new CharSequence[] {name(store), nc.get(0), nc.get(1), name};
  } else {
    return null;    // Name was explicitely associated to null value (actually not allowed by current API).
  }
  throw new IllegalNameException(locale(store), key, params);
}
origin: apache/sis

} catch (IllegalNameException e) {
  final String message = e.getMessage();
  assertTrue(message, message.contains("C"));
  assertTrue(message, message.contains("testDataStore"));
} catch (IllegalNameException e) {
  final String message = e.getMessage();
  assertTrue(message, message.contains("B"));
origin: apache/sis

} catch (IllegalNameException e) {
  final String message = e.getMessage();
  assertTrue(message, message.contains("myNS:A"));
  assertTrue(message, message.contains("other:A"));
origin: apache/sis

/**
 * Returns the value associated to the given name.
 *
 * @param  store  the data store for which to get a value, or {@code null} if unknown.
 * @param  name   the name for which to get a value.
 * @return value associated to the given object.
 * @throws IllegalNameException if the given name was not found or is ambiguous.
 */
public E get(final DataStore store, final String name) throws IllegalNameException {
  final E value = values.get(name);
  if (value != null) {
    return value;
  }
  final short key;
  final Object[] params;
  final List<String> nc = aliases.get(name);
  if (nc == null) {
    key = Resources.Keys.FeatureNotFound_2;
    params = new CharSequence[] {name(store), name};
  } else if (nc.size() >= 2) {
    key = Resources.Keys.AmbiguousName_4;
    params = new CharSequence[] {name(store), nc.get(0), nc.get(1), name};
  } else {
    return null;    // Name was explicitly associated to null value (actually not allowed by current API).
  }
  throw new IllegalNameException(locale(store), key, params);
}
origin: apache/sis

} catch (IllegalNameException e) {
  final String message = e.getMessage();
  assertTrue(message, message.contains("myNS:A"));
  assertTrue(message, message.contains("testDataStore"));
origin: apache/sis

/**
 * Searches for a resource identified by the given identifier. The given identifier should be the string
 * representation of the return value of {@link Resource#getIdentifier()} on the desired resource.
 * Implementation may also accept aliases for convenience. For example if the full name of a resource
 * is {@code "foo:bar"}, then this method may accept {@code "bar"} as a synonymous of {@code "foo:bar"}
 * provided that it does not introduce ambiguity.
 *
 * <p>The default implementation verifies if above criterion matches to this {@code DataStore}
 * (which is itself a resource), then iterates recursively over {@link Aggregate} components
 * if this data store is an aggregate.
 * If a match is found without ambiguity, the associated resource is returned. Otherwise an exception is thrown.
 * Subclasses are encouraged to override this method with a more efficient implementation.</p>
 *
 * @param  identifier  identifier of the resource to fetch. Must be non-null.
 * @return resource associated to the given identifier (never {@code null}).
 * @throws IllegalNameException if no resource is found for the given identifier, or if more than one resource is found.
 * @throws DataStoreException if another kind of error occurred while searching resources.
 *
 * @see Resource#getIdentifier()
 * @see FeatureNaming
 */
public Resource findResource(final String identifier) throws DataStoreException {
  ArgumentChecks.ensureNonEmpty("identifier", identifier);
  final Resource resource = findResource(identifier, this, new IdentityHashMap<>());
  if (resource != null) {
    return resource;
  }
  throw new IllegalNameException(StoreUtilities.resourceNotFound(this, identifier));
}
origin: org.apache.sis.storage/sis-storage

throw new IllegalNameException(locale(store), Resources.Keys.InconsistentNameComponents_2, name(store), key);
origin: apache/sis

throw new IllegalNameException(locale(store), Resources.Keys.InconsistentNameComponents_2, name(store), key);
origin: apache/sis

/**
 * Returns the image at the given index. Images numbering starts at 1.
 *
 * @param  sequence  string representation of the image index, starting at 1.
 * @return image at the given index.
 * @throws DataStoreException if the requested image can not be obtained.
 */
@Override
public GridCoverageResource findResource(final String sequence) throws DataStoreException {
  Exception cause;
  int index;
  try {
    index = Integer.parseInt(sequence);
    cause = null;
  } catch (NumberFormatException e) {
    index = 0;
    cause = e;
  }
  if (index > 0) try {
    ImageFileDirectory image = reader().getImageFileDirectory(index - 1);
    if (image != null) return image;
  } catch (IOException e) {
    throw errorIO(e);
  }
  throw new IllegalNameException(StoreUtilities.resourceNotFound(this, sequence), cause);
}
origin: apache/sis

  throw new ConcurrentModificationException(name(store).toString());              // Paranoiac check.
throw new IllegalNameException(locale(store), Resources.Keys.FeatureAlreadyPresent_2, name(store), key);
origin: org.apache.sis.storage/sis-storage

  throw new ConcurrentModificationException(name(store).toString());              // Paranoiac check.
throw new IllegalNameException(locale(store), Resources.Keys.FeatureAlreadyPresent_2, name(store), key);
origin: org.apache.sis.storage/sis-storage

  return resource;
throw new IllegalNameException(Resources.forLocale(getLocale())
    .getString(Resources.Keys.ResourceNotFound_2, getDisplayName(), identifier));
origin: apache/sis

  result = match;
} else {
  throw new IllegalNameException(Resources.forLocale(getLocale())
      .getString(Resources.Keys.ResourceIdentifierCollision_2, getDisplayName(), identifier));
origin: apache/sis

final int depth = name.depth();
if (depth < 1 || depth > 3) {
  throw new IllegalNameException(Resources.format(Resources.Keys.IllegalQualifiedName_1, name));
origin: org.apache.sis.storage/sis-storage

  result = match;
} else {
  throw new IllegalNameException(Resources.forLocale(getLocale())
      .getString(Resources.Keys.ResourceIdentifierCollision_2, getDisplayName(), identifier));
org.apache.sis.storageIllegalNameException

Javadoc

Thrown when an invalid name is used for identifying a coverage, a feature or other kind of element in a data store. A name may be invalid because no coverage or feature exists in the DataStore for that name, or because the name is ambiguous (in which case the exception message should explain why), or because the name of a new org.apache.sis.feature.DefaultFeatureTypeto add in the DataStore conflicts with the name of an existing feature type.

Most used methods

  • <init>
    Creates a new exception which will format a localized message in the given locale.
  • getMessage

Popular in Java

  • Reactive rest calls using spring rest template
  • startActivity (Activity)
  • orElseThrow (Optional)
    Return the contained value, if present, otherwise throw an exception to be created by the provided s
  • onRequestPermissionsResult (Fragment)
  • EOFException (java.io)
    Thrown when a program encounters the end of a file or stream during an input operation.
  • InputStreamReader (java.io)
    A class for turning a byte stream into a character stream. Data read from the source input stream is
  • SortedMap (java.util)
    A map that has its keys ordered. The sorting is according to either the natural ordering of its keys
  • HttpServletRequest (javax.servlet.http)
    Extends the javax.servlet.ServletRequest interface to provide request information for HTTP servlets.
  • JOptionPane (javax.swing)
  • Table (org.hibernate.mapping)
    A relational table
  • Github Copilot alternatives
Tabnine Logo
  • Products

    Search for Java codeSearch for JavaScript code
  • IDE Plugins

    IntelliJ IDEAWebStormVisual StudioAndroid StudioEclipseVisual Studio CodePyCharmSublime TextPhpStormVimGoLandRubyMineEmacsJupyter NotebookJupyter LabRiderDataGripAppCode
  • Company

    About UsContact UsCareers
  • Resources

    FAQBlogTabnine AcademyTerms of usePrivacy policyJava Code IndexJavascript Code Index
Get Tabnine for your IDE now