Tabnine Logo
IllegalNameException.<init>
Code IndexAdd Tabnine to your IDE (free)

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

Best Java code snippets using org.apache.sis.storage.IllegalNameException.<init> (Showing top 12 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

/**
 * 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

/**
 * 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<init>

Javadoc

Creates an exception with no cause and no details message.

Popular methods of IllegalNameException

  • getMessage

Popular in Java

  • Reading from database using SQL prepared statement
  • getExternalFilesDir (Context)
  • orElseThrow (Optional)
    Return the contained value, if present, otherwise throw an exception to be created by the provided s
  • onRequestPermissionsResult (Fragment)
  • PrintStream (java.io)
    Fake signature of an existing Java class.
  • Selector (java.nio.channels)
    A controller for the selection of SelectableChannel objects. Selectable channels can be registered w
  • Collection (java.util)
    Collection is the root of the collection hierarchy. It defines operations on data collections and t
  • Semaphore (java.util.concurrent)
    A counting semaphore. Conceptually, a semaphore maintains a set of permits. Each #acquire blocks if
  • Manifest (java.util.jar)
    The Manifest class is used to obtain attribute information for a JarFile and its entries.
  • JButton (javax.swing)
  • CodeWhisperer 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