code
stringlengths
73
34.1k
label
stringclasses
1 value
public static void dumpBeansNames() { DefaultListableBeanFactory f = (DefaultListableBeanFactory) context.getBeanFactory(); String[] beanDefinitionNames = f.getBeanDefinitionNames(); for (String name : beanDefinitionNames) { JK.print(name, " for class :", f.getBean(name).getClass().getName()); } }
java
protected static Configuration getConfig(String path) { if (cfg == null) { cfg = new Configuration(); cfg.setClassForTemplateLoading(TemplateUtil.class, path == null ? "/templates" : path); cfg.setLocale(Locale.US); cfg.setTemplateExceptionHandler(TemplateExceptionHandler.RETHROW_HANDLER); } re...
java
protected void handleClient(final Socket client) throws IOException { final ClientHandler handler = new ClientHandler(client); this.executorService.execute(handler); }
java
public synchronized void stop() throws IOException { this.stopped = true; if (this.server != null && this.waitingClient) { this.server.close(); this.server = null; } }
java
private void resetConfigToDefault() { isUseWebservice = true; isUpdateAutomatic = true; isUseExternalMonomers = false; isUseExternalNucleotides = false; setUseExternalAttachments(false); webserviceMonomersURL = "http://localhost:8080/HELM2MonomerService/rest"; webserviceMonomersPath =...
java
public void refresh() { File configFile = new File(CONFIG_FILE_PATH); if (!configFile.exists()) { BufferedWriter writer = null; BufferedReader reader = null; try { configFile.createNewFile(); InputStream in = Chemistry.class.getResourceAsStream("/org/helm/notation2/res...
java
private static void addEntry(final ArrayList<String> aStringArray) { try { final MagicMimeEntry magicEntry = new MagicMimeEntry(aStringArray); mMagicMimeEntries.add(magicEntry); } catch (final InvalidMagicMimeEntryException e) { } }
java
private static String getMagicMimeType(final byte[] bytes) throws IOException { final int len = mMagicMimeEntries.size(); for (int i = 0; i < len; i++) { final MagicMimeEntry me = mMagicMimeEntries.get(i); final String mtype = me.getMatch(bytes); if (mtype != null) { return mtype; } } return nul...
java
public static String getMimeType(final byte[] data) { String mimeType = null; try { mimeType = MimeUtil.getMagicMimeType(data); } catch (final Exception e) { } finally { if (mimeType == null) { mimeType = UNKNOWN_MIME_TYPE; } } return mimeType; }
java
private static void parse(final Reader r) throws IOException { final BufferedReader br = new BufferedReader(r); String line; final ArrayList<String> sequence = new ArrayList<String>(); line = br.readLine(); while (true) { if (line == null) { break; } line = line.trim(); if (line.length() == 0...
java
public static JKContext getCurrentContext() { JKContext context = (JKContext) JKThreadLocal.getValue(JKContextConstants.JK_CONTEXT); if (context == null) { context = getInstance().createDesktopContext(); JKThreadLocal.setValue(JKContextConstants.JK_CONTEXT, context); } return context; }
java
public static byte[] generateImageHELMMolecule(HELM2Notation helm2notation) throws BuilderMoleculeException, CTKException, IOException, ChemistryException { LOG.info("Image generation process of HELM molecule starts"); /* get SMILES representation for the whole molecule */ String smiles = SMILES.getSMILE...
java
public static List<String> getAminoAcidList(String peptideSequence) throws MonomerException, NotationException, MonomerLoadingException, ChemistryException { if (null == peptideSequence) { throw new NotationException("Peptide Sequence must be specified"); } String cleanSeq = cleanup(pep...
java
public static List<String> getAminoAcidList(String peptideSequence, String delimiter) throws MonomerException, NotationException, MonomerLoadingException, ChemistryException { if (null == peptideSequence) { throw new NotationException("Peptide Sequence must be specified"); } i...
java
public static String cleanup(String sequence) { String result = sequence.replaceAll("\\s", ""); // remove all white // space if (result.equals(result.toLowerCase())) { result = result.toUpperCase(); } return result; }
java
public static void downloadFile(final String fileUrl, final String localFile) throws IOException { final URL url = new URL(fileUrl); final HttpURLConnection connection = (HttpURLConnection) url.openConnection(); final byte[] data = JKIOUtil.readStream(connection.getInputStream()); JKIOUtil.writeBytesToFile(data...
java
public static File downloadFileToTemp(final String fileUrl, final String ext) throws IOException { final File file = File.createTempFile("jk-", ext); JKHttpUtil.downloadFile(fileUrl, file.getAbsolutePath()); return file; }
java
public static String requestUrl(final String url, final String method, final Properties header, final String body) { try { final URL siteUrl = new URL(url); final HttpURLConnection connection = (HttpURLConnection) siteUrl.openConnection(); connection.setRequestMethod(method); final Enumeration<?> keys = h...
java
public static String getUrlContents(String urlString) { HttpURLConnection con = null; try { URL url = new URL(urlString); con = (HttpURLConnection) url.openConnection(); con.connect(); InputStream inputStream = con.getInputStream(); BufferedReader reader = new BufferedReader(new InputStreamReader(in...
java
public static String getValueFromUrl(String url, String preText, int length) { String urlContents = getUrlContents(url); int indexOf = urlContents.indexOf(preText); if (indexOf != -1) { indexOf += preText.length(); String substring = urlContents.substring(indexOf, indexOf + length); return substring; }...
java
public static InputStream getUrlInputStream(String urlString) { URL url; try { url = new URL(urlString); HttpURLConnection con = (HttpURLConnection) url.openConnection(); con.connect(); return con.getInputStream(); } catch (Exception e) { throw new JKException(e); } }
java
public static <T> T readUrlAsObject(String url, Class<T> type) { String contents = getUrlContents(url); ObjectMapper mapper = new ObjectMapper(); mapper.enableDefaultTyping(); try { return mapper.readValue(contents, type); } catch (IOException e) { JK.throww(e); return null; } }
java
public static Password createPassword(char[] password) { byte[] salt = JKSecurityUtil.salt(); byte[] hash = JKSecurityUtil.hash(password, salt); Password pass = new Password(); pass.setHash(encodeInToBase64(hash)); pass.setSalt(encodeInToBase64(salt)); return pass; }
java
public Class<?> getJavaType() { if(javaType==null) { javaType=JKTypeMapping.getType(getCode()).getClass(); if(javaType==null) { JK.error("JKType cannot by null, and code not avaiable %s",code); } } return javaType; }
java
public String getName() { if (name == null) { name = JKMessage.get(getJavaType().getSimpleName()); } return name; }
java
public JKTimeObject toTimeObject(Date date, Date time) { JKTimeObject fsTimeObject = new JKTimeObject(); Calendar timeInstance = Calendar.getInstance(); timeInstance.setTimeInMillis(time.getTime()); fsTimeObject.setHour(timeInstance.get(Calendar.HOUR_OF_DAY)); fsTimeObject.setMunite(timeInstance.get(Calendar....
java
public static RgroupStructure buildMoleculefromSinglePolymer(final PolymerNotation polymernotation) throws BuilderMoleculeException, HELM2HandledException, ChemistryException { LOG.info("Build molecule for single Polymer " + polymernotation.getPolymerID().getId()); /* Case 1: BLOB -> throw exception */ i...
java
private static RgroupStructure buildMoleculefromCHEM(final String id, final List<Monomer> validMonomers) throws BuilderMoleculeException, ChemistryException { LOG.info("Build molecule for chemical component"); /* a chemical molecule should only contain one monomer */ if (validMonomers.size() == 1) { ...
java
private static AttachmentList generateAttachmentList(final List<Attachment> listAttachments) { AttachmentList list = new AttachmentList(); for (Attachment attachment : listAttachments) { list.add(new org.helm.chemtoolkit.Attachment(attachment.getAlternateId(), attachment.getLabel(), attachment.getCap...
java
public static AbstractMolecule mergeRgroups(AbstractMolecule molecule) throws BuilderMoleculeException, ChemistryException { try { boolean flag = true; // while (flag) { // if (molecule.getAttachments().size() > 0) { for (int i = molecule.getAttachments().size() - 1; i > -1; i--) { ...
java
public static AbstractMolecule getMoleculeForMonomer(final Monomer monomer) throws BuilderMoleculeException, ChemistryException { String input = getInput(monomer); if (input != null) { List<Attachment> listAttachments = monomer.getAttachmentList(); AttachmentList list = new AttachmentList(); ...
java
void addEntry(final String aLine) { final String trimmed = aLine.replaceAll("^>*", ""); String[] tokens = trimmed.split("\t"); // Now strip the empty entries final Vector<String> v = new Vector<String>(); for (int i = 0; i < tokens.length; i++) { if (!"".equals(tokens[i])) { v.add(tokens[i]); } }...
java
public String getMatch(final byte[] content) throws IOException { final ByteBuffer buf = readBuffer(content); if (buf == null) { return null; } buf.position(0); final boolean matches = match(buf); if (matches) { final int subLen = this.subEntries.size(); final String myMimeType = getMimeType(); ...
java
private int howManyGreaterThans(final String aLine) { if (aLine == null) { return -1; } int i = 0; final int len = aLine.length(); while (i < len) { if (aLine.charAt(i) == '>') { i++; } else { break; } } return i; }
java
private boolean matchByte(final ByteBuffer bbuf) throws IOException { final byte b = bbuf.get(0); return b == getContent().charAt(0); }
java
private boolean matchLong(final ByteBuffer bbuf, final ByteOrder bo, final boolean needMask, final long lMask) throws IOException { bbuf.order(bo); long got; final String testContent = getContent(); if (testContent.startsWith("0x")) { got = Long.parseLong(testContent.substring(2), 16); } else if (testConte...
java
private boolean matchShort(final ByteBuffer bbuf, final ByteOrder bo, final boolean needMask, final short sMask) throws IOException { bbuf.order(bo); short got; final String testContent = getContent(); if (testContent.startsWith("0x")) { got = (short) Integer.parseInt(testContent.substring(2), 16); } else ...
java
private boolean matchString(final ByteBuffer bbuf) throws IOException { if (this.isBetween) { final String buffer = new String(bbuf.array()); if (buffer.contains(getContent())) { return true; } return false; } final int read = getContent().length(); for (int j = 0; j < read; j++) { if ((bbuf....
java
@SuppressWarnings("unused") private ByteBuffer readBuffer(final RandomAccessFile raf) throws IOException { final int startPos = getCheckBytesFrom(); if (startPos > raf.length()) { return null; } raf.seek(startPos); ByteBuffer buf; switch (getType()) { case MagicMimeEntry.STRING_TYPE: { int len = 0;...
java
public void traverseAndPrint(final String tabs) { logger.info(tabs + toString()); final int len = this.subEntries.size(); for (int i = 0; i < len; i++) { final MagicMimeEntry me = this.subEntries.get(i); me.traverseAndPrint(tabs + "\t"); } }
java
public void addEmptyValue(final JKTableColumn col) { final JKTableColumnValue value = new JKTableColumnValue(col); this.columnsValues.add(value); }
java
public Double getColumnValueAsDouble(final int col, final double defaultValue) { Double value = getColumnValueAsDouble(col); if (value == null) { value = defaultValue; } return value; }
java
public static String getSMILESForAll(HELM2Notation helm2notation) throws BuilderMoleculeException, CTKException, ChemistryException { /* Build Molecues */ LOG.debug("Build single molecule(s)"); List<AbstractMolecule> molecules = BuilderMolecule.buildMoleculefromPolymers(helm2notation.getListOfPolymers(), ...
java
public static boolean containsGenericStructurePolymer(List<PolymerNotation> polymers) throws HELM2HandledException, ChemistryException, IOException, CTKException { for (PolymerNotation polymer : polymers) { if (polymer.getPolymerID() instanceof ChemEntity) { Monomer monomer = MethodsMonomerUtils ...
java
public static String getCanonicalSMILESForPolymer(PolymerNotation polymer) throws BuilderMoleculeException, HELM2HandledException, CTKSmilesException, CTKException, NotationException, ChemistryException { AbstractMolecule molecule = BuilderMolecule.buildMoleculefromSinglePolymer(polymer).getMolecule(); molecu...
java
public static String convertMolToSMILESWithAtomMapping(String molfile, List<Attachment> attachments) throws CTKException, ChemistryException { String smiles = Chemistry.getInstance().getManipulator().convertMolIntoSmilesWithAtomMapping(molfile); for (Attachment attachment : attachments) { int r = Inte...
java
public static boolean isConnected(String molfile) throws CTKException, ChemistryException { return Chemistry.getInstance().getManipulator().isConnected(molfile); }
java
protected static CloseableHttpResponse putResource(String json, String fullURL) throws ClientProtocolException, IOException, URISyntaxException { try (CloseableHttpClient httpclient = HttpClients.createDefault()) { // There is no need to provide user credentials // HttpClient will attempt to a...
java
protected static CloseableHttpResponse getResource(String fullURL) throws IOException, URISyntaxException { URI uri = new URIBuilder(fullURL).build(); try (CloseableHttpClient httpclient = HttpClients.createDefault()) { /* read url */ HttpGet httpget = new HttpGet(uri); LOG.debug...
java
public static String getXHELM(HELM2Notation helm2notation) throws MonomerException, HELM1FormatException, IOException, JDOMException, NotationException, CTKException, ValidationException, ChemistryException { set = new HashSet<Monomer>(); Element root = new Element(xHelmNotationExporter.XHELM_ELEMENT);...
java
private static void addAdHocMonomer(MonomerNotation monomerNotation) throws IOException, JDOMException, ChemistryException { Monomer monomer = MonomerFactory.getInstance().getMonomerStore().getMonomer(monomerNotation.getType(), monomerNotation.getUnit().replace("[", "").replace("]", "")); if (monomer.isAdHocM...
java
private List<Attachment> deserializeAttachmentList(JsonParser parser, Map<String, Attachment> attachmentDB) throws JsonParseException, IOException { List<Attachment> attachments = new ArrayList<Attachment>(); Attachment currentAttachment = null; while (!JsonToken.END_ARRAY.equals(parser.nextToken())) { ...
java
private static List<CategorizedMonomer> deserializeEditorCategorizationConfig(JsonParser parser) throws JsonParseException, IOException { List<CategorizedMonomer> config = new LinkedList<CategorizedMonomer>(); CategorizedMonomer currentMonomer = null; parser.nextToken(); while (parser.hasCurrentToken(...
java
public static Attachment getAttachment(Element attachment) { Namespace ns = attachment.getNamespace(); Attachment att = new Attachment(); att.setAlternateId(attachment.getChildText(ATTACHEMENT_ID_ELEMENT, ns)); att.setLabel(attachment.getChildText(ATTACHEMENT_LABEL_ELEMENT, ns)); att.setCap...
java
public static Element getAttachementElement(Attachment att) { Element attachment = new Element(ATTACHEMENT_ELEMENT); if (null != att.getAlternateId() && att.getAlternateId().length() > 0) { Element e = new Element(ATTACHEMENT_ID_ELEMENT); e.setText(att.getAlternateId()); attachment.ge...
java
public static boolean validateAttachement(Attachment attachment) throws MonomerException, IOException, ChemistryException { String alternateId = attachment.getAlternateId(); if (null == alternateId) { throw new MonomerException("Attachment must have unique ID"); } String smiles = a...
java
public static Monomer getMonomer(Element monomer) throws MonomerException { Monomer m = new Monomer(); Namespace ns = monomer.getNamespace(); m.setAlternateId(monomer.getChildText(MONOMER_ID_ELEMENT, ns)); m.setCanSMILES(monomer.getChildText(MONOMER_SMILES_ELEMENT, ns)); String encodedMolfile =...
java
public static Element getMonomerElement(Monomer monomer) throws MonomerException { Element element = new Element(MONOMER_ELEMENT); if (null != monomer.getAlternateId()) { Element e = new Element(MONOMER_ID_ELEMENT); e.setText(monomer.getAlternateId()); element.getChildren().add(e...
java
private static boolean areAttachmentLabelsUnique(List<String> labels) { Map<String, String> map = new TreeMap<String, String>(String.CASE_INSENSITIVE_ORDER); for (int i = 0; i < labels.size(); i++) { map.put(labels.get(i), labels.get(i)); } if (labels.size() == map.size()) { return tru...
java
public Attachment getAttachment(String label) { for (Attachment attachment : attachmentList) { if (attachment.getLabel().equalsIgnoreCase(label)) { return attachment; } } return null; }
java
public MoleculeProperty getCapMoleculeInfo(String label) throws CTKException, ChemistryException, IOException { for (Attachment attachment : attachmentList) { if (attachment.getLabel().equalsIgnoreCase(label)) { String capSmi = attachment.getCapGroupSMILES(); org.helm.chemtoolkit.Molec...
java
public boolean addAttachment(Attachment attachment) { boolean isExist = false; for (Attachment a : attachmentList) { if (a.getLabel().equalsIgnoreCase(attachment.getLabel())) { isExist = true; } } if (!isExist) { return attachmentList.add(attachment); } return false; ...
java
public static JKCacheManager getCacheManager() { if (JKCacheFactory.defaultCacheManager == null) { logger.debug("init cacheManager"); defaultCacheManager = new JKDefaultCacheManager(); } return JKCacheFactory.defaultCacheManager; }
java
public JKTableColumn getTableColumn(final int col, final boolean visibleIndex) { int actualIndex; if (visibleIndex) { actualIndex = this.visibilityManager.getActualIndexFromVisibleIndex(col); } else { actualIndex = col; } return this.tableColumns.get(actualIndex); }
java
public int getValueAtAsInteger(final int row, final int col) { final Object valueAt = getValueAt(row, col); int number = 0; if (valueAt != null && !valueAt.toString().equals("")) { number = Integer.parseInt(valueAt.toString().trim()); } return number; }
java
public boolean isEditable(final int row, final int column) { if (isEditable(column)) { final int actualIndex = getTableColumn(column).getIndex(); final JKTableRecord record = getRecord(row); return record.isColumnEnabled(actualIndex); } return false; }
java
public void setEditable(final int row, final int col, final boolean enable) { final int actualIndex = getTableColumn(col).getIndex(); getRecord(row).setColumnEnabled(actualIndex, enable); }
java
public void addJKTableColumn(String keyLabel) { JKTableColumn col = new JKTableColumn(); col.setName(keyLabel); addJKTableColumn(col); }
java
public void insertConstructor(InsertableConstructor insertableConstructor) throws CannotCompileException, AfterBurnerImpossibleException, NotFoundException { // create or complete onViewCreated List<CtConstructor> constructorList = extractExistingConstructors(insertableConstructor); log.info...
java
protected ValidationResult getCachedResult(String certFingerprint) { CachedValidationResult cvr = validationResultsCache.get(certFingerprint); if (cvr == null) return null; if (!cachedValidationResultHasExpired(cvr, System.currentTimeMillis())) { return cvr.getResult(); } validationR...
java
public ValidationResult validate(X509Certificate[] certChain) { certChainSanityChecks(certChain); String certFingerprint = null; try { certFingerprint = FingerprintHelper .getFingerprint(certChain[certChain.length - 1]); } catch (Throwable t) { String errorMsg = String.format("E...
java
public int minChannel() { int c = 0; if(getValue(c) > getValue(1)) c=1; if(getValue(c) > getValue(2)) c=2; return c; }
java
public int maxChannel() { int c = 0; if(getValue(c) < getValue(1)) c=1; if(getValue(c) < getValue(2)) c=2; return c; }
java
public JsTopicControls getJsTopicControlsFromProxyClass(Class<?> proxy) { Class<?> realClass = unProxyClassServices.getRealClass(proxy); return realClass.getAnnotation(JsTopicControls.class); }
java
public void readStacktraceConfig(@Observes @Initialized(ApplicationScoped.class) ServletContext sc) { String stacktrace; if(ocelotConfigurationsStack.isUnsatisfied()) { stacktrace = sc.getInitParameter(Constants.Options.STACKTRACE_LENGTH); if(stacktrace==null) { stacktrace = DEFAULTSTACKTRACE; } ...
java
public static String generateBasepath(final String ip, Short port) { if (isEmpty(ip)) { throw new IllegalArgumentException(NULL_SERVER_IP_MSG); } if (port == null) { port = 80; } StringBuilder basePath = new StringBuilder(); basePath.append("http:/...
java
@Override public Object convertJsonToJava(String jsonArg, Type paramType, Annotation[] parameterAnnotations) throws JsonUnmarshallingException, JsonMarshallerException { if ("null".equals(jsonArg)) { return null; } JsonUnmarshaller juma = getJsonUnmarshallerAnnotation(parameterAnnotations); if (null !...
java
JsonUnmarshaller getJsonUnmarshallerAnnotation(Annotation[] annotations) { for (Annotation annotation : annotations) { if (JsonUnmarshaller.class.isInstance(annotation)) { return (JsonUnmarshaller) annotation; } } return null; }
java
Class<? extends IJsonMarshaller> getMarshallerAnnotation(Annotation[] annotations) { JsonUnmarshaller ju = getJsonUnmarshallerAnnotation(annotations); return (ju != null) ? ju.value() : null; }
java
Object convertArgument(String arg, Type paramType) throws IllegalArgumentException { Object result = null; if (null == arg || "null".equals(arg)) { return result; } logger.debug("Try to convert {} : param = {} : {}", new Object[]{arg, paramType, paramType.getClass()}); try { // GenericArrayType, Para...
java
void checkStringArgument(Class cls, String arg) throws IOException { if (arg.startsWith(Constants.QUOTE)) { // ca ressemble à une string if (!cls.equals(String.class)) { // et on veut pas une string throw new IOException(); } } else // ca ressemble pas à une string if (cls.equals(String.class)) {...
java
private void compareApiUsage() throws ApiException, JsonProcessingException { LOG.info("The Compare API usage."); Compare compareApiInstance = retinaApisInstance.compareApi(); LOG.info("Compare API: compare"); Metric metric = compareApiInstance.compare(new Term("apple"), new Ter...
java
private void imageApiUsage() throws ApiException, IOException { LOG.info("The Image API usage."); Images api = retinaApisInstance.imageApi(); LOG.info("Image API: getImageForExpression"); try (ByteArrayInputStream inputStream = api.getImage(TEXT_1)) { //get ...
java
private void retinasApiUsage() throws ApiException { LOG.info("The Retinas API usage."); Retinas api = getInfo("api.cortical.io", API_KEY); LOG.info("Retinas API: getRetinas"); List<Retina> retinas = api.getAllRetinas(); for (Retina retina : retinas) { ...
java
private void termsApiUsage() throws JsonProcessingException, ApiException { /** * */ LOG.info("The Terms API usage."); Terms api = retinaApisInstance.termsApi(); /** * */ LOG.info("Terms API: getContextsForTerm"); List<Context> contex...
java
private void textApiUsage() throws ApiException, JsonProcessingException { /** * */ String text = "Toll IPEC has been an industry leader in environmental sustainability through its purchase of compressed natural gas powered trucks"; String text2 = ...
java
public void doEvents() { while (!isInterrupted()) { Iterator<Map.Entry<Timer, Runnable>> it = timerMap.entrySet().iterator(); if (it.hasNext()) { long timeout = it.next().getKey().uptime - System.currentTimeMillis(); doEvents(timeout > 0 ? timeout : 0); } else { doEvents(-1); } } ...
java
public <T> T getField(String field, ExtensionFieldType<T> extensionFieldType) { if (field == null || field.isEmpty()) { throw new IllegalArgumentException("Invalid field name"); } if (extensionFieldType == null) { throw new IllegalArgumentException("Invalid field type"); ...
java
protected List getProjectClasspathElements() throws DependencyResolutionRequiredException { Set results = new LinkedHashSet(); Set includes = getClasspathIncludes(); if (includes.contains(CLASSPATH_INCLUDE_ALL) || includes.contains(CLASSPATH_INCLUDE_RUNTIME)) { for (Iterator i = pr...
java
private Map findProviders() { Map providers = getContainer().getComponentDescriptorMap(Provider.class.getName()); if (providers == null) { throw new Error("No providers discovered"); } Set keys = providers.keySet(); Map found = null; for (Iterator iter = key...
java
void writeDependencies(Writer writer, String deco, String... dependencies) throws IOException { boolean first = true; for (String dependency : dependencies) { if (!first) { writer.append(COMMA).append(SPACEOPTIONAL); } writer.append(deco).append(dependency).append(deco); first = false; } }
java
public void writeCloseFunction(Writer writer) throws IOException { writer.append(TAB).append(CLOSEBRACE).append(CR); }
java
void writeArguments(Iterator<String> names, Writer writer) throws IOException { while(names.hasNext()) { String name = names.next(); writer.append(name); // argname if(names.hasNext()) { writer.append(COMMA).append(SPACEOPTIONAL); //, } } }
java
void writeReturnComment(TypeMirror returnType, Writer writer) throws IOException { String type = returnType.toString(); if (!"void".equals(type)) { writer.append(TAB2).append(" * @return ").append(OPENBRACE).append(type).append(CLOSEBRACE).append(CR); } }
java
void writeArgumentsComment(Iterator<String> argumentsType, Iterator<String> argumentsName, Writer writer) throws IOException { while(argumentsType.hasNext()) { String type = argumentsType.next(); String name = argumentsName.next(); writer.append(TAB2).append(" * @param ").append(OPENBRACE).append(type).a...
java
void writeJavadocComment(String methodComment, Writer writer) throws IOException { // From javadoc if (methodComment != null) { methodComment = methodComment.split("@")[0]; int lastIndexOf = methodComment.lastIndexOf("\n"); if (lastIndexOf >= 0) { methodComment = methodComment.substring(0, lastIn...
java
void createMethodBody(String classname, ExecutableElement methodElement, List<String> arguments, Writer writer) throws IOException { String methodName = getMethodName(methodElement); boolean ws = isWebsocketDataService(methodElement); String args = stringJoinAndDecorate(arguments, COMMA, new NothingDecorator()...
java
String computeKeys(ExecutableElement methodElement, List<String> arguments) { String keys = stringJoinAndDecorate(arguments, COMMA, new NothingDecorator()); if (arguments != null && !arguments.isEmpty()) { JsCacheResult jcr = methodElement.getAnnotation(JsCacheResult.class); // if there is a jcr annotatio...
java
void createReturnOcelotPromiseFactory(String classname, String methodName, boolean ws, String args, String keys, Writer writer) throws IOException { String md5 = keyMaker.getMd5(classname + DOT + methodName); writer.append(TAB3).append("return promiseFactory.create").append(OPENPARENTHESIS).append("_ds").append(C...
java
String stringJoinAndDecorate(final List<String> list, final String sep, StringDecorator decorator) { if (decorator == null) { decorator = new NothingDecorator(); } StringBuilder sb = new StringBuilder(); if (list != null) { boolean first = true; for (String argument : list) { if (!first) { ...
java