Codota Logo
CodeWriter.<init>
Code IndexAdd Codota to your IDE (free)

How to use
org.objectweb.fractal.cecilia.adl.file.CodeWriter
constructor

Best Java code snippets using org.objectweb.fractal.cecilia.adl.file.CodeWriter.<init> (Showing top 20 results out of 315)

  • Add the Codota plugin to your IDE and get smart completions
private void myMethod () {
SimpleDateFormat s =
  • Codota IconString pattern;new SimpleDateFormat(pattern)
  • Codota IconString template;Locale locale;new SimpleDateFormat(template, locale)
  • Codota Iconnew SimpleDateFormat()
  • Smart code suggestions by Codota
}
origin: org.objectweb.think.minus/cecilia-adl-export-bind

public void enterInterface(final InterfaceDefinition itf) throws Exception {
 methenum_cw = new CodeWriter();
 methcode_cw = new CodeWriter();
 ItfName = (itf.getName().replace('.', '_'));
 methenum_cw.append("typedef enum {");
}
origin: org.objectweb.think.minus/cecilia-adl-export-bind

public void enterInterface(final InterfaceDefinition itf) throws Exception {
 methcode_cw = new CodeWriter();
 methenum_cw = new CodeWriter();
 ItfName = (itf.getName().replace('.', '_'));
 methenum_cw.append("typedef enum {");
}
origin: org.objectweb.think.minus/cecilia-adl-export-bind

@Override
protected String processSourceCode() throws Exception {
 cw = new CodeWriter(getClass().getName());
 visit(itf);
 return cw.toString();
}
origin: org.objectweb.think.minus/cecilia-adl-export-bind

public void enterInterface(final InterfaceDefinition itf) throws Exception {
 meths_cw = new CodeWriter();
 params_cw = new CodeWriter();
 args_cw = new CodeWriter();
 switchs_cw = new CodeWriter();
 ItfName = ("");
 ItfName = (itf.getName().replace('.', '_'));
 meths_cw.appendln("typedef enum {");
 params_cw.appendln("typedef struct {");
 params_cw.appendln(ItfName + "_meths_t Methods;");
 params_cw.appendln("union {");
 switchs_cw.appendln("switch (pPr->Methods)");
 switchs_cw.appendln("{");
}
origin: org.objectweb.think.minus/cecilia-adl-export-bind

