/** * Lookup an entry type * * @param name The name of the catalog entry type. * @return The type of the catalog entry with the specified name. * @throws InvalidCatalogEntryTypeException if no entry has the * specified name. */ public static int getEntryType(String name) throws CatalogException { if (!entryTypes.containsKey(name)) { throw new CatalogException(CatalogException.INVALID_ENTRY_TYPE); } Integer iType = (Integer) entryTypes.get(name); if (iType == null) { throw new CatalogException(CatalogException.INVALID_ENTRY_TYPE); } return iType.intValue(); }
/** * Find out how many arguments an entry is required to have. * * @param type A valid catalog entry type. * @return The number of arguments that entry type is required to have. * @throws InvalidCatalogEntryTypeException if the type is invalid. */ public static int getEntryArgCount(int type) throws CatalogException { try { Integer iArgs = (Integer) entryArgs.get(type); return iArgs.intValue(); } catch (ArrayIndexOutOfBoundsException e) { throw new CatalogException(CatalogException.INVALID_ENTRY_TYPE); } }
/** * Find out how many arguments an entry is required to have. * * @param type A valid catalog entry type. * @return The number of arguments that entry type is required to have. * @throws InvalidCatalogEntryTypeException if the type is invalid. */ public static int getEntryArgCount(int type) throws CatalogException { try { Integer iArgs = (Integer) entryArgs.get(type); return iArgs.intValue(); } catch (ArrayIndexOutOfBoundsException e) { throw new CatalogException(CatalogException.INVALID_ENTRY_TYPE); } }
/** * Lookup an entry type * * @param name The name of the catalog entry type. * @return The type of the catalog entry with the specified name. * @throws InvalidCatalogEntryTypeException if no entry has the * specified name. */ public static int getEntryType(String name) throws CatalogException { if (!entryTypes.containsKey(name)) { throw new CatalogException(CatalogException.INVALID_ENTRY_TYPE); } Integer iType = (Integer) entryTypes.get(name); if (iType == null) { throw new CatalogException(CatalogException.INVALID_ENTRY_TYPE); } return iType.intValue(); }
/** * Find out how many arguments an entry is required to have. * * @param type A valid catalog entry type. * @return The number of arguments that entry type is required to have. * @throws InvalidCatalogEntryTypeException if the type is invalid. */ public static int getEntryArgCount(int type) throws CatalogException { try { Integer iArgs = (Integer) entryArgs.get(type); return iArgs.intValue(); } catch (ArrayIndexOutOfBoundsException e) { throw new CatalogException(CatalogException.INVALID_ENTRY_TYPE); } }
/** * Lookup an entry type * * @param name The name of the catalog entry type. * @return The type of the catalog entry with the specified name. * @throws InvalidCatalogEntryTypeException if no entry has the * specified name. */ public static int getEntryType(String name) throws CatalogException { if (!entryTypes.containsKey(name)) { throw new CatalogException(CatalogException.INVALID_ENTRY_TYPE); } Integer iType = (Integer) entryTypes.get(name); if (iType == null) { throw new CatalogException(CatalogException.INVALID_ENTRY_TYPE); } return iType.intValue(); }
/** * Construct a catalog entry of the specified type. * * @param type The entry type * @param args A String Vector of arguments * @throws InvalidCatalogEntryTypeException if no such entry type * exists. * @throws InvalidCatalogEntryException if the wrong number of arguments * is passed. */ public CatalogEntry(int type, Vector args) throws CatalogException { try { Integer iArgs = (Integer) entryArgs.get(type); if (iArgs.intValue() != args.size()) { throw new CatalogException(CatalogException.INVALID_ENTRY); } } catch (ArrayIndexOutOfBoundsException e) { throw new CatalogException(CatalogException.INVALID_ENTRY_TYPE); } entryType = type; this.args = args; }
/** * Construct a catalog entry of the specified type. * * @param type The entry type * @param args A String Vector of arguments * @throws InvalidCatalogEntryTypeException if no such entry type * exists. * @throws InvalidCatalogEntryException if the wrong number of arguments * is passed. */ public CatalogEntry(int type, Vector args) throws CatalogException { try { Integer iArgs = (Integer) entryArgs.get(type); if (iArgs.intValue() != args.size()) { throw new CatalogException(CatalogException.INVALID_ENTRY); } } catch (ArrayIndexOutOfBoundsException e) { throw new CatalogException(CatalogException.INVALID_ENTRY_TYPE); } entryType = type; this.args = args; }
/** * Construct a catalog entry of the specified type. * * @param type The entry type * @param args A String Vector of arguments * @throws InvalidCatalogEntryTypeException if no such entry type * exists. * @throws InvalidCatalogEntryException if the wrong number of arguments * is passed. */ public CatalogEntry(int type, Vector args) throws CatalogException { try { Integer iArgs = (Integer) entryArgs.get(type); if (iArgs.intValue() != args.size()) { throw new CatalogException(CatalogException.INVALID_ENTRY); } } catch (ArrayIndexOutOfBoundsException e) { throw new CatalogException(CatalogException.INVALID_ENTRY_TYPE); } entryType = type; this.args = args; }
/** * Construct a catalog entry of the specified type. * * @param name The name of the entry type * @param args A String Vector of arguments * @throws InvalidCatalogEntryTypeException if no such entry type * exists. * @throws InvalidCatalogEntryException if the wrong number of arguments * is passed. */ public CatalogEntry(String name, Vector args) throws CatalogException { Integer iType = (Integer) entryTypes.get(name); if (iType == null) { throw new CatalogException(CatalogException.INVALID_ENTRY_TYPE); } int type = iType.intValue(); try { Integer iArgs = (Integer) entryArgs.get(type); if (iArgs.intValue() != args.size()) { throw new CatalogException(CatalogException.INVALID_ENTRY); } } catch (ArrayIndexOutOfBoundsException e) { throw new CatalogException(CatalogException.INVALID_ENTRY_TYPE); } entryType = type; this.args = args; }
/** * Construct a catalog entry of the specified type. * * @param name The name of the entry type * @param args A String Vector of arguments * @throws InvalidCatalogEntryTypeException if no such entry type * exists. * @throws InvalidCatalogEntryException if the wrong number of arguments * is passed. */ public CatalogEntry(String name, Vector args) throws CatalogException { Integer iType = (Integer) entryTypes.get(name); if (iType == null) { throw new CatalogException(CatalogException.INVALID_ENTRY_TYPE); } int type = iType.intValue(); try { Integer iArgs = (Integer) entryArgs.get(type); if (iArgs.intValue() != args.size()) { throw new CatalogException(CatalogException.INVALID_ENTRY); } } catch (ArrayIndexOutOfBoundsException e) { throw new CatalogException(CatalogException.INVALID_ENTRY_TYPE); } entryType = type; this.args = args; }
/** * Construct a catalog entry of the specified type. * * @param name The name of the entry type * @param args A String Vector of arguments * @throws InvalidCatalogEntryTypeException if no such entry type * exists. * @throws InvalidCatalogEntryException if the wrong number of arguments * is passed. */ public CatalogEntry(String name, Vector args) throws CatalogException { Integer iType = (Integer) entryTypes.get(name); if (iType == null) { throw new CatalogException(CatalogException.INVALID_ENTRY_TYPE); } int type = iType.intValue(); try { Integer iArgs = (Integer) entryArgs.get(type); if (iArgs.intValue() != args.size()) { throw new CatalogException(CatalogException.INVALID_ENTRY); } } catch (ArrayIndexOutOfBoundsException e) { throw new CatalogException(CatalogException.INVALID_ENTRY_TYPE); } entryType = type; this.args = args; }
throw new CatalogException(CatalogException.UNPARSEABLE); throw new CatalogException(CatalogException.UNPARSEABLE); } catch (IllegalAccessException iae) { throw new CatalogException(CatalogException.UNPARSEABLE); } catch (InstantiationException ie) { throw new CatalogException(CatalogException.UNPARSEABLE); } catch (ParserConfigurationException pce) { throw new CatalogException(CatalogException.UNKNOWN_FORMAT); } catch (SAXException se) { Exception e = se.getException(); if (e != null) { if (e.getClass() == uhe.getClass()) { throw new CatalogException(CatalogException.PARSE_FAILED, e.toString()); } else if (e.getClass() == fnfe.getClass()) { throw new CatalogException(CatalogException.PARSE_FAILED, e.toString()); throw new CatalogException(se);
throw new CatalogException(CatalogException.UNPARSEABLE); throw new CatalogException(CatalogException.UNPARSEABLE); } catch (IllegalAccessException iae) { throw new CatalogException(CatalogException.UNPARSEABLE); } catch (InstantiationException ie) { throw new CatalogException(CatalogException.UNPARSEABLE); } catch (ParserConfigurationException pce) { throw new CatalogException(CatalogException.UNKNOWN_FORMAT); } catch (SAXException se) { Exception e = se.getException(); if (e != null) { if (e.getClass() == uhe.getClass()) { throw new CatalogException(CatalogException.PARSE_FAILED, e.toString()); } else if (e.getClass() == fnfe.getClass()) { throw new CatalogException(CatalogException.PARSE_FAILED, e.toString()); throw new CatalogException(se);
throw new CatalogException(CatalogException.UNPARSEABLE); throw new CatalogException(CatalogException.UNPARSEABLE); } catch (IllegalAccessException iae) { throw new CatalogException(CatalogException.UNPARSEABLE); } catch (InstantiationException ie) { throw new CatalogException(CatalogException.UNPARSEABLE); } catch (ParserConfigurationException pce) { throw new CatalogException(CatalogException.UNKNOWN_FORMAT); } catch (SAXException se) { Exception e = se.getException(); if (e != null) { if (e.getClass() == uhe.getClass()) { throw new CatalogException(CatalogException.PARSE_FAILED, e.toString()); } else if (e.getClass() == fnfe.getClass()) { throw new CatalogException(CatalogException.PARSE_FAILED, e.toString()); throw new CatalogException(se);
String msg = "No CatalogReader for MIME type: " + mimeType; catalogManager.debug.message(2, msg); throw new CatalogException(CatalogException.UNPARSEABLE, msg);
String msg = "No CatalogReader for MIME type: " + mimeType; catalogManager.debug.message(2, msg); throw new CatalogException(CatalogException.UNPARSEABLE, msg);
String msg = "No CatalogReader for MIME type: " + mimeType; catalogManager.debug.message(2, msg); throw new CatalogException(CatalogException.UNPARSEABLE, msg);
throw new CatalogException(CatalogException.UNENDED_COMMENT, "Unterminated comment in catalog file; EOF treated as end-of-comment.");
builder = factory.newDocumentBuilder(); } catch (ParserConfigurationException pce) { throw new CatalogException(CatalogException.UNPARSEABLE); doc = builder.parse(is); } catch (SAXException se) { throw new CatalogException(CatalogException.UNKNOWN_FORMAT); } catch (ClassNotFoundException cnfe) { catalog.getCatalogManager().debug.message(1, "Cannot load XML Catalog Parser class", domParserClass); throw new CatalogException(CatalogException.UNPARSEABLE); } catch (InstantiationException ie) { catalog.getCatalogManager().debug.message(1, "Cannot instantiate XML Catalog Parser class", domParserClass); throw new CatalogException(CatalogException.UNPARSEABLE); } catch (IllegalAccessException iae) { catalog.getCatalogManager().debug.message(1, "Cannot access XML Catalog Parser class", domParserClass); throw new CatalogException(CatalogException.UNPARSEABLE); } catch (ClassCastException cce ) { catalog.getCatalogManager().debug.message(1, "Cannot cast XML Catalog Parser class", domParserClass); throw new CatalogException(CatalogException.UNPARSEABLE);