/*
the getCatalog method is part of PdfWriter.
we wrap this so that we can extend it
436184
protected PdfDictionary getCatalog(PdfIndirectReference rootObj) {
        try {
            PdfDictionary theCat = pdf.getCatalog(rootObj);
            if (fieldArray == null) {
                if (acroForm != null) theCat.put(PdfName.ACROFORM, acroForm);
            }
            else
                addFieldResources(theCat);
            return theCat;
        }
        catch (IOException e) {
            throw new ExceptionConverter(e);
        }
    }
281947
function() {
        library.addCatalog({
            slug: 'langnames',
            url: 'https://td.unfoldingword.org/exports/langnames.json',
            modified_at: 0
        });
        library.addCatalog({
            slug: 'new-language-questions',
            url: 'https://td.unfoldingword.org/api/questionnaire/',
            modified_at: 0
        });
        library.addCatalog({
            slug: 'temp-langnames',
            url: 'https://td.unfoldingword.org/api/templanguages/',
            modified_at: 0
        });
        // TRICKY: this catalog should always be indexed after langnames and temp-langnames otherwise the linking will fail!
        library.addCatalog({
            slug: 'approved-temp-langnames',
            url: 'https://td.unfoldingword.org/api/templanguages/assignment/changed/',
            modified_at: 0
        });
        return Promise.resolve();
    }
1079506
@Override
    protected void coreLoadCatalog(long timestamp, final byte[] catalogBytes) throws EEException {
        LOG.trace("Loading Application Catalog...");
        int errorCode = 0;
        errorCode = nativeLoadCatalog(pointer, timestamp, catalogBytes);
        checkErrorCode(errorCode);
        //LOG.info("Loaded Catalog.");
    }
776692
@Override
  public OperationHandle getCatalogs(SessionHandle sessionHandle) throws HiveSQLException {
    try {
      TGetCatalogsReq req = new TGetCatalogsReq(sessionHandle.toTSessionHandle());
      TGetCatalogsResp resp = cliService.GetCatalogs(req);
      checkStatus(resp.getStatus());
      TProtocolVersion protocol = sessionHandle.getProtocolVersion();
      return new OperationHandle(resp.getOperationHandle(), protocol);
    } catch (HiveSQLException e) {
      throw e;
    } catch (Exception e) {
      throw new HiveSQLException(e);
    }
  }
1121740
private void writeResourceAdapter(Definition def, Writer out, int indent) throws IOException
   {
      writeWithIndent(out, indent, "/**\n");
      writeWithIndent(out, indent, " * Get the resource adapter\n");
      writeWithIndent(out, indent, " *\n");
      writeWithIndent(out, indent, " * @return The handle\n");
      writeWithIndent(out, indent, " */\n");

      writeWithIndent(out, indent, "public ResourceAdapter getResourceAdapter()");
      writeLeftCurlyBracket(out, indent);

      writeLogging(def, out, indent + 1, "trace", "getResourceAdapter");

      writeIndent(out, indent + 1);
      out.write("return ra;");
      writeRightCurlyBracket(out, indent);
      writeEol(out);

      writeWithIndent(out, indent, "/**\n");
      writeWithIndent(out, indent, " * Set the resource adapter\n");
      writeWithIndent(out, indent, " *\n");
      writeWithIndent(out, indent, " * @param ra The handle\n");
      writeWithIndent(out, indent, " */\n");

      writeWithIndent(out, indent, "public void setResourceAdapter(ResourceAdapter ra)");
      writeLeftCurlyBracket(out, indent);

      writeLogging(def, out, indent + 1, "trace", "setResourceAdapter", "ra");

      writeIndent(out, indent + 1);
      out.write("this.ra = ra;");
      writeRightCurlyBracket(out, indent);
      writeEol(out);
   }
8154
public static synchronized CatalogResolver getCatalogResolver() {
        if (catalogResolver == null) {
            final CatalogManager manager = new CatalogManager();
            manager.setIgnoreMissingProperties(true);
            manager.setUseStaticCatalog(false); // We'll use a private catalog.
            manager.setPreferPublic(true);
            final File catalogFilePath = new File(ditaDir, Configuration.pluginResourceDirs.get("org.dita.base") + File.separator + FILE_NAME_CATALOG);
            manager.setCatalogFiles(catalogFilePath.toURI().toASCIIString());
            //manager.setVerbosity(10);
            catalogResolver = new CatalogResolver(manager);
        }

        return catalogResolver;
    }
43952
protected function generateCatalog()
    {
        $catalog = $this->allWarehouseContent();
        $catalog = array_filter($catalog, 'is_file');
        $catalog = array_combine($catalog, $catalog);
        $catalog = array_map([$this, 'toBasePath'], $catalog);

        return $catalog;
    }