public void enterInterface(final InterfaceDefinition itf) throws Exception {
 meths_cw = new CodeWriter();
 params_cw = new CodeWriter();
 code_cw = new CodeWriter();
 args_cw = new CodeWriter();
 ItfName = (itf.getName().replace('.', '_'));
 meths_cw.endl();
 meths_cw.append("typedef enum {");
 params_cw.appendln("typedef struct {");
 params_cw.append(ItfName).append("_meths_t Methods;").endl();
 params_cw.appendln("union {");
}
origin: org.objectweb.think.minus/cecilia-adl-dynamic

 @Override
 protected String processSourceCode() throws Exception {
  final CodeWriter cw = new CodeWriter(
    "Client Interfaces Descriptor Builder (initialization)");
  final String name = typeNameProviderItf.getCTypeName();
  final String structName = name + "_importeds_desc";
  cw.append(structName);
  return cw.toString();
 }
}
origin: org.objectweb.think.minus/cecilia-adl-dynamic

 @Override
 protected String processSourceCode() throws Exception {
  final CodeWriter cw = new CodeWriter(
    "Server Interfaces Descriptor Builder (initialization)");
  final String name = typeNameProviderItf.getCTypeName();
  final String structName = name + "_exporteds_desc";
  cw.append(structName);
  return cw.toString();
 }
}
origin: org.objectweb.think.minus/cecilia-adl-comete-deployment

 /**
  * Generate the C code for this structure
  * 
  * @return the C code
  */
 public String getSource() {
  final CodeWriter cw = new CodeWriter();

  cw.appendln("static primitive_t " + structName + " = {{PRIMITIVE, \""
    + instanceName + "\"}, \"" + defName + "\", " + pe + "};");
  cw.endl();

  return cw.toString();
 }
}
origin: org.objectweb.think.minus/cecilia-adl-export-bind

 @Override
 protected String processSourceCode() throws Exception {
  final CodeWriter cw = new CodeWriter("Implementation Definition Builder");
  final String componentCName = typeNameProviderItf.getCTypeName();
  CbstMacroDefinitionVisitor.appendMacros(cw, componentCName);
  // Print the implementation code.
  appendImplementationCode(cw);
  return cw.toString();
 }
}
origin: org.objectweb.think.minus/cecilia-adl-export-bind

 @Override
 protected String processSourceCode() throws Exception {
  final CodeWriter cw = new CodeWriter("Implementation Definition Builder");
  final String componentCName = typeNameProviderItf.getCTypeName();
  CbstMacroDefinitionVisitor.appendMacros(cw, componentCName);
  // Print the implementation code.
  appendImplementationCode(cw);
  return cw.toString();
 }
}
origin: org.objectweb.think.minus/cecilia-adl-dynamic

 @Override
 protected String processSourceCode() throws Exception {
  final CodeWriter cw = new CodeWriter("Binding Controller Data Descriptor");
  final String instanceName = instanceNameProviderItf.getCInstanceName();
  cw.append("static binding_desc_t ").append(instanceName).append(
    "_bindings_desc[] = {").endl();
  for (final Binding binding : bindings) {
   final String from = binding.getFrom();
   int index = from.indexOf('.');
   String clientComp = from.substring(0, index);
   final String clientItf = from.substring(index + 1);
   final String to = binding.getTo();
   index = to.indexOf('.');
   String serverComp = to.substring(0, index);
   final String serverItf = to.substring(index + 1);
   if (serverComp.equals("this"))
    serverComp = "thisComposite";
   else if (clientComp.equals("this")) clientComp = "thisComposite";
   cw.append("{").append(clientComp.toString().replace('.', '_')).append(
     "_exp, \"").append(clientItf).append("\", ").append(
     serverComp.toString().replace('.', '_')).append("_exp, \"").append(
     serverItf).append("\"},").endl();
  }
  cw.append("};").endl();
  return cw.toString();
 }
}
origin: org.objectweb.think.minus/cecilia-adl-dynamic

 @Override
 protected String processSourceCode() throws Exception {
  final CodeWriter cw = new CodeWriter("Component Definition Builder");
  cw.append("#define IN_CECILIA_MECHANISM").endl();
  if (interfaceDefinitionsProviderItf != null)
   cw.appendln(interfaceDefinitionsProviderItf.getSourceCode()).endl();
  cw.endl();
  return cw.toString();
 }
}
origin: org.objectweb.think.minus/cecilia-adl-dynamic

 @Override
 protected String processSourceCode() throws Exception {
  final CodeWriter cw = new CodeWriter(
    "Client Interfaces Descriptor Builder (extern references to server components.)");
  final String name = typeNameProviderItf.getCTypeName();
  final String structName = name + "_importeds_desc";
  final StringBuilder offset = new StringBuilder(name.toUpperCase());
  offset.append("_IMPORTEDS_BASE_OFFSET");
  cw.append("static required_interface_desc_t ").append(structName).append(
    "[] = {").endl();
  for (final TypeInterface itf : clientInterfaces) {
   cw.append("{").endl();
   cw.append("\"").append(itf.getName()).append("\",  // name").endl();
   cw.append("(").append(offset.toString()).append(")").endl();
   cw.append("},").endl();
   offset.append("\n + sizeof(R").append(
     itf.getSignature().replace('.', '_')).append(" *)");
  }
  cw.append("};").endl();
  return cw.toString();
 }
}
origin: org.objectweb.think.minus/cecilia-adl-dynamic

 @Override
 protected String processSourceCode() throws Exception {
  final CodeWriter cw = new CodeWriter("Component Definition Builder");
  cw.append("#define IN_CECILIA_MECHANISM").endl();
  if (interfaceDefinitionsProviderItf != null)
   cw.appendln(interfaceDefinitionsProviderItf.getSourceCode()).endl();
  cw.endl();
  return cw.toString();
 }
}
origin: org.objectweb.think.minus/cecilia-adl-export-bind

