Examples of DocBuilder


Examples of com.stuffwithstuff.magpie.interpreter.DocBuilder

        //
        // showDoc(method is String)
        //   Displays the documentation for the multimethod with the given name.
        // showDoc(class is Class)
        //   Displays the documentation for the given class.
        System.out.println(new DocBuilder().append(name, multimethod).toString());
      }
     
      return context.nothing();
    }
View Full Code Here

Examples of com.stuffwithstuff.magpie.interpreter.DocBuilder

  private static abstract class Methods implements Intrinsic {
    public Obj invoke(final Context context, Obj left, Obj right) {
    
      final Obj matchingValue = getMatchingValueFromArgs(context, left, right);

      DocBuilder docBuilder = new DocBuilder() {

        @Override
        protected boolean shouldDisplayMethod(Callable callable) {
          return isMatchingMethod(matchingValue, context, callable);
        }
      };

      for(Entry<String, Multimethod> multimethod : findMultimethods(context, matchingValue)) {
        docBuilder.append(multimethod.getKey(), multimethod.getValue());
        docBuilder.append("\n");
      }
      System.out.println(docBuilder.toString());
     
      return context.nothing();
    }
View Full Code Here

Examples of gc.solr.publish.DocBuilder

     - gpt fields?
     - tags?
   */
   
    TaskContext context = getContext();
    DocBuilder builder = new DocBuilder();
    DocInfo info = new DocInfo();
    SolrInputDocument doc = new SolrInputDocument();
    String s;
   
    if (id == null) id = UuidUtil.normalizeGptUuid(resource.docuuid);
    info.Id = id;
    info.Id_Table = FieldConstants.Val_Id_Table_DocIndex;
   
    //info.Owner_Dn = user.dn;
    info.Owner_Username = user.username;
   
    String sItemUrl = null;
    s = resource.sourceuri;
    if ((s != null) && (s.startsWith("http:") || s.startsWith("https:") ||
         s.startsWith("ftp:") || s.startsWith("ftps:"))) {
      sItemUrl = resource.sourceuri;
    }
    info.Src_Item_Http_ContentType = null;
    info.Src_Item_Http_ForeignStamp = null;
    info.Src_Item_Http_LastModified = null;
    info.Src_Item_LastModified = resource.updatedate;
    info.Src_Item_Uri = resource.sourceuri;
    info.Src_Item_Url = sItemUrl;
    if (parentSite != null) {
      info.Src_Site_Id = resource.siteuuid;
      //info.Src_Site_Name = parentSite.title;
      info.Src_Site_Protocol = parentSite.protocol_type;
      info.Src_Site_Url = parentSite.host_url;
    }
   
    String fs = makeForeignStamp(resource);
    info.Sync_Foreign_Id = resource.docuuid;
    info.Sync_Foreign_InstanceId = this.foreignInstanceId;
    info.Sync_Foreign_InstanceUrl = this.foreignInstanceUrl;
    info.Sync_Foreign_Stamp = fs;
    info.Sync_Type = this.syncType;
   
    if (!resource.isHarvestingSite) {
      String sMetadataUrl = null;
      s = this.foreignInstanceUrl;
      if ((s != null) && (s.length() > 0) && (!s.contains("?"))) {
        if (!s.endsWith("/")) s += "/";
        sMetadataUrl = s+"rest/document?id="+URLEncoder.encode(resource.docuuid,"UTF-8");
      }
      info.Url_Metadata = sMetadataUrl;
    }
    info.Xml_Metadata = resourceXml.xml;
   
    builder.prepare(context, xmlTypes, doc, info);
    if (!this.approvedOnly) {
      builder.setField(doc,"gpt.doc.approvalstatus_s",resource.approvalstatus);
    }
        if (collections!=null) {
          for (String shortName: collections.getShortNames()) {
            builder.addField(doc,FieldConstants.Sys_Src_Collections,shortName);
            builder.addField(doc,FieldConstants.Sys_Src_Collections_ss,shortName);
          }
        }
    //System.err.println(doc);
   
    if ((okIds != null) && (okIds.size() <= this.maxIdsInMap)) {
View Full Code Here

Examples of openperipheral.util.DocBuilder

    try {
      File output = new File(filename);

      if (!output.isAbsolute()) output = new File(OpenMods.proxy.getMinecraftDir(), filename);

      DocBuilder builder = new DocBuilder();

      for (Map.Entry<Class<?>, ClassMethodsList<IPeripheralMethodExecutor>> e : AdapterManager.peripherals.listCollectedClasses().entrySet())
        builder.createDocForTe(e.getKey(), e.getValue());

      for (Map.Entry<Class<?>, ClassMethodsList<IObjectMethodExecutor>> e : AdapterManager.objects.listCollectedClasses().entrySet())
        builder.createDocForObject(e.getKey(), e.getValue());

      for (IAdapterMethodsList<?> e : AdapterManager.peripherals.listExternalAdapters())
        builder.createDocForPeripheral("peripheralAdapter", e);

      for (IAdapterMethodsList<?> e : AdapterManager.objects.listExternalAdapters())
        builder.createDocForPeripheral("objectAdapter", e);

      builder.dump(output);
      sender.addChatMessage(new ChatComponentText("Done! Created file in " + output.getAbsolutePath()));
    } catch (Throwable t) {
      Log.warn(t, "Failed to execute dump command");
      sender.addChatMessage(new ChatComponentText("Failed to execute! Check logs"));
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.