773574
public final String revealWhereCatalog(final TradingCatalog pTcat,
    final FilterItems<CatalogGs> pFilterCatalog) throws Exception {
    List<CatalogGs> subcgsAll = new ArrayList<CatalogGs>();
    subcgsAll.add(pTcat.getCatalog());
    if (pFilterCatalog != null && pFilterCatalog.getOperator() != null
      && pFilterCatalog.getItems().size() > 0) {
      for (CatalogGs cgs : pFilterCatalog.getItems()) {
        TradingCatalog tcat = findTradingCatalogById(this.catalogs,
          cgs.getItsId());
        subcgsAll.add(cgs);
        copySubcatalogsGs(tcat, subcgsAll);
      }
    } else {
      copySubcatalogsGs(pTcat, subcgsAll);
    }
    Set<CatalogGs> subcgs = new HashSet<CatalogGs>();
    for (CatalogGs cgs : subcgsAll) {
      if (!cgs.getHasSubcatalogs()) {
        subcgs.add(cgs);
      }
    }
    if (subcgs.size() > 1) {
      StringBuffer sb = new StringBuffer(" in ("
        + pTcat.getCatalog().getItsId());
      for (CatalogGs cgs : subcgs) {
        sb.append("," + cgs.getItsId());
      }
      sb.append(")");
      return sb.toString();
    } else {
      return "=" + subcgs.iterator().next().getItsId();
    }
  }
358083
PdfDictionary getDictionary(PdfWriter writer) {
        try {
            return PdfNumberTree.writeTree(map, writer);
        }
        catch (IOException e) {
            throw new ExceptionConverter(e);
        }
    }
33056
@Override
	public LinkRelation getCollectionResourceRelFor(Class<?> resource) {

		LookupContext context = LookupContext.forCollectionResourceRelLookup(entityType);

		return providers.getRequiredPluginFor(context).getCollectionResourceRelFor(resource);
	}
264789
@Override
	public Statement getDetailInfo(String CorpNum, int ItemCode, String MgtKey) throws PopbillException {
		return getDetailInfo(CorpNum, ItemCode, MgtKey, null);
	}
944723
public Element getDatastoreCatalogElement() {
        final Element configurationFileDocumentElement = getDocumentElement();

        final Element datastoreCatalogElement =
                getOrCreateChildElementByTagName(configurationFileDocumentElement, "datastore-catalog");
        if (datastoreCatalogElement == null) {
            throw new IllegalStateException("Could not find <datastore-catalog> element in configuration file");
        }
        return datastoreCatalogElement;
    }
238972
protected CatalogManager createCatalogManager() {

		CatalogManager manager = new CatalogManager();
		manager.setIgnoreMissingProperties(true);
		ClassLoader classLoader = Thread.currentThread().getContextClassLoader();
		StringBuffer builder = new StringBuffer();
		boolean first = true;
		for (int i = 0; i < catalogs.length; i++) {
			final String catalog = catalogs[i];

			try {
				Enumeration<URL> enumeration = classLoader.getResources(catalog);
				while (enumeration.hasMoreElements()) {
					if (!first) {
						builder.append(';');
					} else {
						first = false;
					}
					URL resource = enumeration.nextElement();
					builder.append(resource.toExternalForm());
				}
			} catch (IOException ioe) {
				getLog().warn("Failed to search for catalog files: " + catalog);
				// Let's be a little tolerant here.
			}
		}
		//builder.append("jar:file:/Users/salmanqureshi/.m2/repository/net/sf/docbook/docbook-xsl/1.76.1/docbook-xsl-1.76.1-ns-resources.zip!/docbook/catalog.xml");
		String catalogFiles = builder.toString();
		if (catalogFiles.length() == 0) {
			getLog().warn("Failed to find catalog files.");
		} else {
			if (getLog().isDebugEnabled()) {
				getLog().debug("Catalogs to load: " + catalogFiles);
			}
			manager.setCatalogFiles(catalogFiles);
		}
		return manager;
	}
497968
public static Class[] getCollectionType( PropertyDescriptor pd, boolean useGetter )
         throws JSONException {

      Type type;
      if( useGetter ){
         Method m = pd.getReadMethod();
         type = m.getGenericReturnType();
      }else{
         Method m = pd.getWriteMethod();
         Type[] gpts = m.getGenericParameterTypes();

         if( 1 != gpts.length ){
            throw new JSONException( "method " + m + " is not a standard setter" );
         }
         type = gpts[0];
      }

      if( !(type instanceof ParameterizedType) ){
         return null;
         // throw new JSONException("type not instanceof ParameterizedType:
         // "+type.getClass());
      }

      ParameterizedType pType = (ParameterizedType) type;
      Type[] actualTypes = pType.getActualTypeArguments();

      Class[] ret = new Class[actualTypes.length];
      for( int i = 0; i < ret.length; i++ ){
         ret[i] = (Class) actualTypes[i];
      }

      return ret;
   }
639785
public static function get($dictionary, $key, PdfType $default = null)
    {
        $dictionary = self::ensure($dictionary);

        if (isset($dictionary->value[$key])) {
            return $dictionary->value[$key];
        }

        return $default === null
            ? new PdfNull()
            : $default;
    }
908976
function PDFObjects_getData(objId) {
      var objs = this.objs;
      if (!objs[objId] || !objs[objId].resolved) {
        return null;
      } else {
        return objs[objId].data;
      }
    }
547129
@Override
    public ResultSet getCatalogs() throws SQLException
    {
        checkClosed();
        VoltTable result = new VoltTable(new VoltTable.ColumnInfo("TABLE_CAT",VoltType.STRING));
        result.addRow(new Object[] { catalogString });
        return new JDBC4ResultSet(null, result);
    }