public void leaveInterface(final InterfaceDefinition itf) throws Exception {
 methenum_cw.appendln("} " + ItfName.toString() + "_meths_t;");
 cw = new CodeWriter();
 cw.endl();
 cw.append("#include <stdio.h>").endl();
 cw.appendln("DECLARE_DATA {};");
 cw.appendln("#include <cecilia.h>");
 cw.endl();
 cw.appendln(methenum_cw.toString()).endl();
 cw.appendln(methcode_cw.toString()).endl();
 cw.appendln(x);
}
origin: org.objectweb.think.minus/cecilia-adl-export-bind

public void leaveInterface(final InterfaceDefinition itf) throws Exception {
 methenum_cw.appendln("} " + ItfName.toString() + "_meths_t;");
 cw = new CodeWriter();
 cw.endl();
 cw.append("#include <stdio.h>").endl();
 cw.appendln("DECLARE_DATA {};");
 cw.appendln("#include <cecilia.h>");
 cw.endl();
 cw.appendln(methenum_cw.toString()).endl();
 cw.appendln(methcode_cw.toString()).endl();
 cw.appendln(x);
}
origin: org.objectweb.think.minus/cecilia-adl-dynamic

 @Override
 protected String processSourceCode() throws Exception {
  final CodeWriter cw = new CodeWriter("Server Interfaces Descriptor");
  final String name = typeNameProviderItf.getCTypeName();
  final String structName = name + "_exporteds_desc";
  // Build provided_interface_desc_t structures
  final StringBuilder offset = new StringBuilder();
  offset.append(name.toUpperCase()).append("_EXPORTEDS_BASE_OFFSET");
  cw.append("static provided_interface_desc_t ").append(structName).append(
    "[] = {").endl();
  for (final TypeInterface itf : exportedItfNodes) {
   cw.append("{").endl();
   cw.append("\"").append(itf.getName()).append("\",  // name").endl();
   cw.append("&(").append(name).append("_").append(
     itf.getName().replace('-', '_')).append("meth),  // vtable").endl();
   cw.append("(").append(offset.toString()).append(")").endl();
   /* Add the signature */
   cw.append("#if defined(TYPEDINTERFACE)").endl();
   cw.append(", \"").append(itf.getSignature()).append("\"").endl();
   cw.append("#endif").endl();
   cw.append("},").endl();
   offset.append("\n + sizeof(R").append(
     itf.getSignature().replace('.', '_')).append(")");
  }
  cw.append("};").endl().endl();
  return cw.toString();
 }
}
origin: org.objectweb.think.minus/cecilia-adl-export-bind

public void leaveInterface(final InterfaceDefinition itf) throws Exception {
 meths_cw.append("NB_METHS} ").append(ItfName.toString()).append(
   "_meths_t;").endl();
 params_cw.appendln("};");
 params_cw.append("} ").append(ItfName.toString()).append("_parms_t, *p")
   .append(ItfName.toString()).append("_parms_t;").endl();
 cw = new CodeWriter();
 cw.appendln("DECLARE_DATA {};");
 cw.appendln("#include <cecilia.h>");
 cw.endl();
 cw.append(meths_cw.toString()).endl();
 cw.append(args_cw.toString()).endl();
 cw.append(params_cw.toString()).endl();
 cw.append(code_cw.toString());
}
origin: org.objectweb.think.minus/cecilia-adl-dynamic

 @Override
 protected String processSourceCode() throws Exception {
  final CodeWriter cw = new CodeWriter("Interfaces Descriptor Builder");
  final String name = typeNameProviderItf.getCTypeName();
  cw
    .appendln("#include \"minus/common/generic/fractal/api/componentDesc.h\"");
  cw.append("#define ").append(name.toUpperCase()).append(
    "_TYPE_BASE_OFFSET 0").endl();
  String exporteds = null;
  if (serverItfInstancesItf != null) {
   exporteds = serverItfInstancesItf.getSourceCode();
   cw.append("#define ").append(name.toUpperCase()).append(
     "_EXPORTEDS_BASE_OFFSET ").append(name.toUpperCase()).append(
     "_TYPE_BASE_OFFSET").endl();
   cw.append(exporteds);
  }
  if (clientItfInstancesItf != null) {
   final String importeds = clientItfInstancesItf.getSourceCode();
   cw.append("#define ").append(name.toUpperCase()).append(
     "_IMPORTEDS_BASE_OFFSET (").append(name.toUpperCase()).append(
     "_TYPE_BASE_OFFSET");
   if (exporteds != null)
    cw.append(" + sizeof(struct ").append(name).append("_exporteds)");
   cw.append(")").endl();
   cw.append(importeds);
  }
  return cw.toString();
 }
}
origin: org.objectweb.think.minus/cecilia-adl-comete-deployment

/**
 * Get the source of the deployer
 * @return C code of the deployer
 */
public String getDeployerSource() {
 final CodeWriter cw = new CodeWriter();
 cw.appendln("/* This file is auto-generated */").endl();
 cw.append(deployerStructs);
 cw.endl();
 cw.appendln("static void *deployableComponents[] = {");
 for (final String composite : composites) {
  cw.append("(void *)&" + composite.replace(".", "_")).appendln(", ");
 }
 cw.appendln("0");
 cw.appendln("};").endl();
 cw.appendln("jint METHOD(lifecycle_controller, getFcState)(void* _this) {");
 cw.appendln("return fractal_api_ErrorConst_OPERATION_NOT_SUPPORTED;");
 cw.appendln("}").endl();
 cw.appendln("jint METHOD(lifecycle_controller, startFc) (void* _this) {");
 cw.appendln("DATA.deployableComponents = deployableComponents;");
 cw.appendln("return fractal_api_ErrorConst_OK;");
 cw.appendln("}").endl();
 cw.appendln("jint METHOD(lifecycle_controller, stopFc) (void* _this) {");
 cw.appendln("return fractal_api_ErrorConst_OK;");
 cw.appendln("}").endl();
 return cw.toString();
}
org.objectweb.fractal.cecilia.adl.fileCodeWriter<init>

Popular methods of CodeWriter

  • append
  • appendln
  • endl
  • toString

Popular in Java

  • Creating JSON documents from java classes using gson
  • addToBackStack (FragmentTransaction)
  • requestLocationUpdates (LocationManager)
  • getContentResolver (Context)
  • ByteBuffer (java.nio)
    A buffer for bytes. A byte buffer can be created in either one of the following ways: * #allocate(i
  • Charset (java.nio.charset)
    A charset is a named mapping between Unicode characters and byte sequences. Every Charset can decode
  • DecimalFormat (java.text)
    DecimalFormat is a concrete subclass ofNumberFormat that formats decimal numbers. It has a variety o
  • TimeUnit (java.util.concurrent)
    A TimeUnit represents time durations at a given unit of granularity and provides utility methods to
  • Pattern (java.util.regex)
    A compiled representation of a regular expression. A regular expression, specified as a string, must
  • Logger (org.apache.log4j)
    This is the central class in the log4j package. Most logging operations, except configuration, are d
Codota Logo
  • Products

    Search for Java codeSearch for JavaScript codeEnterprise
  • IDE Plugins

    IntelliJ IDEAWebStormAndroid StudioEclipseVisual Studio CodePyCharmSublime TextPhpStormVimAtomGoLandRubyMineEmacsJupyter
  • Company

    About UsContact UsCareers
  • Resources

    FAQBlogCodota Academy Plugin user guide Terms of usePrivacy policyJava Code IndexJavascript Code Index
Get Codota for your IDE now