repo_name
stringlengths
7
104
file_path
stringlengths
13
198
context
stringlengths
67
7.15k
import_statement
stringlengths
16
4.43k
code
stringlengths
40
6.98k
prompt
stringlengths
227
8.27k
next_line
stringlengths
8
795
fireshort/spring-boot-quickstart
src/test/functional/org/springside/examples/quickstart/functional/gui/TaskGuiFT.java
// Path: src/test/java/org/springside/examples/quickstart/data/TaskData.java // public class TaskData { // // public static Task randomTask() { // Task task = new Task(); // task.setTitle(randomTitle()); // User user = new User(1L); // task.setUser(user); // return task; // } // // public static String r...
import static org.assertj.core.api.Assertions.*; import org.junit.Test; import org.junit.experimental.categories.Category; import org.openqa.selenium.By; import org.openqa.selenium.WebElement; import org.springside.examples.quickstart.data.TaskData; import org.springside.examples.quickstart.entity.Task; import org.spri...
/******************************************************************************* * Copyright (c) 2005, 2014 springside.github.io * * Licensed under the Apache License, Version 2.0 (the "License"); *******************************************************************************/ package org.springside.examples.quicks...
// Path: src/test/java/org/springside/examples/quickstart/data/TaskData.java // public class TaskData { // // public static Task randomTask() { // Task task = new Task(); // task.setTitle(randomTitle()); // User user = new User(1L); // task.setUser(user); // return task; // } // // public static String r...
Task task = TaskData.randomTask();
fireshort/spring-boot-quickstart
src/test/functional/org/springside/examples/quickstart/functional/gui/TaskGuiFT.java
// Path: src/test/java/org/springside/examples/quickstart/data/TaskData.java // public class TaskData { // // public static Task randomTask() { // Task task = new Task(); // task.setTitle(randomTitle()); // User user = new User(1L); // task.setUser(user); // return task; // } // // public static String r...
import static org.assertj.core.api.Assertions.*; import org.junit.Test; import org.junit.experimental.categories.Category; import org.openqa.selenium.By; import org.openqa.selenium.WebElement; import org.springside.examples.quickstart.data.TaskData; import org.springside.examples.quickstart.entity.Task; import org.spri...
/******************************************************************************* * Copyright (c) 2005, 2014 springside.github.io * * Licensed under the Apache License, Version 2.0 (the "License"); *******************************************************************************/ package org.springside.examples.quicks...
// Path: src/test/java/org/springside/examples/quickstart/data/TaskData.java // public class TaskData { // // public static Task randomTask() { // Task task = new Task(); // task.setTitle(randomTitle()); // User user = new User(1L); // task.setUser(user); // return task; // } // // public static String r...
Task task = TaskData.randomTask();
fireshort/spring-boot-quickstart
src/main/java/org/springside/examples/quickstart/rest/TaskRestController.java
// Path: src/main/java/org/springside/examples/quickstart/entity/Task.java // @Entity // @Table(name = "ss_task") // public class Task extends IdEntity { // // private String title; // private String description; // private User user; // // // JSR303 BeanValidator的校验规则 // @NotBlank // public String getTitle() {...
import org.springside.examples.quickstart.entity.Task; import org.springside.examples.quickstart.service.task.TaskService; import org.slf4j.Logger; import org.slf4j.LoggerFactory; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.http.HttpHeaders; import org.springframework.http....
/******************************************************************************* * Copyright (c) 2005, 2014 springside.github.io * * Licensed under the Apache License, Version 2.0 (the "License"); *******************************************************************************/ package org.springside.examples.quicks...
// Path: src/main/java/org/springside/examples/quickstart/entity/Task.java // @Entity // @Table(name = "ss_task") // public class Task extends IdEntity { // // private String title; // private String description; // private User user; // // // JSR303 BeanValidator的校验规则 // @NotBlank // public String getTitle() {...
private TaskService taskService;
fireshort/spring-boot-quickstart
src/main/java/org/springside/examples/quickstart/rest/TaskRestController.java
// Path: src/main/java/org/springside/examples/quickstart/entity/Task.java // @Entity // @Table(name = "ss_task") // public class Task extends IdEntity { // // private String title; // private String description; // private User user; // // // JSR303 BeanValidator的校验规则 // @NotBlank // public String getTitle() {...
import org.springside.examples.quickstart.entity.Task; import org.springside.examples.quickstart.service.task.TaskService; import org.slf4j.Logger; import org.slf4j.LoggerFactory; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.http.HttpHeaders; import org.springframework.http....
/******************************************************************************* * Copyright (c) 2005, 2014 springside.github.io * * Licensed under the Apache License, Version 2.0 (the "License"); *******************************************************************************/ package org.springside.examples.quicks...
// Path: src/main/java/org/springside/examples/quickstart/entity/Task.java // @Entity // @Table(name = "ss_task") // public class Task extends IdEntity { // // private String title; // private String description; // private User user; // // // JSR303 BeanValidator的校验规则 // @NotBlank // public String getTitle() {...
public List<Task> list() {
fireshort/spring-boot-quickstart
src/test/functional/org/springside/examples/quickstart/functional/BaseFunctionalTestCase.java
// Path: src/test/java/org/springside/modules/test/spring/Profiles.java // public class Profiles { // // public static final String ACTIVE_PROFILE = "spring.profiles.active"; // public static final String DEFAULT_PROFILE = "spring.profiles.default"; // // public static final String PRODUCTION = "production"; // p...
import java.net.URL; import java.sql.Driver; import org.eclipse.jetty.server.Server; import org.junit.BeforeClass; import org.slf4j.Logger; import org.slf4j.LoggerFactory; import org.springframework.jdbc.datasource.SimpleDriverDataSource; import org.springside.examples.quickstart.QuickStartServer; import org.springside...
/******************************************************************************* * Copyright (c) 2005, 2014 springside.github.io * * Licensed under the Apache License, Version 2.0 (the "License"); *******************************************************************************/ package org.springside.examples.quicks...
// Path: src/test/java/org/springside/modules/test/spring/Profiles.java // public class Profiles { // // public static final String ACTIVE_PROFILE = "spring.profiles.active"; // public static final String DEFAULT_PROFILE = "spring.profiles.default"; // // public static final String PRODUCTION = "production"; // p...
Profiles.setProfileAsSystemProperty(Profiles.FUNCTIONAL_TEST);
fireshort/spring-boot-quickstart
src/main/java/org/springside/examples/quickstart/jms/NotifyMessageProducer.java
// Path: src/main/java/org/springside/examples/quickstart/entity/User.java // @Entity // @Table(name = "ss_user") // public class User extends IdEntity implements Serializable { // private String loginName; // private String name; // private String plainPassword; // private String password; // private String salt;...
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.jms.core.JmsTemplate; import org.springframework.stereotype.Component; import org.springside.examples.quickstart.entity.User; import javax.annotation.Resource; import javax.jms.Destination; import java.util.HashMap; import java.ut...
/******************************************************************************* * Copyright (c) 2005, 2014 springside.github.io * <p/> * Licensed under the Apache License, Version 2.0 (the "License"); *******************************************************************************/ package org.springside.examples.q...
// Path: src/main/java/org/springside/examples/quickstart/entity/User.java // @Entity // @Table(name = "ss_user") // public class User extends IdEntity implements Serializable { // private String loginName; // private String name; // private String plainPassword; // private String password; // private String salt;...
public void sendQueue(final User user) {
gunblues/strophe-openfire-websocket
openfire-websockets/src/com/ifsoft/websockets/servlet/XMPPServlet.java
// Path: openfire-websockets/src/com/ifsoft/websockets/plugin/WebSocketsPlugin.java // public class WebSocketsPlugin implements Plugin { // // private static Logger Log = LoggerFactory.getLogger("WebSocketsPlugin"); // private static final String NAME = "ws"; // private static final String DESCRIPTION = "Web...
import org.jivesoftware.util.JiveGlobals; import org.slf4j.Logger; import org.slf4j.LoggerFactory; import java.io.IOException; import java.security.*; import java.util.*; import java.text.*; import java.net.*; import java.security.cert.Certificate; import java.util.concurrent.ConcurrentHashMap; import java.ma...
package com.ifsoft.websockets.servlet; public final class XMPPServlet extends WebSocketServlet { private static Logger Log = LoggerFactory.getLogger( "XMPPServlet" ); private ConcurrentHashMap<String, XMPPServlet.XMPPWebSocket> sockets; private String remoteAddr;
// Path: openfire-websockets/src/com/ifsoft/websockets/plugin/WebSocketsPlugin.java // public class WebSocketsPlugin implements Plugin { // // private static Logger Log = LoggerFactory.getLogger("WebSocketsPlugin"); // private static final String NAME = "ws"; // private static final String DESCRIPTION = "Web...
private WebSocketsPlugin plugin;
harryaskham/Twitter-L-LDA
liwc/LIWCWord.java
// Path: types/Category.java // public class Category implements Serializable { // // private static final long serialVersionUID = -3033274268834147218L; // private String title; // private Set<String> words; // private int LIWCID; // // public Category(String title) { // this.title = title; // wo...
import java.io.Serializable; import java.util.HashSet; import java.util.Set; import uk.ac.cam.ha293.tweetlabel.types.Category;
package uk.ac.cam.ha293.tweetlabel.liwc; public class LIWCWord implements Serializable, Comparable<LIWCWord> { private static final long serialVersionUID = 1226473677648649283L; private String word;
// Path: types/Category.java // public class Category implements Serializable { // // private static final long serialVersionUID = -3033274268834147218L; // private String title; // private Set<String> words; // private int LIWCID; // // public Category(String title) { // this.title = title; // wo...
private Set<Category> categories;
harryaskham/Twitter-L-LDA
twitter/RawProfile.java
// Path: types/Document.java // public class Document implements Serializable { // // private static final long serialVersionUID = -3396519504581827961L; // // private long id; //ie twitter user id! duh // private String documentString; // private Set<String> topics; // // public Document() { // do...
import java.io.FileNotFoundException; import java.io.FileOutputStream; import java.io.IOException; import java.io.ObjectOutputStream; import java.io.PrintWriter; import java.io.Serializable; import java.util.ArrayList; import java.util.HashSet; import java.util.List; import java.util.Set; import twitter4j.Sta...
e.printStackTrace(); } } public void saveAsSimpleProfile() { if(userID == -1) { System.err.println("Cannot save as simple profile, no UID set for RawProfile"); return; } SimpleProfile simple = new SimpleProfile(userID); for(Status tweet : tweets) { SimpleTweet simpleTweet = new Simp...
// Path: types/Document.java // public class Document implements Serializable { // // private static final long serialVersionUID = -3396519504581827961L; // // private long id; //ie twitter user id! duh // private String documentString; // private Set<String> topics; // // public Document() { // do...
public Set<Document> asDocumentSet() {
dwdyer/uncommons-maths
demo/src/java/main/org/uncommons/maths/demo/UniformDistribution.java
// Path: core/src/java/main/org/uncommons/maths/random/DiscreteUniformGenerator.java // public class DiscreteUniformGenerator implements NumberGenerator<Integer> // { // private final Random rng; // private final int range; // private final int minimumValue; // // public DiscreteUniformGenerator(int mi...
import java.util.HashMap; import java.util.Map; import java.util.Random; import org.uncommons.maths.random.DiscreteUniformGenerator;
// ============================================================================ // Copyright 2006-2012 Daniel W. Dyer // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. // You may obtain a copy of the License at // // h...
// Path: core/src/java/main/org/uncommons/maths/random/DiscreteUniformGenerator.java // public class DiscreteUniformGenerator implements NumberGenerator<Integer> // { // private final Random rng; // private final int range; // private final int minimumValue; // // public DiscreteUniformGenerator(int mi...
protected DiscreteUniformGenerator createValueGenerator(Random rng)
dwdyer/uncommons-maths
core/src/java/main/org/uncommons/maths/random/ExponentialGenerator.java
// Path: core/src/java/main/org/uncommons/maths/number/ConstantGenerator.java // public class ConstantGenerator<T extends Number> implements NumberGenerator<T> // { // private final T constant; // // /** // * Creates a number generator that always returns the same // * values. // * @param consta...
import java.util.Random; import org.uncommons.maths.number.ConstantGenerator; import org.uncommons.maths.number.NumberGenerator;
// ============================================================================ // Copyright 2006-2012 Daniel W. Dyer // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. // You may obtain a copy of the License at // // h...
// Path: core/src/java/main/org/uncommons/maths/number/ConstantGenerator.java // public class ConstantGenerator<T extends Number> implements NumberGenerator<T> // { // private final T constant; // // /** // * Creates a number generator that always returns the same // * values. // * @param consta...
this(new ConstantGenerator<Double>(rate), rng);
dwdyer/uncommons-maths
demo/src/java/main/org/uncommons/maths/demo/RandomDemo.java
// Path: demo/src/java/main/org/uncommons/swing/SwingBackgroundTask.java // public abstract class SwingBackgroundTask<V> // { // // Used to assign thread IDs to make threads easier to identify when debugging. // private static int instanceCount = 0; // // private final CountDownLatch latch = new CountDownL...
import java.awt.BorderLayout; import java.awt.Cursor; import java.awt.Dimension; import java.awt.event.ActionEvent; import java.awt.event.ActionListener; import java.util.Map; import javax.swing.Box; import javax.swing.BoxLayout; import javax.swing.JButton; import javax.swing.JComponent; import javax.swing.JFrame; impo...
// ============================================================================ // Copyright 2006-2012 Daniel W. Dyer // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. // You may obtain a copy of the License at // // h...
// Path: demo/src/java/main/org/uncommons/swing/SwingBackgroundTask.java // public abstract class SwingBackgroundTask<V> // { // // Used to assign thread IDs to make threads easier to identify when debugging. // private static int instanceCount = 0; // // private final CountDownLatch latch = new CountDownL...
new SwingBackgroundTask<GraphData>()
dwdyer/uncommons-maths
demo/src/java/main/org/uncommons/maths/demo/GaussianDistribution.java
// Path: core/src/java/main/org/uncommons/maths/random/GaussianGenerator.java // public class GaussianGenerator implements NumberGenerator<Double> // { // private final Random rng; // private final NumberGenerator<Double> mean; // private final NumberGenerator<Double> standardDeviation; // // // /** /...
import java.util.HashMap; import java.util.Map; import java.util.Random; import org.uncommons.maths.random.GaussianGenerator;
// ============================================================================ // Copyright 2006-2012 Daniel W. Dyer // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. // You may obtain a copy of the License at // // h...
// Path: core/src/java/main/org/uncommons/maths/random/GaussianGenerator.java // public class GaussianGenerator implements NumberGenerator<Double> // { // private final Random rng; // private final NumberGenerator<Double> mean; // private final NumberGenerator<Double> standardDeviation; // // // /** /...
protected GaussianGenerator createValueGenerator(Random rng)
dwdyer/uncommons-maths
core/src/java/main/org/uncommons/maths/random/PoissonGenerator.java
// Path: core/src/java/main/org/uncommons/maths/number/ConstantGenerator.java // public class ConstantGenerator<T extends Number> implements NumberGenerator<T> // { // private final T constant; // // /** // * Creates a number generator that always returns the same // * values. // * @param consta...
import java.util.Random; import org.uncommons.maths.number.ConstantGenerator; import org.uncommons.maths.number.NumberGenerator;
// ============================================================================ // Copyright 2006-2012 Daniel W. Dyer // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. // You may obtain a copy of the License at // // h...
// Path: core/src/java/main/org/uncommons/maths/number/ConstantGenerator.java // public class ConstantGenerator<T extends Number> implements NumberGenerator<T> // { // private final T constant; // // /** // * Creates a number generator that always returns the same // * values. // * @param consta...
this(new ConstantGenerator<Double>(mean), rng);
dwdyer/uncommons-maths
core/src/java/main/org/uncommons/maths/random/AESCounterRNG.java
// Path: core/src/java/main/org/uncommons/maths/binary/BinaryUtils.java // public final class BinaryUtils // { // // Mask for casting a byte to an int, bit-by-bit (with // // bitwise AND) with no special consideration for the sign bit. // private static final int BITWISE_BYTE_TO_INT = 0x000000FF; // //...
import java.security.GeneralSecurityException; import java.util.Arrays; import java.util.Random; import java.util.concurrent.locks.ReentrantLock; import javax.crypto.Cipher; import javax.crypto.SecretKey; import org.uncommons.maths.binary.BinaryUtils;
{ incrementCounter(); return cipher.doFinal(counter); } /** * {@inheritDoc} */ @Override protected final int next(int bits) { int result; try { lock.lock(); if (currentBlock == null || currentBlock.length - index < 4) ...
// Path: core/src/java/main/org/uncommons/maths/binary/BinaryUtils.java // public final class BinaryUtils // { // // Mask for casting a byte to an int, bit-by-bit (with // // bitwise AND) with no special consideration for the sign bit. // private static final int BITWISE_BYTE_TO_INT = 0x000000FF; // //...
result = BinaryUtils.convertBytesToInt(currentBlock, index);
dwdyer/uncommons-maths
demo/src/java/main/org/uncommons/maths/demo/ProbabilityDistribution.java
// Path: core/src/java/main/org/uncommons/maths/number/NumberGenerator.java // public interface NumberGenerator<T extends Number> // { // /** // * @return The next value from the generator. // */ // T nextValue(); // }
import java.util.HashMap; import java.util.Map; import java.util.Random; import org.uncommons.maths.number.NumberGenerator;
// ============================================================================ // Copyright 2006-2012 Daniel W. Dyer // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. // You may obtain a copy of the License at // // h...
// Path: core/src/java/main/org/uncommons/maths/number/NumberGenerator.java // public interface NumberGenerator<T extends Number> // { // /** // * @return The next value from the generator. // */ // T nextValue(); // } // Path: demo/src/java/main/org/uncommons/maths/demo/ProbabilityDistribution.java...
protected abstract NumberGenerator<?> createValueGenerator(Random rng);
dwdyer/uncommons-maths
core/src/java/main/org/uncommons/maths/random/GaussianGenerator.java
// Path: core/src/java/main/org/uncommons/maths/number/ConstantGenerator.java // public class ConstantGenerator<T extends Number> implements NumberGenerator<T> // { // private final T constant; // // /** // * Creates a number generator that always returns the same // * values. // * @param consta...
import java.util.Random; import org.uncommons.maths.number.ConstantGenerator; import org.uncommons.maths.number.NumberGenerator;
// ============================================================================ // Copyright 2006-2012 Daniel W. Dyer // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. // You may obtain a copy of the License at // // h...
// Path: core/src/java/main/org/uncommons/maths/number/ConstantGenerator.java // public class ConstantGenerator<T extends Number> implements NumberGenerator<T> // { // private final T constant; // // /** // * Creates a number generator that always returns the same // * values. // * @param consta...
this(new ConstantGenerator<Double>(mean),
dwdyer/uncommons-maths
demo/src/java/main/org/uncommons/maths/demo/ExponentialDistribution.java
// Path: core/src/java/main/org/uncommons/maths/random/ExponentialGenerator.java // public class ExponentialGenerator implements NumberGenerator<Double> // { // private final NumberGenerator<Double> rate; // private final Random rng; // // // /** // * Creates a generator of exponentially-distributed ...
import java.util.HashMap; import java.util.Map; import java.util.Random; import org.uncommons.maths.random.ExponentialGenerator;
// ============================================================================ // Copyright 2006-2012 Daniel W. Dyer // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. // You may obtain a copy of the License at // // h...
// Path: core/src/java/main/org/uncommons/maths/random/ExponentialGenerator.java // public class ExponentialGenerator implements NumberGenerator<Double> // { // private final NumberGenerator<Double> rate; // private final Random rng; // // // /** // * Creates a generator of exponentially-distributed ...
protected ExponentialGenerator createValueGenerator(Random rng)
strassl/Lampshade
lampshade/src/main/java/eu/prismsw/lampshade/providers/ArticleProvider.java
// Path: lampshade/src/main/java/eu/prismsw/lampshade/database/SavedArticlesHelper.java // public class SavedArticlesHelper extends SQLiteOpenHelper { // // public static final String TABLE_SAVED = "saved"; // public static final String TABLE_RECENT = "recent"; // public static final String TABLE_FAVORITE = ...
import android.content.ContentProvider; import android.content.ContentValues; import android.content.UriMatcher; import android.database.Cursor; import android.database.sqlite.SQLiteDatabase; import android.database.sqlite.SQLiteQueryBuilder; import android.net.Uri; import android.text.TextUtils; import eu.prismsw.lamp...
package eu.prismsw.lampshade.providers; public class ArticleProvider extends ContentProvider { private static final String AUTHORITY = "eu.prismsw.lampshade.providers.articleprovider"; private static final String ARTICLES_BASE_PATH = "articles"; public static final int ARTICLES_SAVED = 10; public sta...
// Path: lampshade/src/main/java/eu/prismsw/lampshade/database/SavedArticlesHelper.java // public class SavedArticlesHelper extends SQLiteOpenHelper { // // public static final String TABLE_SAVED = "saved"; // public static final String TABLE_RECENT = "recent"; // public static final String TABLE_FAVORITE = ...
private SavedArticlesHelper helper;
strassl/Lampshade
lampshade/src/main/java/eu/prismsw/lampshade/fragments/IndexFragment.java
// Path: lampshade/src/main/java/eu/prismsw/lampshade/BaseActivity.java // public class BaseActivity extends FragmentActivity { // TropesApplication application; // // @Override // public void onCreate(Bundle savedInstanceState) { // this.application = (TropesApplication) getApplication(); // this...
import android.net.Uri; import android.os.Bundle; import android.view.*; import android.widget.AdapterView; import android.widget.AdapterView.OnItemClickListener; import android.widget.AdapterView.OnItemLongClickListener; import android.widget.ArrayAdapter; import android.widget.ListView; import android.widget.ShareAct...
package eu.prismsw.lampshade.fragments; public class IndexFragment extends TropesFragment { public static IndexFragment newInstance(Uri url) { IndexFragment f = new IndexFragment(); Bundle bundle = new Bundle(2); bundle.putParcelable(PASSED_URL, url); bundle.putParcelable(TRUE_URL, url); f.setArguments(b...
// Path: lampshade/src/main/java/eu/prismsw/lampshade/BaseActivity.java // public class BaseActivity extends FragmentActivity { // TropesApplication application; // // @Override // public void onCreate(Bundle savedInstanceState) { // this.application = (TropesApplication) getApplication(); // this...
((BaseActivity) getActivity()).loadArticle(trueUrl);
strassl/Lampshade
lampshade/src/main/java/eu/prismsw/lampshade/DebugActivity.java
// Path: lampshade/src/main/java/eu/prismsw/lampshade/fragments/SyncDialogFragment.java // public class SyncDialogFragment extends DialogFragment { // Future<String> mainJS; // ProgressDialog syncDialog; // // public static SyncDialogFragment newInstance() { // SyncDialogFragment f = new SyncDialog...
import android.app.Activity; import android.os.Bundle; import android.view.View; import eu.prismsw.lampshade.fragments.SyncDialogFragment;
package eu.prismsw.lampshade; public class DebugActivity extends Activity { @Override public void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.debug_activity); } public void clickHandler(View v) { if(v.getId() == R.id.btn_s...
// Path: lampshade/src/main/java/eu/prismsw/lampshade/fragments/SyncDialogFragment.java // public class SyncDialogFragment extends DialogFragment { // Future<String> mainJS; // ProgressDialog syncDialog; // // public static SyncDialogFragment newInstance() { // SyncDialogFragment f = new SyncDialog...
SyncDialogFragment s = SyncDialogFragment.newInstance();
strassl/Lampshade
lampshade/src/main/java/eu/prismsw/lampshade/FavoriteArticlesActivity.java
// Path: lampshade/src/main/java/eu/prismsw/lampshade/fragments/FavoriteArticlesFragment.java // public class FavoriteArticlesFragment extends SavedArticlesFragment { // public static FavoriteArticlesFragment newInstance() { // FavoriteArticlesFragment f = new FavoriteArticlesFragment(); // return f...
import eu.prismsw.lampshade.fragments.FavoriteArticlesFragment;
package eu.prismsw.lampshade; public class FavoriteArticlesActivity extends SavedArticlesActivity { @Override public void addFragments() {
// Path: lampshade/src/main/java/eu/prismsw/lampshade/fragments/FavoriteArticlesFragment.java // public class FavoriteArticlesFragment extends SavedArticlesFragment { // public static FavoriteArticlesFragment newInstance() { // FavoriteArticlesFragment f = new FavoriteArticlesFragment(); // return f...
listFragment = FavoriteArticlesFragment.newInstance();
strassl/Lampshade
lampshade/src/main/java/eu/prismsw/lampshade/RecentArticlesActivity.java
// Path: lampshade/src/main/java/eu/prismsw/lampshade/fragments/RecentArticlesFragment.java // public class RecentArticlesFragment extends SavedArticlesFragment { // public static RecentArticlesFragment newInstance() { // RecentArticlesFragment f = new RecentArticlesFragment(); // return f; // }...
import eu.prismsw.lampshade.fragments.RecentArticlesFragment;
package eu.prismsw.lampshade; public class RecentArticlesActivity extends SavedArticlesActivity { @Override public void addFragments() {
// Path: lampshade/src/main/java/eu/prismsw/lampshade/fragments/RecentArticlesFragment.java // public class RecentArticlesFragment extends SavedArticlesFragment { // public static RecentArticlesFragment newInstance() { // RecentArticlesFragment f = new RecentArticlesFragment(); // return f; // }...
listFragment = RecentArticlesFragment.newInstance();
strassl/Lampshade
lampshade/src/main/java/eu/prismsw/lampshade/database/ProviderHelper.java
// Path: lampshade/src/main/java/eu/prismsw/tropeswrapper/TropesHelper.java // public class TropesHelper { // public static final String randomUrl = "http://tvtropes.org/pmwiki/randomitem.php?p=1"; // public static final String baseUrl = "http://tvtropes.org/pmwiki/"; // public static final String mainUrl = "http://...
import android.content.ContentResolver; import android.content.ContentValues; import android.database.Cursor; import android.net.Uri; import eu.prismsw.tropeswrapper.TropesHelper;
package eu.prismsw.lampshade.database; public class ProviderHelper { public static Uri saveArticle(ContentResolver resolver, Uri contentUri, Uri url) { ContentValues values = new ContentValues();
// Path: lampshade/src/main/java/eu/prismsw/tropeswrapper/TropesHelper.java // public class TropesHelper { // public static final String randomUrl = "http://tvtropes.org/pmwiki/randomitem.php?p=1"; // public static final String baseUrl = "http://tvtropes.org/pmwiki/"; // public static final String mainUrl = "http://...
values.put(SavedArticlesHelper.ARTICLES_COLUMN_TITLE, TropesHelper.titleFromUrl(url));
iloveeclipse/filesync4eclipse
FileSync/src/de/loskutov/fs/preferences/PreferencesInitializer.java
// Path: FileSync/src/de/loskutov/fs/FileSyncPlugin.java // public class FileSyncPlugin extends AbstractUIPlugin { // // private static FileSyncPlugin plugin; // // public static final String PLUGIN_ID = "de.loskutov.FileSync"; // // /** // * The constructor. // */ // public FileSy...
import org.eclipse.core.runtime.preferences.AbstractPreferenceInitializer; import org.eclipse.jface.preference.IPreferenceStore; import de.loskutov.fs.FileSyncPlugin;
/******************************************************************************* * Copyright (c) 2009 Andrey Loskutov. * All rights reserved. This program and the accompanying materials * are made available under the terms of the Eclipse Public License v1.0 * which accompanies this distribution, and is availabl...
// Path: FileSync/src/de/loskutov/fs/FileSyncPlugin.java // public class FileSyncPlugin extends AbstractUIPlugin { // // private static FileSyncPlugin plugin; // // public static final String PLUGIN_ID = "de.loskutov.FileSync"; // // /** // * The constructor. // */ // public FileSy...
IPreferenceStore store = FileSyncPlugin.getDefault().getPreferenceStore();
iloveeclipse/filesync4eclipse
FileSync/src/de/loskutov/fs/properties/SupportPanel.java
// Path: FileSync/src/de/loskutov/fs/FileSyncPlugin.java // public class FileSyncPlugin extends AbstractUIPlugin { // // private static FileSyncPlugin plugin; // // public static final String PLUGIN_ID = "de.loskutov.FileSync"; // // /** // * The constructor. // */ // public FileSy...
import java.net.MalformedURLException; import java.net.URL; import org.eclipse.core.runtime.IStatus; import org.eclipse.jface.resource.JFaceResources; import org.eclipse.swt.SWT; import org.eclipse.swt.graphics.Font; import org.eclipse.swt.layout.GridData; import org.eclipse.swt.layout.GridLayout; import org.ec...
public void handleEvent(Event event) { handleUrlClick("http://marketplace.eclipse.org/content/filesync"); } }); link = new Link(commonPanel, SWT.NONE); link.setFont(font); link.setText(" - <a>make a donation to support plugin development</a...
// Path: FileSync/src/de/loskutov/fs/FileSyncPlugin.java // public class FileSyncPlugin extends AbstractUIPlugin { // // private static FileSyncPlugin plugin; // // public static final String PLUGIN_ID = "de.loskutov.FileSync"; // // /** // * The constructor. // */ // public FileSy...
FileSyncPlugin.log("Failed to open url " + urlStr, e, IStatus.ERROR);
iloveeclipse/filesync4eclipse
FileSync/src/de/loskutov/fs/command/CopyDelegate.java
// Path: FileSync/src/de/loskutov/fs/FileSyncPlugin.java // public class FileSyncPlugin extends AbstractUIPlugin { // // private static FileSyncPlugin plugin; // // public static final String PLUGIN_ID = "de.loskutov.FileSync"; // // /** // * The constructor. // */ // public FileSy...
import java.io.File; import java.io.FileInputStream; import java.io.FileOutputStream; import java.io.IOException; import java.util.Properties; import org.eclipse.core.runtime.IStatus; import de.loskutov.fs.FileSyncPlugin;
package de.loskutov.fs.command; /** * @author Coloma Escribano, Ignacio - initial idea and first implementation * @author Andrey - production ready code :) */ public class CopyDelegate { /** * true to use the current date for destination files, * instead of keeping the same date for s...
// Path: FileSync/src/de/loskutov/fs/FileSyncPlugin.java // public class FileSyncPlugin extends AbstractUIPlugin { // // private static FileSyncPlugin plugin; // // public static final String PLUGIN_ID = "de.loskutov.FileSync"; // // /** // * The constructor. // */ // public FileSy...
FileSyncPlugin.log("Could not copy file '" + source + "' to '"
iloveeclipse/filesync4eclipse
FileSync/src/de/loskutov/fs/properties/PathListLabelProvider.java
// Path: FileSync/src/de/loskutov/fs/FileSyncPlugin.java // public class FileSyncPlugin extends AbstractUIPlugin { // // private static FileSyncPlugin plugin; // // public static final String PLUGIN_ID = "de.loskutov.FileSync"; // // /** // * The constructor. // */ // public FileSy...
import org.eclipse.core.resources.IResource; import org.eclipse.core.runtime.IPath; import org.eclipse.jface.viewers.LabelProvider; import org.eclipse.swt.graphics.Image; import org.eclipse.ui.ISharedImages; import org.eclipse.ui.ide.IDE; import de.loskutov.fs.FileSyncPlugin;
} else { buf.append("(All)"); } } return buf.toString(); } public String getPathListElementText(PathListElement cpentry) { IPath path = cpentry.getPath(); StringBuffer buf = new StringBuffer(path.makeRelative().toString()); ...
// Path: FileSync/src/de/loskutov/fs/FileSyncPlugin.java // public class FileSyncPlugin extends AbstractUIPlugin { // // private static FileSyncPlugin plugin; // // public static final String PLUGIN_ID = "de.loskutov.FileSync"; // // /** // * The constructor. // */ // public FileSy...
return FileSyncPlugin.getDefault().getWorkbench().getSharedImages().getImage(key);
iloveeclipse/filesync4eclipse
FileSync/src/de/loskutov/fs/FileSyncPlugin.java
// Path: FileSync/src/de/loskutov/fs/preferences/FileSyncConstants.java // public interface FileSyncConstants { // /** used for tests to not to open dialogs */ // String KEY_ASK_USER = "askUser"; // }
import org.eclipse.core.runtime.IStatus; import org.eclipse.core.runtime.Status; import org.eclipse.jface.dialogs.MessageDialog; import org.eclipse.jface.preference.IPreferenceStore; import org.eclipse.jface.resource.ImageDescriptor; import org.eclipse.jface.resource.ImageRegistry; import org.eclipse.swt.graphics...
/******************************************************************************* * Copyright (c) 2009 Andrey Loskutov. * All rights reserved. This program and the accompanying materials * are made available under the terms of the Eclipse Public License v1.0 * which accompanies this distribution, and is availabl...
// Path: FileSync/src/de/loskutov/fs/preferences/FileSyncConstants.java // public interface FileSyncConstants { // /** used for tests to not to open dialogs */ // String KEY_ASK_USER = "askUser"; // } // Path: FileSync/src/de/loskutov/fs/FileSyncPlugin.java import org.eclipse.core.runtime.IStatus; import...
if (store.getBoolean(FileSyncConstants.KEY_ASK_USER)) {
iloveeclipse/filesync4eclipse
FileSync/src/de/loskutov/fs/dialogs/StatusInfo.java
// Path: FileSync/src/de/loskutov/fs/FileSyncPlugin.java // public class FileSyncPlugin extends AbstractUIPlugin { // // private static FileSyncPlugin plugin; // // public static final String PLUGIN_ID = "de.loskutov.FileSync"; // // /** // * The constructor. // */ // public FileSy...
import org.eclipse.core.runtime.Assert; import org.eclipse.core.runtime.IStatus; import de.loskutov.fs.FileSyncPlugin;
/* * @see IStatus#matches(int) */ @Override public boolean matches(int severityMask) { return (fSeverity & severityMask) != 0; } /** * Returns always <code>false</code>. * @see IStatus#isMultiStatus() */ @Override public boolean isMultiStatus() ...
// Path: FileSync/src/de/loskutov/fs/FileSyncPlugin.java // public class FileSyncPlugin extends AbstractUIPlugin { // // private static FileSyncPlugin plugin; // // public static final String PLUGIN_ID = "de.loskutov.FileSync"; // // /** // * The constructor. // */ // public FileSy...
return FileSyncPlugin.PLUGIN_ID;
iloveeclipse/filesync4eclipse
FileSync/src/de/loskutov/fs/command/CopyDelegate1.java
// Path: FileSync/src/de/loskutov/fs/FileSyncPlugin.java // public class FileSyncPlugin extends AbstractUIPlugin { // // private static FileSyncPlugin plugin; // // public static final String PLUGIN_ID = "de.loskutov.FileSync"; // // /** // * The constructor. // */ // public FileSy...
import java.io.File; import java.io.FileInputStream; import java.io.FileOutputStream; import java.io.IOException; import java.util.HashMap; import java.util.Iterator; import java.util.Map; import java.util.Properties; import java.util.Set; import java.util.regex.Pattern; import org.eclipse.core.runtime.IStatu...
* @param source - should be file only * @param destination - should be already created * @return true if source was successfully copied */ @Override protected boolean copyInternal(File source, File destination) { boolean success = true; LineReader reader = null; ...
// Path: FileSync/src/de/loskutov/fs/FileSyncPlugin.java // public class FileSyncPlugin extends AbstractUIPlugin { // // private static FileSyncPlugin plugin; // // public static final String PLUGIN_ID = "de.loskutov.FileSync"; // // /** // * The constructor. // */ // public FileSy...
FileSyncPlugin.log("Could not copy file '" + source + "' to '"
iloveeclipse/filesync4eclipse
FileSync/src/de/loskutov/fs/command/FS.java
// Path: FileSync/src/de/loskutov/fs/FileSyncPlugin.java // public class FileSyncPlugin extends AbstractUIPlugin { // // private static FileSyncPlugin plugin; // // public static final String PLUGIN_ID = "de.loskutov.FileSync"; // // /** // * The constructor. // */ // public FileSy...
import java.io.File; import java.io.FileInputStream; import java.io.FileOutputStream; import java.io.IOException; import java.nio.channels.FileChannel; import org.eclipse.core.runtime.IStatus; import de.loskutov.fs.FileSyncPlugin;
/******************************************************************************* * Copyright (c) 2009 Andrey Loskutov. * All rights reserved. This program and the accompanying materials * are made available under the terms of the Eclipse Public License v1.0 * which accompanies this distribution, and is availabl...
// Path: FileSync/src/de/loskutov/fs/FileSyncPlugin.java // public class FileSyncPlugin extends AbstractUIPlugin { // // private static FileSyncPlugin plugin; // // public static final String PLUGIN_ID = "de.loskutov.FileSync"; // // /** // * The constructor. // */ // public FileSy...
FileSyncPlugin.log("Could not create directory '" + dir + "'",
TGAC/statsdb
Java/statsdb-api/src/main/java/uk/ac/tgac/statsdb/run/parser/AnalysisMetadataParser.java
// Path: Java/statsdb-api/src/main/java/uk/ac/tgac/statsdb/analysis/DefaultQCAnalysis.java // public class DefaultQCAnalysis extends AbstractQCAnalysis { // public DefaultQCAnalysis() { // properties = new HashMap<>(); // valueTypes = new HashMap<>(); // valueDescriptions = new HashMap<>(); // general...
import uk.ac.tgac.statsdb.analysis.DefaultQCAnalysis; import uk.ac.tgac.statsdb.analysis.QCAnalysis; import uk.ac.tgac.statsdb.exception.QCAnalysisException; import java.io.*; import java.util.ArrayList; import java.util.List;
* in said QCAnalysis objects * * @param csv to parse as a CSV text file string * @return a List of QCAnalysis objects created from the metadata file * @throws QCAnalysisException */ public List<QCAnalysis> parseMetadataFile(String csv) throws QCAnalysisException { List<QCAnalysis> qcas = new Arr...
// Path: Java/statsdb-api/src/main/java/uk/ac/tgac/statsdb/analysis/DefaultQCAnalysis.java // public class DefaultQCAnalysis extends AbstractQCAnalysis { // public DefaultQCAnalysis() { // properties = new HashMap<>(); // valueTypes = new HashMap<>(); // valueDescriptions = new HashMap<>(); // general...
QCAnalysis qa = new DefaultQCAnalysis();
TGAC/statsdb
Java/statsdb-api/src/main/java/uk/ac/tgac/statsdb/analysis/PartitionValue.java
// Path: Java/statsdb-api/src/main/java/uk/ac/tgac/statsdb/exception/QCAnalysisException.java // public class QCAnalysisException extends Exception { // public QCAnalysisException(String s) { // super(s); // } // // public QCAnalysisException(String s, Throwable cause) { // super(s); // if (cause != ...
import uk.ac.tgac.statsdb.exception.QCAnalysisException;
package uk.ac.tgac.statsdb.analysis; /** * A value class that represents a partionable number, i.e. a range, alongside a given key:value description of that metric * * @author Rob Davey * @date 02/07/13 * @since 1.0_SNAPSHOT */ public class PartitionValue { private long position; private long size; privat...
// Path: Java/statsdb-api/src/main/java/uk/ac/tgac/statsdb/exception/QCAnalysisException.java // public class QCAnalysisException extends Exception { // public QCAnalysisException(String s) { // super(s); // } // // public QCAnalysisException(String s, Throwable cause) { // super(s); // if (cause != ...
public PartitionValue(long position, long size, String key, String value) throws QCAnalysisException {
TGAC/statsdb
Java/statsdb-api/src/main/java/uk/ac/tgac/statsdb/analysis/QCAnalysis.java
// Path: Java/statsdb-api/src/main/java/uk/ac/tgac/statsdb/exception/QCAnalysisException.java // public class QCAnalysisException extends Exception { // public QCAnalysisException(String s) { // super(s); // } // // public QCAnalysisException(String s, Throwable cause) { // super(s); // if (cause != ...
import uk.ac.tgac.statsdb.exception.QCAnalysisException; import java.util.List; import java.util.Map;
package uk.ac.tgac.statsdb.analysis; /** * Interface defining the contract of QCAnalysis objects * * @author Rob Davey * @date 02/07/13 * @since 1.0-SNAPSHOT */ public interface QCAnalysis { /** * Get the QCAnalysis ID * @return the QCAnalysis object ID */ public long getId(); /** * Sets the...
// Path: Java/statsdb-api/src/main/java/uk/ac/tgac/statsdb/exception/QCAnalysisException.java // public class QCAnalysisException extends Exception { // public QCAnalysisException(String s) { // super(s); // } // // public QCAnalysisException(String s, Throwable cause) { // super(s); // if (cause != ...
public String getProperty(String key) throws QCAnalysisException;
TGAC/statsdb
Java/statsdb-api/src/main/java/uk/ac/tgac/statsdb/util/StatsDBUtils.java
// Path: Java/statsdb-api/src/main/java/uk/ac/tgac/statsdb/exception/QCAnalysisException.java // public class QCAnalysisException extends Exception { // public QCAnalysisException(String s) { // super(s); // } // // public QCAnalysisException(String s, Throwable cause) { // super(s); // if (cause != ...
import uk.ac.tgac.statsdb.exception.QCAnalysisException; import java.util.AbstractMap; import java.util.Map; import java.util.regex.Matcher; import java.util.regex.Pattern;
package uk.ac.tgac.statsdb.util; /** * Helper class containing any StatsDB general handy constants and functions * * @author Rob Davey * @date 04/07/13 * @since 1.0-SNAPSHOT */ public class StatsDBUtils { /** * Regular expression representing a valid range string */ private static final Pattern range...
// Path: Java/statsdb-api/src/main/java/uk/ac/tgac/statsdb/exception/QCAnalysisException.java // public class QCAnalysisException extends Exception { // public QCAnalysisException(String s) { // super(s); // } // // public QCAnalysisException(String s, Throwable cause) { // super(s); // if (cause != ...
public static Map.Entry<Long, Long> parseRange(String range) throws QCAnalysisException {
TGAC/statsdb
Java/statsdb-api/src/main/java/uk/ac/tgac/statsdb/run/parser/QcReportParser.java
// Path: Java/statsdb-api/src/main/java/uk/ac/tgac/statsdb/analysis/QCAnalysis.java // public interface QCAnalysis { // /** // * Get the QCAnalysis ID // * @return the QCAnalysis object ID // */ // public long getId(); // // /** // * Sets the ID of this QCAnalysis object // * @param id // */ //...
import net.sourceforge.fluxion.spi.Spi; import uk.ac.tgac.statsdb.analysis.QCAnalysis; import uk.ac.tgac.statsdb.exception.QCAnalysisException;
package uk.ac.tgac.statsdb.run.parser; /** * Interface defining contract to parse the output of a QC application into the StatsDB QCAnalysis data type. * * This interface is marked with the @Spi annotation, meaning it can be resolved at runtime by the ServiceLoader * architecture. * * @author Rob Davey * @date...
// Path: Java/statsdb-api/src/main/java/uk/ac/tgac/statsdb/analysis/QCAnalysis.java // public interface QCAnalysis { // /** // * Get the QCAnalysis ID // * @return the QCAnalysis object ID // */ // public long getId(); // // /** // * Sets the ID of this QCAnalysis object // * @param id // */ //...
void parseReport(T in, QCAnalysis qcAnalysis) throws QCAnalysisException;
TGAC/statsdb
Java/statsdb-api/src/main/java/uk/ac/tgac/statsdb/run/parser/QcReportParser.java
// Path: Java/statsdb-api/src/main/java/uk/ac/tgac/statsdb/analysis/QCAnalysis.java // public interface QCAnalysis { // /** // * Get the QCAnalysis ID // * @return the QCAnalysis object ID // */ // public long getId(); // // /** // * Sets the ID of this QCAnalysis object // * @param id // */ //...
import net.sourceforge.fluxion.spi.Spi; import uk.ac.tgac.statsdb.analysis.QCAnalysis; import uk.ac.tgac.statsdb.exception.QCAnalysisException;
package uk.ac.tgac.statsdb.run.parser; /** * Interface defining contract to parse the output of a QC application into the StatsDB QCAnalysis data type. * * This interface is marked with the @Spi annotation, meaning it can be resolved at runtime by the ServiceLoader * architecture. * * @author Rob Davey * @date...
// Path: Java/statsdb-api/src/main/java/uk/ac/tgac/statsdb/analysis/QCAnalysis.java // public interface QCAnalysis { // /** // * Get the QCAnalysis ID // * @return the QCAnalysis object ID // */ // public long getId(); // // /** // * Sets the ID of this QCAnalysis object // * @param id // */ //...
void parseReport(T in, QCAnalysis qcAnalysis) throws QCAnalysisException;
TGAC/statsdb
Java/statsdb-api/src/main/java/uk/ac/tgac/statsdb/analysis/PositionValue.java
// Path: Java/statsdb-api/src/main/java/uk/ac/tgac/statsdb/exception/QCAnalysisException.java // public class QCAnalysisException extends Exception { // public QCAnalysisException(String s) { // super(s); // } // // public QCAnalysisException(String s, Throwable cause) { // super(s); // if (cause != ...
import uk.ac.tgac.statsdb.exception.QCAnalysisException;
package uk.ac.tgac.statsdb.analysis; /** * A value class that represents a position number, i.e. a single number, alongside a given key:value description of that metric * * @author Rob Davey * @date 02/07/13 * @since 1.0_SNAPSHOT */ public class PositionValue { private long position; private String key; p...
// Path: Java/statsdb-api/src/main/java/uk/ac/tgac/statsdb/exception/QCAnalysisException.java // public class QCAnalysisException extends Exception { // public QCAnalysisException(String s) { // super(s); // } // // public QCAnalysisException(String s, Throwable cause) { // super(s); // if (cause != ...
public PositionValue(long position, String key, String value) throws QCAnalysisException {
TGAC/statsdb
Java/statsdb-api/src/main/java/uk/ac/tgac/statsdb/analysis/AbstractQCAnalysis.java
// Path: Java/statsdb-api/src/main/java/uk/ac/tgac/statsdb/exception/QCAnalysisException.java // public class QCAnalysisException extends Exception { // public QCAnalysisException(String s) { // super(s); // } // // public QCAnalysisException(String s, Throwable cause) { // super(s); // if (cause != ...
import uk.ac.tgac.statsdb.exception.QCAnalysisException; import uk.ac.tgac.statsdb.util.StatsDBUtils; import java.util.AbstractMap; import java.util.List; import java.util.Map; import java.util.regex.Matcher; import java.util.regex.Pattern;
package uk.ac.tgac.statsdb.analysis; /** * Skeleton implementation of a QCAnalysis object. Contains default methods for storing and retrieving QC report * metrics. * * @author Rob Davey * @date 02/07/13 * @since 1.0-SNAPSHOT */ public abstract class AbstractQCAnalysis implements QCAnalysis { private long id...
// Path: Java/statsdb-api/src/main/java/uk/ac/tgac/statsdb/exception/QCAnalysisException.java // public class QCAnalysisException extends Exception { // public QCAnalysisException(String s) { // super(s); // } // // public QCAnalysisException(String s, Throwable cause) { // super(s); // if (cause != ...
public String getProperty(String key) throws QCAnalysisException {
TGAC/statsdb
Java/statsdb-api/src/main/java/uk/ac/tgac/statsdb/analysis/AbstractQCAnalysis.java
// Path: Java/statsdb-api/src/main/java/uk/ac/tgac/statsdb/exception/QCAnalysisException.java // public class QCAnalysisException extends Exception { // public QCAnalysisException(String s) { // super(s); // } // // public QCAnalysisException(String s, Throwable cause) { // super(s); // if (cause != ...
import uk.ac.tgac.statsdb.exception.QCAnalysisException; import uk.ac.tgac.statsdb.util.StatsDBUtils; import java.util.AbstractMap; import java.util.List; import java.util.Map; import java.util.regex.Matcher; import java.util.regex.Pattern;
public List<PartitionValue> partitionValues; public List<PositionValue> positionValues; @Override public void setId(long id) { this.id = id; } @Override public long getId() { return this.id; } @Override public String getProperty(String key) throws QCAnalysisException { if (properties....
// Path: Java/statsdb-api/src/main/java/uk/ac/tgac/statsdb/exception/QCAnalysisException.java // public class QCAnalysisException extends Exception { // public QCAnalysisException(String s) { // super(s); // } // // public QCAnalysisException(String s, Throwable cause) { // super(s); // if (cause != ...
Map.Entry<String, String> positionAndSize = StatsDBUtils.rangeToSize(range);
snazy/ohc
ohc-core/src/main/java/org/caffinitas/ohc/linked/Timeouts.java
// Path: ohc-core/src/main/java/org/caffinitas/ohc/Ticker.java // public interface Ticker // { // Ticker DEFAULT = new DefaultTicker(); // // long nanos(); // // long currentTimeMillis(); // }
import com.google.common.primitives.Ints; import org.caffinitas.ohc.Ticker;
/* * Copyright (C) 2014 Robert Stupp, Koeln, Germany, robert-stupp.de * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * ...
// Path: ohc-core/src/main/java/org/caffinitas/ohc/Ticker.java // public interface Ticker // { // Ticker DEFAULT = new DefaultTicker(); // // long nanos(); // // long currentTimeMillis(); // } // Path: ohc-core/src/main/java/org/caffinitas/ohc/linked/Timeouts.java import com.google.common.primitives.Int...
private final Ticker ticker;
snazy/ohc
ohc-core/src/test/java/org/caffinitas/ohc/linked/HashEntriesTest.java
// Path: ohc-core/src/main/java/org/caffinitas/ohc/HashAlgorithm.java // public enum HashAlgorithm // { // MURMUR3, // // CRC32, // // CRC32C, // // XX // }
import org.caffinitas.ohc.HashAlgorithm; import org.testng.annotations.AfterMethod; import org.testng.annotations.Test; import java.nio.ByteBuffer; import static org.testng.Assert.*;
assertEquals(Uns.getInt(adr, Util.ENTRY_OFF_VALUE_LENGTH), 10L); assertEquals(HashEntries.getHash(adr), 0x98765432abcddeafL); assertEquals(HashEntries.getKeyLen(adr), 5L); assertEquals(HashEntries.getValueLen(adr), 10L); assertTrue(HashEntries.dereference(adr...
// Path: ohc-core/src/main/java/org/caffinitas/ohc/HashAlgorithm.java // public enum HashAlgorithm // { // MURMUR3, // // CRC32, // // CRC32C, // // XX // } // Path: ohc-core/src/test/java/org/caffinitas/ohc/linked/HashEntriesTest.java import org.caffinitas.ohc.HashAlgorithm; import org.testng.anno...
key.finish(Hasher.create(HashAlgorithm.MURMUR3));
snazy/ohc
ohc-core/src/test/java/org/caffinitas/ohc/linked/CheckSegment.java
// Path: ohc-core/src/main/java/org/caffinitas/ohc/Eviction.java // public enum Eviction // { // LRU, // W_TINY_LFU, // NONE // }
import org.caffinitas.ohc.Eviction; import java.util.*; import java.util.concurrent.atomic.AtomicLong;
/* * Copyright (C) 2014 Robert Stupp, Koeln, Germany, robert-stupp.de * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * ...
// Path: ohc-core/src/main/java/org/caffinitas/ohc/Eviction.java // public enum Eviction // { // LRU, // W_TINY_LFU, // NONE // } // Path: ohc-core/src/test/java/org/caffinitas/ohc/linked/CheckSegment.java import org.caffinitas.ohc.Eviction; import java.util.*; import java.util.concurrent.atomic.AtomicLon...
private final Eviction eviction;
snazy/ohc
ohc-core/src/main/java/org/caffinitas/ohc/linked/Hasher.java
// Path: ohc-core/src/main/java/org/caffinitas/ohc/HashAlgorithm.java // public enum HashAlgorithm // { // MURMUR3, // // CRC32, // // CRC32C, // // XX // }
import org.caffinitas.ohc.HashAlgorithm; import java.lang.reflect.InvocationTargetException;
/* * Copyright (C) 2014 Robert Stupp, Koeln, Germany, robert-stupp.de * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * ...
// Path: ohc-core/src/main/java/org/caffinitas/ohc/HashAlgorithm.java // public enum HashAlgorithm // { // MURMUR3, // // CRC32, // // CRC32C, // // XX // } // Path: ohc-core/src/main/java/org/caffinitas/ohc/linked/Hasher.java import org.caffinitas.ohc.HashAlgorithm; import java.lang.reflect.Invoca...
static Hasher create(HashAlgorithm hashAlgorithm)
snazy/ohc
ohc-core/src/test/java/org/caffinitas/ohc/linked/HasherTest.java
// Path: ohc-core/src/main/java/org/caffinitas/ohc/HashAlgorithm.java // public enum HashAlgorithm // { // MURMUR3, // // CRC32, // // CRC32C, // // XX // }
import org.caffinitas.ohc.HashAlgorithm; import org.testng.Assert; import org.testng.annotations.Test; import java.util.Random;
/* * Copyright (C) 2014 Robert Stupp, Koeln, Germany, robert-stupp.de * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * ...
// Path: ohc-core/src/main/java/org/caffinitas/ohc/HashAlgorithm.java // public enum HashAlgorithm // { // MURMUR3, // // CRC32, // // CRC32C, // // XX // } // Path: ohc-core/src/test/java/org/caffinitas/ohc/linked/HasherTest.java import org.caffinitas.ohc.HashAlgorithm; import org.testng.Assert; i...
test(HashAlgorithm.MURMUR3);
snazy/ohc
ohc-core/src/main/java/org/caffinitas/ohc/chunked/Murmur3Hash.java
// Path: ohc-core/src/main/java/org/caffinitas/ohc/util/ByteBufferCompat.java // public static void byteBufferPosition(ByteBuffer byteBuffer, int position) { // byteBufferAccess.position(byteBuffer, position); // }
import java.nio.ByteBuffer; import static org.caffinitas.ohc.util.ByteBufferCompat.byteBufferPosition;
k2 ^= toLong(buffer.get(p + 12)) << 32; // fall through case 12: k2 ^= toLong(buffer.get(p + 11)) << 24; // fall through case 11: k2 ^= toLong(buffer.get(p + 10)) << 16; // fall through case 10: ...
// Path: ohc-core/src/main/java/org/caffinitas/ohc/util/ByteBufferCompat.java // public static void byteBufferPosition(ByteBuffer byteBuffer, int position) { // byteBufferAccess.position(byteBuffer, position); // } // Path: ohc-core/src/main/java/org/caffinitas/ohc/chunked/Murmur3Hash.java import java.nio.ByteBuf...
byteBufferPosition(buffer, p + r);
snazy/ohc
ohc-core/src/test/java/org/caffinitas/ohc/linked/KeyBufferTest.java
// Path: ohc-core/src/main/java/org/caffinitas/ohc/HashAlgorithm.java // public enum HashAlgorithm // { // MURMUR3, // // CRC32, // // CRC32C, // // XX // }
import com.google.common.hash.HashCode; import com.google.common.hash.Hasher; import com.google.common.hash.Hashing; import org.caffinitas.ohc.HashAlgorithm; import org.testng.annotations.AfterMethod; import org.testng.annotations.DataProvider; import org.testng.annotations.Test; import java.nio.ByteBuffer; import stat...
/* * Copyright (C) 2014 Robert Stupp, Koeln, Germany, robert-stupp.de * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * ...
// Path: ohc-core/src/main/java/org/caffinitas/ohc/HashAlgorithm.java // public enum HashAlgorithm // { // MURMUR3, // // CRC32, // // CRC32C, // // XX // } // Path: ohc-core/src/test/java/org/caffinitas/ohc/linked/KeyBufferTest.java import com.google.common.hash.HashCode; import com.google.common....
{ HashAlgorithm.MURMUR3 },
snazy/ohc
ohc-jmh/src/main/java/org/caffinitas/ohc/jmh/AllocatorBenchmark.java
// Path: ohc-core/src/main/java/org/caffinitas/ohc/alloc/IAllocator.java // public interface IAllocator // { // long allocate(long size); // void free(long peer); // long getTotalAllocated(); // } // // Path: ohc-core/src/main/java/org/caffinitas/ohc/alloc/JNANativeAllocator.java // public final class JNAN...
import java.io.IOException; import java.util.concurrent.TimeUnit; import java.util.concurrent.atomic.AtomicLong; import org.caffinitas.ohc.alloc.IAllocator; import org.caffinitas.ohc.alloc.JNANativeAllocator; import org.caffinitas.ohc.alloc.UnsafeAllocator; import org.openjdk.jmh.annotations.Benchmark; import org.openj...
/* * Copyright (C) 2014 Robert Stupp, Koeln, Germany, robert-stupp.de * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * ...
// Path: ohc-core/src/main/java/org/caffinitas/ohc/alloc/IAllocator.java // public interface IAllocator // { // long allocate(long size); // void free(long peer); // long getTotalAllocated(); // } // // Path: ohc-core/src/main/java/org/caffinitas/ohc/alloc/JNANativeAllocator.java // public final class JNAN...
private IAllocator allocator;
snazy/ohc
ohc-jmh/src/main/java/org/caffinitas/ohc/jmh/AllocatorBenchmark.java
// Path: ohc-core/src/main/java/org/caffinitas/ohc/alloc/IAllocator.java // public interface IAllocator // { // long allocate(long size); // void free(long peer); // long getTotalAllocated(); // } // // Path: ohc-core/src/main/java/org/caffinitas/ohc/alloc/JNANativeAllocator.java // public final class JNAN...
import java.io.IOException; import java.util.concurrent.TimeUnit; import java.util.concurrent.atomic.AtomicLong; import org.caffinitas.ohc.alloc.IAllocator; import org.caffinitas.ohc.alloc.JNANativeAllocator; import org.caffinitas.ohc.alloc.UnsafeAllocator; import org.openjdk.jmh.annotations.Benchmark; import org.openj...
if (adr.compareAndSet(a, 0L)) { allocator.free(a); break; } } long a = allocator.allocate(size); if (!adr.compareAndSet(0L, a)) { allocator.free(a); } ...
// Path: ohc-core/src/main/java/org/caffinitas/ohc/alloc/IAllocator.java // public interface IAllocator // { // long allocate(long size); // void free(long peer); // long getTotalAllocated(); // } // // Path: ohc-core/src/main/java/org/caffinitas/ohc/alloc/JNANativeAllocator.java // public final class JNAN...
case "Unsafe": allocator = new UnsafeAllocator(); break;
snazy/ohc
ohc-jmh/src/main/java/org/caffinitas/ohc/jmh/AllocatorBenchmark.java
// Path: ohc-core/src/main/java/org/caffinitas/ohc/alloc/IAllocator.java // public interface IAllocator // { // long allocate(long size); // void free(long peer); // long getTotalAllocated(); // } // // Path: ohc-core/src/main/java/org/caffinitas/ohc/alloc/JNANativeAllocator.java // public final class JNAN...
import java.io.IOException; import java.util.concurrent.TimeUnit; import java.util.concurrent.atomic.AtomicLong; import org.caffinitas.ohc.alloc.IAllocator; import org.caffinitas.ohc.alloc.JNANativeAllocator; import org.caffinitas.ohc.alloc.UnsafeAllocator; import org.openjdk.jmh.annotations.Benchmark; import org.openj...
{ allocator.free(a); break; } } long a = allocator.allocate(size); if (!adr.compareAndSet(0L, a)) { allocator.free(a); } } void freeAll(IAllocator allocat...
// Path: ohc-core/src/main/java/org/caffinitas/ohc/alloc/IAllocator.java // public interface IAllocator // { // long allocate(long size); // void free(long peer); // long getTotalAllocated(); // } // // Path: ohc-core/src/main/java/org/caffinitas/ohc/alloc/JNANativeAllocator.java // public final class JNAN...
case "JNA": allocator = new JNANativeAllocator(); break;
snazy/ohc
ohc-core/src/test/java/org/caffinitas/ohc/linked/UnsTest.java
// Path: ohc-core/src/main/java/org/caffinitas/ohc/util/ByteBufferCompat.java // public static void byteBufferClear(ByteBuffer byteBuffer) { // byteBufferAccess.clear(byteBuffer); // } // // Path: ohc-core/src/main/java/org/caffinitas/ohc/util/ByteBufferCompat.java // public static void byteBufferFlip(ByteBuffer b...
import org.testng.annotations.AfterMethod; import org.testng.annotations.Test; import sun.misc.Unsafe; import sun.nio.ch.DirectBuffer; import java.io.IOException; import java.lang.reflect.Field; import java.nio.ByteBuffer; import java.nio.ByteOrder; import java.util.Random; import static org.caffinitas.ohc.util.ByteBuf...
/* * Copyright (C) 2014 Robert Stupp, Koeln, Germany, robert-stupp.de * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * ...
// Path: ohc-core/src/main/java/org/caffinitas/ohc/util/ByteBufferCompat.java // public static void byteBufferClear(ByteBuffer byteBuffer) { // byteBufferAccess.clear(byteBuffer); // } // // Path: ohc-core/src/main/java/org/caffinitas/ohc/util/ByteBufferCompat.java // public static void byteBufferFlip(ByteBuffer b...
byteBufferClear(directBuffer);
snazy/ohc
ohc-core/src/test/java/org/caffinitas/ohc/linked/UnsTest.java
// Path: ohc-core/src/main/java/org/caffinitas/ohc/util/ByteBufferCompat.java // public static void byteBufferClear(ByteBuffer byteBuffer) { // byteBufferAccess.clear(byteBuffer); // } // // Path: ohc-core/src/main/java/org/caffinitas/ohc/util/ByteBufferCompat.java // public static void byteBufferFlip(ByteBuffer b...
import org.testng.annotations.AfterMethod; import org.testng.annotations.Test; import sun.misc.Unsafe; import sun.nio.ch.DirectBuffer; import java.io.IOException; import java.lang.reflect.Field; import java.nio.ByteBuffer; import java.nio.ByteOrder; import java.util.Random; import static org.caffinitas.ohc.util.ByteBuf...
try { for (byte b = 0; b < 13; b++) for (int offset = 0; offset < 10; offset += 13) { Uns.setMemory(adr, offset, 7777, b); for (int off = 0; off < 7777; off++) assertEquals(unsafe.getByte(adr + o...
// Path: ohc-core/src/main/java/org/caffinitas/ohc/util/ByteBufferCompat.java // public static void byteBufferClear(ByteBuffer byteBuffer) { // byteBufferAccess.clear(byteBuffer); // } // // Path: ohc-core/src/main/java/org/caffinitas/ohc/util/ByteBufferCompat.java // public static void byteBufferFlip(ByteBuffer b...
byteBufferFlip(directBuffer);
snazy/ohc
ohc-core/src/main/java/org/caffinitas/ohc/chunked/Hasher.java
// Path: ohc-core/src/main/java/org/caffinitas/ohc/HashAlgorithm.java // public enum HashAlgorithm // { // MURMUR3, // // CRC32, // // CRC32C, // // XX // }
import java.nio.ByteBuffer; import org.caffinitas.ohc.HashAlgorithm;
/* * Copyright (C) 2014 Robert Stupp, Koeln, Germany, robert-stupp.de * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * ...
// Path: ohc-core/src/main/java/org/caffinitas/ohc/HashAlgorithm.java // public enum HashAlgorithm // { // MURMUR3, // // CRC32, // // CRC32C, // // XX // } // Path: ohc-core/src/main/java/org/caffinitas/ohc/chunked/Hasher.java import java.nio.ByteBuffer; import org.caffinitas.ohc.HashAlgorithm; /...
static Hasher create(HashAlgorithm hashAlgorithm)
snazy/ohc
ohc-core/src/test/java/org/caffinitas/ohc/chunked/HasherTest.java
// Path: ohc-core/src/main/java/org/caffinitas/ohc/HashAlgorithm.java // public enum HashAlgorithm // { // MURMUR3, // // CRC32, // // CRC32C, // // XX // } // // Path: ohc-core/src/main/java/org/caffinitas/ohc/util/ByteBufferCompat.java // public static void byteBufferPosition(ByteBuffer byteBuffer...
import java.nio.ByteBuffer; import java.util.Random; import org.caffinitas.ohc.HashAlgorithm; import org.testng.Assert; import org.testng.annotations.Test; import static org.caffinitas.ohc.util.ByteBufferCompat.byteBufferPosition;
/* * Copyright (C) 2014 Robert Stupp, Koeln, Germany, robert-stupp.de * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * ...
// Path: ohc-core/src/main/java/org/caffinitas/ohc/HashAlgorithm.java // public enum HashAlgorithm // { // MURMUR3, // // CRC32, // // CRC32C, // // XX // } // // Path: ohc-core/src/main/java/org/caffinitas/ohc/util/ByteBufferCompat.java // public static void byteBufferPosition(ByteBuffer byteBuffer...
test(HashAlgorithm.MURMUR3);
snazy/ohc
ohc-core/src/test/java/org/caffinitas/ohc/chunked/HasherTest.java
// Path: ohc-core/src/main/java/org/caffinitas/ohc/HashAlgorithm.java // public enum HashAlgorithm // { // MURMUR3, // // CRC32, // // CRC32C, // // XX // } // // Path: ohc-core/src/main/java/org/caffinitas/ohc/util/ByteBufferCompat.java // public static void byteBufferPosition(ByteBuffer byteBuffer...
import java.nio.ByteBuffer; import java.util.Random; import org.caffinitas.ohc.HashAlgorithm; import org.testng.Assert; import org.testng.annotations.Test; import static org.caffinitas.ohc.util.ByteBufferCompat.byteBufferPosition;
} @Test public void testCRC32C() { test(HashAlgorithm.CRC32C); } @Test public void testXX() { test(HashAlgorithm.XX); } private void test(HashAlgorithm hash) { Random rand = new Random(); byte[] buf = new byte[3211]; rand.nextBytes(...
// Path: ohc-core/src/main/java/org/caffinitas/ohc/HashAlgorithm.java // public enum HashAlgorithm // { // MURMUR3, // // CRC32, // // CRC32C, // // XX // } // // Path: ohc-core/src/main/java/org/caffinitas/ohc/util/ByteBufferCompat.java // public static void byteBufferPosition(ByteBuffer byteBuffer...
byteBufferPosition(nativeMem, 99);
snazy/ohc
ohc-core/src/test/java/org/caffinitas/ohc/chunked/KeyBufferTest.java
// Path: ohc-core/src/main/java/org/caffinitas/ohc/HashAlgorithm.java // public enum HashAlgorithm // { // MURMUR3, // // CRC32, // // CRC32C, // // XX // } // // Path: ohc-core/src/main/java/org/caffinitas/ohc/util/ByteBufferCompat.java // public static void byteBufferFlip(ByteBuffer byteBuffer) { ...
import java.nio.ByteBuffer; import com.google.common.hash.Hasher; import com.google.common.hash.Hashing; import org.caffinitas.ohc.HashAlgorithm; import org.testng.annotations.AfterMethod; import org.testng.annotations.Test; import static org.caffinitas.ohc.util.ByteBufferCompat.byteBufferFlip; import static org.testng...
/* * Copyright (C) 2014 Robert Stupp, Koeln, Germany, robert-stupp.de * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * ...
// Path: ohc-core/src/main/java/org/caffinitas/ohc/HashAlgorithm.java // public enum HashAlgorithm // { // MURMUR3, // // CRC32, // // CRC32C, // // XX // } // // Path: ohc-core/src/main/java/org/caffinitas/ohc/util/ByteBufferCompat.java // public static void byteBufferFlip(ByteBuffer byteBuffer) { ...
byteBufferFlip(buf);
snazy/ohc
ohc-core/src/test/java/org/caffinitas/ohc/chunked/KeyBufferTest.java
// Path: ohc-core/src/main/java/org/caffinitas/ohc/HashAlgorithm.java // public enum HashAlgorithm // { // MURMUR3, // // CRC32, // // CRC32C, // // XX // } // // Path: ohc-core/src/main/java/org/caffinitas/ohc/util/ByteBufferCompat.java // public static void byteBufferFlip(ByteBuffer byteBuffer) { ...
import java.nio.ByteBuffer; import com.google.common.hash.Hasher; import com.google.common.hash.Hashing; import org.caffinitas.ohc.HashAlgorithm; import org.testng.annotations.AfterMethod; import org.testng.annotations.Test; import static org.caffinitas.ohc.util.ByteBufferCompat.byteBufferFlip; import static org.testng...
/* * Copyright (C) 2014 Robert Stupp, Koeln, Germany, robert-stupp.de * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * ...
// Path: ohc-core/src/main/java/org/caffinitas/ohc/HashAlgorithm.java // public enum HashAlgorithm // { // MURMUR3, // // CRC32, // // CRC32C, // // XX // } // // Path: ohc-core/src/main/java/org/caffinitas/ohc/util/ByteBufferCompat.java // public static void byteBufferFlip(ByteBuffer byteBuffer) { ...
KeyBuffer out = new KeyBuffer(buf).finish(org.caffinitas.ohc.chunked.Hasher.create(HashAlgorithm.MURMUR3));
snazy/ohc
ohc-core/src/test/java/org/caffinitas/ohc/chunked/UnsTest.java
// Path: ohc-core/src/main/java/org/caffinitas/ohc/util/ByteBufferCompat.java // public static void byteBufferClear(ByteBuffer byteBuffer) { // byteBufferAccess.clear(byteBuffer); // }
import java.lang.reflect.Field; import java.nio.ByteBuffer; import java.util.Random; import org.testng.annotations.AfterMethod; import org.testng.annotations.Test; import sun.misc.Unsafe; import sun.nio.ch.DirectBuffer; import static org.caffinitas.ohc.util.ByteBufferCompat.byteBufferClear; import static org.testng.Ass...
/* * Copyright (C) 2014 Robert Stupp, Koeln, Germany, robert-stupp.de * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * ...
// Path: ohc-core/src/main/java/org/caffinitas/ohc/util/ByteBufferCompat.java // public static void byteBufferClear(ByteBuffer byteBuffer) { // byteBufferAccess.clear(byteBuffer); // } // Path: ohc-core/src/test/java/org/caffinitas/ohc/chunked/UnsTest.java import java.lang.reflect.Field; import java.nio.ByteBuffe...
byteBufferClear(directBuffer);
developers-payu-latam/payu-latam-java-payments-sdk
src/main/java/com/payu/sdk/payments/model/MassiveTokenPaymentsResponse.java
// Path: src/main/java/com/payu/sdk/model/response/Response.java // @XmlRootElement(name = "response") // @XmlAccessorType(XmlAccessType.FIELD) // public class Response implements Serializable { // // /** The generated serial version Id */ // private static final long serialVersionUID = -3399914855691352540L; // /*...
import javax.xml.bind.annotation.XmlAccessType; import javax.xml.bind.annotation.XmlAccessorType; import javax.xml.bind.annotation.XmlElement; import javax.xml.bind.annotation.XmlRootElement; import com.payu.sdk.exceptions.PayUException; import com.payu.sdk.model.response.Response;
/** * The MIT License (MIT) * * Copyright (c) 2016 developers-payu-latam * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal * in the Software without restriction, including without limitation the rights ...
// Path: src/main/java/com/payu/sdk/model/response/Response.java // @XmlRootElement(name = "response") // @XmlAccessorType(XmlAccessType.FIELD) // public class Response implements Serializable { // // /** The generated serial version Id */ // private static final long serialVersionUID = -3399914855691352540L; // /*...
public class MassiveTokenPaymentsResponse extends Response {
developers-payu-latam/payu-latam-java-payments-sdk
src/main/java/com/payu/sdk/model/TransactionResponse.java
// Path: src/main/java/com/payu/sdk/utils/xml/MapAdditionalInfoAdapter.java // public class MapAdditionalInfoAdapter extends XmlAdapter<MapAdditionalInfoElement, Map<String, String>> { // // @Override // public MapAdditionalInfoElement marshal(Map<String, String> v) throws Exception { // // if (v == null || v.isE...
import javax.xml.bind.annotation.XmlRootElement; import javax.xml.bind.annotation.adapters.XmlJavaTypeAdapter; import com.payu.sdk.utils.xml.DateAdapter; import com.payu.sdk.utils.xml.MapAdditionalInfoAdapter; import com.payu.sdk.utils.xml.MapExtraParameterAdapter; import java.io.Serializable; import java.util.Date; im...
/** * The MIT License (MIT) * * Copyright (c) 2016 developers-payu-latam * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal * in the Software without restriction, including without limitation the rights ...
// Path: src/main/java/com/payu/sdk/utils/xml/MapAdditionalInfoAdapter.java // public class MapAdditionalInfoAdapter extends XmlAdapter<MapAdditionalInfoElement, Map<String, String>> { // // @Override // public MapAdditionalInfoElement marshal(Map<String, String> v) throws Exception { // // if (v == null || v.isE...
@XmlJavaTypeAdapter(MapAdditionalInfoAdapter.class)
developers-payu-latam/payu-latam-java-payments-sdk
src/main/java/com/payu/sdk/utils/CommonRequestUtil.java
// Path: src/main/java/com/payu/sdk/model/PaymentMethod.java // @Deprecated // public enum PaymentMethod { // // VISA(PaymentMethodType.CREDIT_CARD), // // AMEX(PaymentMethodType.CREDIT_CARD), // // HIPERCARD(PaymentMethodType.CREDIT_CARD), // // DINERS(PaymentMethodType.CREDIT_CARD), // // MASTERCARD(Paymen...
import java.util.Set; import com.payu.sdk.constants.Constants; import com.payu.sdk.exceptions.InvalidParametersException; import com.payu.sdk.model.AdditionalValue; import com.payu.sdk.model.Currency; import com.payu.sdk.model.PaymentMethod; import java.math.BigDecimal; import java.nio.charset.StandardCharsets; import ...
* * @param enumClass The enum class * @param parameters * The parameters to be sent to the server * @param paramName * the parameter to get * @return The Enum value parameter it got * @throws InvalidParametersException */ public static <E extends Enum<E>> E getEnumValueParameter...
// Path: src/main/java/com/payu/sdk/model/PaymentMethod.java // @Deprecated // public enum PaymentMethod { // // VISA(PaymentMethodType.CREDIT_CARD), // // AMEX(PaymentMethodType.CREDIT_CARD), // // HIPERCARD(PaymentMethodType.CREDIT_CARD), // // DINERS(PaymentMethodType.CREDIT_CARD), // // MASTERCARD(Paymen...
public static PaymentMethod getPaymentMethodParameter(Map<String, String> parameters, String paramName){
developers-payu-latam/payu-latam-java-payments-sdk
src/main/java/com/payu/sdk/payments/model/ConfirmationPageRequest.java
// Path: src/main/java/com/payu/sdk/constants/Resources.java // public interface Resources { // // /** // * The API request methods // */ // enum RequestMethod { // /** The get request method. */ // GET, // /** The post request method. */ // POST, // /** The delete request method. */ // DELETE, // ...
import com.payu.sdk.constants.Resources; import com.payu.sdk.model.request.CommandRequest; import javax.xml.bind.annotation.XmlAccessType; import javax.xml.bind.annotation.XmlAccessorType; import javax.xml.bind.annotation.XmlElement; import javax.xml.bind.annotation.XmlRootElement;
/** * The MIT License (MIT) * <p> * Copyright (c) 2016 developers-payu-latam * <p> * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal * in the Software without restriction, including without limitation the...
// Path: src/main/java/com/payu/sdk/constants/Resources.java // public interface Resources { // // /** // * The API request methods // */ // enum RequestMethod { // /** The get request method. */ // GET, // /** The post request method. */ // POST, // /** The delete request method. */ // DELETE, // ...
Resources.RequestMethod requestMethod) {
developers-payu-latam/payu-latam-java-payments-sdk
src/main/java/com/payu/sdk/model/response/Response.java
// Path: src/main/java/com/payu/sdk/payments/model/MassiveTokenPaymentsResponse.java // @XmlRootElement(name = "transactionTokenBatchResponse") // @XmlAccessorType(XmlAccessType.FIELD) // public class MassiveTokenPaymentsResponse extends Response { // // /** The generated serial version Id */ // private static final...
import com.payu.sdk.exceptions.PayUException; import com.payu.sdk.exceptions.SDKException.ErrorCode; import com.payu.sdk.payments.model.MassiveTokenPaymentsResponse; import com.payu.sdk.payments.model.PaymentResponse; import com.payu.sdk.reporting.model.ReportingResponse; import com.payu.sdk.utils.JaxbUtil; import java...
/** * Converts a string response to the response * * @param xmlData * The response in a xml format * @return The response object * @throws PayUException */ protected static Response fromBaseXml(Response response, String xmlData) throws PayUException { try { // Response code Respo...
// Path: src/main/java/com/payu/sdk/payments/model/MassiveTokenPaymentsResponse.java // @XmlRootElement(name = "transactionTokenBatchResponse") // @XmlAccessorType(XmlAccessType.FIELD) // public class MassiveTokenPaymentsResponse extends Response { // // /** The generated serial version Id */ // private static final...
baseResponse = JaxbUtil.convertXmlToJava(MassiveTokenPaymentsResponse.class, xmlData);
dubasdey/MQQueueMonitor
src/main/java/org/erc/qmm/mq/agent/Agent.java
// Path: src/main/java/org/erc/qmm/mq/MQUtils.java // public abstract class MQUtils { // // /** // * Builds the manager. // * // * @param config the config // * @return the MQ queue manager // * @throws MQException the MQ exception // */ // public static MQQueueManager buildManager(QueueConfig config) t...
import java.io.IOException; import java.util.List; import java.util.Vector; import org.erc.qmm.mq.MQUtils; import com.ibm.mq.MQException; import com.ibm.mq.MQGetMessageOptions; import com.ibm.mq.MQMessage; import com.ibm.mq.MQPutMessageOptions; import com.ibm.mq.MQQueue; import com.ibm.mq.MQQueueManager;
package org.erc.qmm.mq.agent; /** * The Class Agent. */ public class Agent { /** The pmo. */ private final MQPutMessageOptions pmo = new MQPutMessageOptions(); /** The gmo. */ private final MQGetMessageOptions gmo = new MQGetMessageOptions(); /** The Constant modelQueueName. */ private static final Stri...
// Path: src/main/java/org/erc/qmm/mq/MQUtils.java // public abstract class MQUtils { // // /** // * Builds the manager. // * // * @param config the config // * @return the MQ queue manager // * @throws MQException the MQ exception // */ // public static MQQueueManager buildManager(QueueConfig config) t...
qmanager = MQUtils.buildManager(host,port,channel,manager);
dubasdey/MQQueueMonitor
src/main/java/org/erc/qmm/config/ConfigManager.java
// Path: src/main/java/org/erc/qmm/util/FileUtils.java // public abstract class FileUtils { // // /** // * Copy. // * // * @param source the source // * @param dest the dest // * @throws IOException Signals that an I/O exception has occurred. // */ // public static void copy(File source, File dest) thro...
import java.io.File; import java.io.IOException; import java.util.ArrayList; import java.util.List; import javax.xml.parsers.DocumentBuilder; import javax.xml.parsers.DocumentBuilderFactory; import javax.xml.parsers.ParserConfigurationException; import org.erc.qmm.util.FileUtils; import org.w3c.dom.Document; import org...
Node node = queuesList.item(i); if (node.getNodeType() == Node.ELEMENT_NODE) { Element eElement = (Element) node; QueueConfig queue = new QueueConfig(); queue.setDesc(eElement.getAttribute("desc")); queue.setHost(getText(eElement,"host")); queue.setPort(getInt(eElement,"port")); qu...
// Path: src/main/java/org/erc/qmm/util/FileUtils.java // public abstract class FileUtils { // // /** // * Copy. // * // * @param source the source // * @param dest the dest // * @throws IOException Signals that an I/O exception has occurred. // */ // public static void copy(File source, File dest) thro...
FileUtils.copy(xmlFile, new File("config/config.xml.bak"));
jochen777/jFormchecker
src/main/java/de/jformchecker/criteria/Range.java
// Path: src/main/java/de/jformchecker/Criterion.java // @FunctionalInterface // public interface Criterion { // /** // * Tests whether the specified value satisfies this criterion. // * // * @param value // * to be tested against this criterion. // * @return a ValidationResult which holds true o...
import de.jformchecker.Criterion; import de.jformchecker.FormCheckerElement;
package de.jformchecker.criteria; /** * Checks that value is within the given range. * * Based on work of armandino (at) gmail.com */ public final class Range implements Criterion { private int min; private int max; Range(int min, int max) { this.min = min; this.max = max; } @Override
// Path: src/main/java/de/jformchecker/Criterion.java // @FunctionalInterface // public interface Criterion { // /** // * Tests whether the specified value satisfies this criterion. // * // * @param value // * to be tested against this criterion. // * @return a ValidationResult which holds true o...
public ValidationResult validate(FormCheckerElement value) {
jochen777/jFormchecker
src/main/java/de/jformchecker/FormCheckerElement.java
// Path: src/main/java/de/jformchecker/criteria/ValidationResult.java // public class ValidationResult { // // boolean isValid = false; // // // caching: // private static ValidationResult okResult = new ValidationResult(true, "", null, null); // // public boolean isValid() { // return isValid; // } // // ...
import java.util.List; import java.util.Map; import de.jformchecker.criteria.ValidationResult; import de.jformchecker.message.MessageSource; import de.jformchecker.request.Request; import de.jformchecker.validator.Validator;
package de.jformchecker; /** * Interface for Input-Elements handled by formchecker * * @author jochen * */ public interface FormCheckerElement { // RFE: check, if some methods can be protected // get internal name of this input-element public String getName(); // set internal name public void setName(...
// Path: src/main/java/de/jformchecker/criteria/ValidationResult.java // public class ValidationResult { // // boolean isValid = false; // // // caching: // private static ValidationResult okResult = new ValidationResult(true, "", null, null); // // public boolean isValid() { // return isValid; // } // // ...
public void init(Request req, boolean firstrun, Validator validator);
jochen777/jFormchecker
src/main/java/de/jformchecker/FormCheckerElement.java
// Path: src/main/java/de/jformchecker/criteria/ValidationResult.java // public class ValidationResult { // // boolean isValid = false; // // // caching: // private static ValidationResult okResult = new ValidationResult(true, "", null, null); // // public boolean isValid() { // return isValid; // } // // ...
import java.util.List; import java.util.Map; import de.jformchecker.criteria.ValidationResult; import de.jformchecker.message.MessageSource; import de.jformchecker.request.Request; import de.jformchecker.validator.Validator;
package de.jformchecker; /** * Interface for Input-Elements handled by formchecker * * @author jochen * */ public interface FormCheckerElement { // RFE: check, if some methods can be protected // get internal name of this input-element public String getName(); // set internal name public void setName(...
// Path: src/main/java/de/jformchecker/criteria/ValidationResult.java // public class ValidationResult { // // boolean isValid = false; // // // caching: // private static ValidationResult okResult = new ValidationResult(true, "", null, null); // // public boolean isValid() { // return isValid; // } // // ...
public void init(Request req, boolean firstrun, Validator validator);
jochen777/jFormchecker
src/main/java/de/jformchecker/FormCheckerElement.java
// Path: src/main/java/de/jformchecker/criteria/ValidationResult.java // public class ValidationResult { // // boolean isValid = false; // // // caching: // private static ValidationResult okResult = new ValidationResult(true, "", null, null); // // public boolean isValid() { // return isValid; // } // // ...
import java.util.List; import java.util.Map; import de.jformchecker.criteria.ValidationResult; import de.jformchecker.message.MessageSource; import de.jformchecker.request.Request; import de.jformchecker.validator.Validator;
package de.jformchecker; /** * Interface for Input-Elements handled by formchecker * * @author jochen * */ public interface FormCheckerElement { // RFE: check, if some methods can be protected // get internal name of this input-element public String getName(); // set internal name public void setName(...
// Path: src/main/java/de/jformchecker/criteria/ValidationResult.java // public class ValidationResult { // // boolean isValid = false; // // // caching: // private static ValidationResult okResult = new ValidationResult(true, "", null, null); // // public boolean isValid() { // return isValid; // } // // ...
public ValidationResult getValidationResult();
jochen777/jFormchecker
src/main/java/de/jformchecker/FormCheckerElement.java
// Path: src/main/java/de/jformchecker/criteria/ValidationResult.java // public class ValidationResult { // // boolean isValid = false; // // // caching: // private static ValidationResult okResult = new ValidationResult(true, "", null, null); // // public boolean isValid() { // return isValid; // } // // ...
import java.util.List; import java.util.Map; import de.jformchecker.criteria.ValidationResult; import de.jformchecker.message.MessageSource; import de.jformchecker.request.Request; import de.jformchecker.validator.Validator;
package de.jformchecker; /** * Interface for Input-Elements handled by formchecker * * @author jochen * */ public interface FormCheckerElement { // RFE: check, if some methods can be protected // get internal name of this input-element public String getName(); // set internal name public void setName(...
// Path: src/main/java/de/jformchecker/criteria/ValidationResult.java // public class ValidationResult { // // boolean isValid = false; // // // caching: // private static ValidationResult okResult = new ValidationResult(true, "", null, null); // // public boolean isValid() { // return isValid; // } // // ...
public String getInputTag(Map<String, String> attributes, MessageSource messageSource, boolean html5Validation);
jochen777/jFormchecker
src/main/java/de/jformchecker/elements/SimpleLabel.java
// Path: src/main/java/de/jformchecker/FormCheckerElement.java // public interface FormCheckerElement { // // // RFE: check, if some methods can be protected // // // get internal name of this input-element // public String getName(); // // // set internal name // public void setName(String name); // // // ...
import java.util.Map; import de.jformchecker.FormCheckerElement; import de.jformchecker.request.Request; import de.jformchecker.validator.Validator;
package de.jformchecker.elements; public class SimpleLabel extends AbstractInput<SimpleLabel> implements FormCheckerElement { public static SimpleLabel build(String name) { SimpleLabel i = new SimpleLabel(); i.name = name; return i; } @Override public String getValue() { return this.getDescription(); ...
// Path: src/main/java/de/jformchecker/FormCheckerElement.java // public interface FormCheckerElement { // // // RFE: check, if some methods can be protected // // // get internal name of this input-element // public String getName(); // // // set internal name // public void setName(String name); // // // ...
public void init(Request request, boolean firstRun, Validator validator) {
jochen777/jFormchecker
src/main/java/de/jformchecker/elements/SimpleLabel.java
// Path: src/main/java/de/jformchecker/FormCheckerElement.java // public interface FormCheckerElement { // // // RFE: check, if some methods can be protected // // // get internal name of this input-element // public String getName(); // // // set internal name // public void setName(String name); // // // ...
import java.util.Map; import de.jformchecker.FormCheckerElement; import de.jformchecker.request.Request; import de.jformchecker.validator.Validator;
package de.jformchecker.elements; public class SimpleLabel extends AbstractInput<SimpleLabel> implements FormCheckerElement { public static SimpleLabel build(String name) { SimpleLabel i = new SimpleLabel(); i.name = name; return i; } @Override public String getValue() { return this.getDescription(); ...
// Path: src/main/java/de/jformchecker/FormCheckerElement.java // public interface FormCheckerElement { // // // RFE: check, if some methods can be protected // // // get internal name of this input-element // public String getName(); // // // set internal name // public void setName(String name); // // // ...
public void init(Request request, boolean firstRun, Validator validator) {
jochen777/jFormchecker
src/main/java/de/jformchecker/criteria/MinLength.java
// Path: src/main/java/de/jformchecker/Criterion.java // @FunctionalInterface // public interface Criterion { // /** // * Tests whether the specified value satisfies this criterion. // * // * @param value // * to be tested against this criterion. // * @return a ValidationResult which holds true o...
import de.jformchecker.Criterion; import de.jformchecker.FormCheckerElement;
package de.jformchecker.criteria; /** * Checks that value is not less than the specified minimum. * * Based on work of armandino (at) gmail.com */ public final class MinLength implements Criterion { private int minLength; MinLength(int minLength) { this.minLength = minLength; } @Override
// Path: src/main/java/de/jformchecker/Criterion.java // @FunctionalInterface // public interface Criterion { // /** // * Tests whether the specified value satisfies this criterion. // * // * @param value // * to be tested against this criterion. // * @return a ValidationResult which holds true o...
public ValidationResult validate(FormCheckerElement value) {
jochen777/jFormchecker
src/main/java/de/jformchecker/validator/DefaultValidator.java
// Path: src/main/java/de/jformchecker/Criterion.java // @FunctionalInterface // public interface Criterion { // /** // * Tests whether the specified value satisfies this criterion. // * // * @param value // * to be tested against this criterion. // * @return a ValidationResult which holds true o...
import de.jformchecker.Criterion; import de.jformchecker.FormCheckerElement; import de.jformchecker.criteria.ValidationResult;
package de.jformchecker.validator; /** * Validator, that checks a complete form * * @author jochen * */ public class DefaultValidator implements Validator { /* * (non-Javadoc) * * @see de.jformchecker.validator.Validator#validate(de.jformchecker. * FormCheckerElement) */ @Override
// Path: src/main/java/de/jformchecker/Criterion.java // @FunctionalInterface // public interface Criterion { // /** // * Tests whether the specified value satisfies this criterion. // * // * @param value // * to be tested against this criterion. // * @return a ValidationResult which holds true o...
public ValidationResult validate(FormCheckerElement elem) {
jochen777/jFormchecker
src/main/java/de/jformchecker/validator/DefaultValidator.java
// Path: src/main/java/de/jformchecker/Criterion.java // @FunctionalInterface // public interface Criterion { // /** // * Tests whether the specified value satisfies this criterion. // * // * @param value // * to be tested against this criterion. // * @return a ValidationResult which holds true o...
import de.jformchecker.Criterion; import de.jformchecker.FormCheckerElement; import de.jformchecker.criteria.ValidationResult;
package de.jformchecker.validator; /** * Validator, that checks a complete form * * @author jochen * */ public class DefaultValidator implements Validator { /* * (non-Javadoc) * * @see de.jformchecker.validator.Validator#validate(de.jformchecker. * FormCheckerElement) */ @Override
// Path: src/main/java/de/jformchecker/Criterion.java // @FunctionalInterface // public interface Criterion { // /** // * Tests whether the specified value satisfies this criterion. // * // * @param value // * to be tested against this criterion. // * @return a ValidationResult which holds true o...
public ValidationResult validate(FormCheckerElement elem) {
jochen777/jFormchecker
src/main/java/de/jformchecker/validator/DefaultValidator.java
// Path: src/main/java/de/jformchecker/Criterion.java // @FunctionalInterface // public interface Criterion { // /** // * Tests whether the specified value satisfies this criterion. // * // * @param value // * to be tested against this criterion. // * @return a ValidationResult which holds true o...
import de.jformchecker.Criterion; import de.jformchecker.FormCheckerElement; import de.jformchecker.criteria.ValidationResult;
package de.jformchecker.validator; /** * Validator, that checks a complete form * * @author jochen * */ public class DefaultValidator implements Validator { /* * (non-Javadoc) * * @see de.jformchecker.validator.Validator#validate(de.jformchecker. * FormCheckerElement) */ @Override public Validati...
// Path: src/main/java/de/jformchecker/Criterion.java // @FunctionalInterface // public interface Criterion { // /** // * Tests whether the specified value satisfies this criterion. // * // * @param value // * to be tested against this criterion. // * @return a ValidationResult which holds true o...
for (Criterion criterion : elem.getCriteria()) {
jochen777/jFormchecker
src/test/java/de/jformchecker/test/ValidationErrorTest.java
// Path: src/main/java/de/jformchecker/criteria/ValidationResult.java // public class ValidationResult { // // boolean isValid = false; // // // caching: // private static ValidationResult okResult = new ValidationResult(true, "", null, null); // // public boolean isValid() { // return isValid; // } // // ...
import org.junit.Assert; import org.junit.Test; import de.jformchecker.criteria.ValidationResult; import de.jformchecker.elements.TextInput; import de.jformchecker.validator.DefaultValidator;
package de.jformchecker.test; /** * Tests the behaviour of validation errors * * @author jochen * */ public class ValidationErrorTest { // Tests if a not translated comes @Test public void testMessageKeyError() { String errorMsg = "ErrorMsg"; boolean translateMsg = false;
// Path: src/main/java/de/jformchecker/criteria/ValidationResult.java // public class ValidationResult { // // boolean isValid = false; // // // caching: // private static ValidationResult okResult = new ValidationResult(true, "", null, null); // // public boolean isValid() { // return isValid; // } // // ...
TextInput ti = getFormElement(translateMsg, errorMsg);
jochen777/jFormchecker
src/test/java/de/jformchecker/test/ValidationErrorTest.java
// Path: src/main/java/de/jformchecker/criteria/ValidationResult.java // public class ValidationResult { // // boolean isValid = false; // // // caching: // private static ValidationResult okResult = new ValidationResult(true, "", null, null); // // public boolean isValid() { // return isValid; // } // // ...
import org.junit.Assert; import org.junit.Test; import de.jformchecker.criteria.ValidationResult; import de.jformchecker.elements.TextInput; import de.jformchecker.validator.DefaultValidator;
package de.jformchecker.test; /** * Tests the behaviour of validation errors * * @author jochen * */ public class ValidationErrorTest { // Tests if a not translated comes @Test public void testMessageKeyError() { String errorMsg = "ErrorMsg"; boolean translateMsg = false; TextInput ti = getFormEleme...
// Path: src/main/java/de/jformchecker/criteria/ValidationResult.java // public class ValidationResult { // // boolean isValid = false; // // // caching: // private static ValidationResult okResult = new ValidationResult(true, "", null, null); // // public boolean isValid() { // return isValid; // } // // ...
ti.init(key -> "NotCorrect", firstRun, new DefaultValidator());
jochen777/jFormchecker
src/test/java/de/jformchecker/test/ValidationErrorTest.java
// Path: src/main/java/de/jformchecker/criteria/ValidationResult.java // public class ValidationResult { // // boolean isValid = false; // // // caching: // private static ValidationResult okResult = new ValidationResult(true, "", null, null); // // public boolean isValid() { // return isValid; // } // // ...
import org.junit.Assert; import org.junit.Test; import de.jformchecker.criteria.ValidationResult; import de.jformchecker.elements.TextInput; import de.jformchecker.validator.DefaultValidator;
package de.jformchecker.test; /** * Tests the behaviour of validation errors * * @author jochen * */ public class ValidationErrorTest { // Tests if a not translated comes @Test public void testMessageKeyError() { String errorMsg = "ErrorMsg"; boolean translateMsg = false; TextInput ti = getFormEleme...
// Path: src/main/java/de/jformchecker/criteria/ValidationResult.java // public class ValidationResult { // // boolean isValid = false; // // // caching: // private static ValidationResult okResult = new ValidationResult(true, "", null, null); // // public boolean isValid() { // return isValid; // } // // ...
translatedMessage ? ValidationResult.failWithTranslated(errorMsg) :
jochen777/jFormchecker
src/main/java/de/jformchecker/message/MessageSource.java
// Path: src/main/java/de/jformchecker/criteria/ValidationResult.java // public class ValidationResult { // // boolean isValid = false; // // // caching: // private static ValidationResult okResult = new ValidationResult(true, "", null, null); // // public boolean isValid() { // return isValid; // } // // ...
import de.jformchecker.criteria.ValidationResult;
package de.jformchecker.message; /** * Source for mssages that should be displayed typically coming from a property * file holding localized messages * * @author jpier * */ @FunctionalInterface public interface MessageSource { public String getMessage(String key); public default String getSafeMessage(Strin...
// Path: src/main/java/de/jformchecker/criteria/ValidationResult.java // public class ValidationResult { // // boolean isValid = false; // // // caching: // private static ValidationResult okResult = new ValidationResult(true, "", null, null); // // public boolean isValid() { // return isValid; // } // // ...
public default String getMessage(ValidationResult vr) {
jochen777/jFormchecker
src/main/java/de/jformchecker/criteria/CaseInsensitiveRegex.java
// Path: src/main/java/de/jformchecker/Criterion.java // @FunctionalInterface // public interface Criterion { // /** // * Tests whether the specified value satisfies this criterion. // * // * @param value // * to be tested against this criterion. // * @return a ValidationResult which holds true o...
import java.util.regex.Pattern; import de.jformchecker.Criterion; import de.jformchecker.FormCheckerElement;
package de.jformchecker.criteria; /** * Checks if a string matches a regular expression in a case insensitive way. * RFE: Avoid doublication with Regex.java * * Based on work of armandino (at) gmail.com */ public class CaseInsensitiveRegex implements Criterion { private Pattern pattern; private String error...
// Path: src/main/java/de/jformchecker/Criterion.java // @FunctionalInterface // public interface Criterion { // /** // * Tests whether the specified value satisfies this criterion. // * // * @param value // * to be tested against this criterion. // * @return a ValidationResult which holds true o...
public ValidationResult validate(FormCheckerElement value) {
jochen777/jFormchecker
src/main/java/de/jformchecker/elements/HTMLSnippet.java
// Path: src/main/java/de/jformchecker/FormCheckerElement.java // public interface FormCheckerElement { // // // RFE: check, if some methods can be protected // // // get internal name of this input-element // public String getName(); // // // set internal name // public void setName(String name); // // // ...
import java.util.Map; import de.jformchecker.FormCheckerElement; import de.jformchecker.request.Request; import de.jformchecker.validator.Validator;
package de.jformchecker.elements; public class HTMLSnippet extends AbstractInput<HTMLSnippet> implements FormCheckerElement { String html; public static HTMLSnippet build(String name) { HTMLSnippet i = new HTMLSnippet(); i.name = name; return i; } public HTMLSnippet setHTML(String html) { this.html = ...
// Path: src/main/java/de/jformchecker/FormCheckerElement.java // public interface FormCheckerElement { // // // RFE: check, if some methods can be protected // // // get internal name of this input-element // public String getName(); // // // set internal name // public void setName(String name); // // // ...
public void init(Request request, boolean firstRun, Validator validator) {
jochen777/jFormchecker
src/main/java/de/jformchecker/elements/HTMLSnippet.java
// Path: src/main/java/de/jformchecker/FormCheckerElement.java // public interface FormCheckerElement { // // // RFE: check, if some methods can be protected // // // get internal name of this input-element // public String getName(); // // // set internal name // public void setName(String name); // // // ...
import java.util.Map; import de.jformchecker.FormCheckerElement; import de.jformchecker.request.Request; import de.jformchecker.validator.Validator;
package de.jformchecker.elements; public class HTMLSnippet extends AbstractInput<HTMLSnippet> implements FormCheckerElement { String html; public static HTMLSnippet build(String name) { HTMLSnippet i = new HTMLSnippet(); i.name = name; return i; } public HTMLSnippet setHTML(String html) { this.html = ...
// Path: src/main/java/de/jformchecker/FormCheckerElement.java // public interface FormCheckerElement { // // // RFE: check, if some methods can be protected // // // get internal name of this input-element // public String getName(); // // // set internal name // public void setName(String name); // // // ...
public void init(Request request, boolean firstRun, Validator validator) {
jochen777/jFormchecker
src/main/java/de/jformchecker/elements/SelectInput.java
// Path: src/main/java/de/jformchecker/FormCheckerElement.java // public interface FormCheckerElement { // // // RFE: check, if some methods can be protected // // // get internal name of this input-element // public String getName(); // // // set internal name // public void setName(String name); // // // ...
import java.util.ArrayList; import java.util.LinkedHashMap; import java.util.List; import java.util.Map; import de.jformchecker.FormCheckerElement; import de.jformchecker.TagAttributes;
@Deprecated public static SelectInput build(String name, LinkedHashMap<String, String> possibleNames) { SelectInput si = SelectInput.build(name); si.setPossibleValues(possibleNames); return si; } // convenience method public static SelectInput build(String name, String keys[], String values[]) { SelectInp...
// Path: src/main/java/de/jformchecker/FormCheckerElement.java // public interface FormCheckerElement { // // // RFE: check, if some methods can be protected // // // get internal name of this input-element // public String getName(); // // // set internal name // public void setName(String name); // // // ...
TagAttributes tagAttributes = new TagAttributes(attributes);
jochen777/jFormchecker
src/main/java/de/jformchecker/criteria/AbstractNumberComparingCriterion.java
// Path: src/main/java/de/jformchecker/Criterion.java // @FunctionalInterface // public interface Criterion { // /** // * Tests whether the specified value satisfies this criterion. // * // * @param value // * to be tested against this criterion. // * @return a ValidationResult which holds true o...
import de.jformchecker.Criterion; import de.jformchecker.FormCheckerElement;
package de.jformchecker.criteria; /** * provides some utils for criterias, that compare numbers (currentyl: min/max) * * @author jpier * */ public abstract class AbstractNumberComparingCriterion implements Criterion { @Override
// Path: src/main/java/de/jformchecker/Criterion.java // @FunctionalInterface // public interface Criterion { // /** // * Tests whether the specified value satisfies this criterion. // * // * @param value // * to be tested against this criterion. // * @return a ValidationResult which holds true o...
public ValidationResult validate(FormCheckerElement value) {
jochen777/jFormchecker
src/main/java/de/jformchecker/criteria/ExactLength.java
// Path: src/main/java/de/jformchecker/Criterion.java // @FunctionalInterface // public interface Criterion { // /** // * Tests whether the specified value satisfies this criterion. // * // * @param value // * to be tested against this criterion. // * @return a ValidationResult which holds true o...
import de.jformchecker.Criterion; import de.jformchecker.FormCheckerElement;
package de.jformchecker.criteria; /** * Checks that the length of the value is equal to the given length. * * Based on work of armandino (at) gmail.com */ public final class ExactLength implements Criterion { private int length; ExactLength(int length) { this.length = length; } @Override
// Path: src/main/java/de/jformchecker/Criterion.java // @FunctionalInterface // public interface Criterion { // /** // * Tests whether the specified value satisfies this criterion. // * // * @param value // * to be tested against this criterion. // * @return a ValidationResult which holds true o...
public ValidationResult validate(FormCheckerElement value) {
jochen777/jFormchecker
src/main/java/de/jformchecker/criteria/Number.java
// Path: src/main/java/de/jformchecker/Criterion.java // @FunctionalInterface // public interface Criterion { // /** // * Tests whether the specified value satisfies this criterion. // * // * @param value // * to be tested against this criterion. // * @return a ValidationResult which holds true o...
import de.jformchecker.Criterion; import de.jformchecker.FormCheckerElement;
package de.jformchecker.criteria; /** * Checks that value is a number. * * Based on work of armandino (at) gmail.com */ public final class Number implements Criterion { Number() { } @Override
// Path: src/main/java/de/jformchecker/Criterion.java // @FunctionalInterface // public interface Criterion { // /** // * Tests whether the specified value satisfies this criterion. // * // * @param value // * to be tested against this criterion. // * @return a ValidationResult which holds true o...
public ValidationResult validate(FormCheckerElement value) {
jochen777/jFormchecker
src/main/java/de/jformchecker/criteria/Length.java
// Path: src/main/java/de/jformchecker/Criterion.java // @FunctionalInterface // public interface Criterion { // /** // * Tests whether the specified value satisfies this criterion. // * // * @param value // * to be tested against this criterion. // * @return a ValidationResult which holds true o...
import de.jformchecker.Criterion; import de.jformchecker.FormCheckerElement;
package de.jformchecker.criteria; /** * Checks that the length of the value is within the given range. * * Based on work of armandino (at) gmail.com */ public final class Length implements Criterion { private int min; private int max; Length(int min, int max) { this.min = min; this.max = max; } @Overr...
// Path: src/main/java/de/jformchecker/Criterion.java // @FunctionalInterface // public interface Criterion { // /** // * Tests whether the specified value satisfies this criterion. // * // * @param value // * to be tested against this criterion. // * @return a ValidationResult which holds true o...
public ValidationResult validate(FormCheckerElement value) {
jochen777/jFormchecker
src/main/java/de/jformchecker/elements/PasswordInput.java
// Path: src/main/java/de/jformchecker/FormCheckerElement.java // public interface FormCheckerElement { // // // RFE: check, if some methods can be protected // // // get internal name of this input-element // public String getName(); // // // set internal name // public void setName(String name); // // // ...
import java.util.Map; import de.jformchecker.FormCheckerElement; import de.jformchecker.TagAttributes; import de.jformchecker.message.MessageSource;
package de.jformchecker.elements; public class PasswordInput extends TextInput implements FormCheckerElement { public static PasswordInput build(String name) { PasswordInput i = new PasswordInput(); i.name = name; return i; } @Override
// Path: src/main/java/de/jformchecker/FormCheckerElement.java // public interface FormCheckerElement { // // // RFE: check, if some methods can be protected // // // get internal name of this input-element // public String getName(); // // // set internal name // public void setName(String name); // // // ...
public String getInputTag(Map<String, String> attributes, MessageSource messageSource, boolean html5Validation) {
jochen777/jFormchecker
src/main/java/de/jformchecker/elements/PasswordInput.java
// Path: src/main/java/de/jformchecker/FormCheckerElement.java // public interface FormCheckerElement { // // // RFE: check, if some methods can be protected // // // get internal name of this input-element // public String getName(); // // // set internal name // public void setName(String name); // // // ...
import java.util.Map; import de.jformchecker.FormCheckerElement; import de.jformchecker.TagAttributes; import de.jformchecker.message.MessageSource;
package de.jformchecker.elements; public class PasswordInput extends TextInput implements FormCheckerElement { public static PasswordInput build(String name) { PasswordInput i = new PasswordInput(); i.name = name; return i; } @Override public String getInputTag(Map<String, String> attributes, MessageSour...
// Path: src/main/java/de/jformchecker/FormCheckerElement.java // public interface FormCheckerElement { // // // RFE: check, if some methods can be protected // // // get internal name of this input-element // public String getName(); // // // set internal name // public void setName(String name); // // // ...
TagAttributes tagAttributes = new TagAttributes(attributes);
jochen777/jFormchecker
src/main/java/de/jformchecker/themes/BasicBootstrapFormBuilder.java
// Path: src/main/java/de/jformchecker/FormCheckerElement.java // public interface FormCheckerElement { // // // RFE: check, if some methods can be protected // // // get internal name of this input-element // public String getName(); // // // set internal name // public void setName(String name); // // // ...
import de.jformchecker.FormCheckerElement; import de.jformchecker.TagAttributes; import de.jformchecker.Wrapper;
package de.jformchecker.themes; public class BasicBootstrapFormBuilder extends BasicFormBuilder { @Override
// Path: src/main/java/de/jformchecker/FormCheckerElement.java // public interface FormCheckerElement { // // // RFE: check, if some methods can be protected // // // get internal name of this input-element // public String getName(); // // // set internal name // public void setName(String name); // // // ...
public TagAttributes getFormAttributes() {
jochen777/jFormchecker
src/main/java/de/jformchecker/themes/BasicBootstrapFormBuilder.java
// Path: src/main/java/de/jformchecker/FormCheckerElement.java // public interface FormCheckerElement { // // // RFE: check, if some methods can be protected // // // get internal name of this input-element // public String getName(); // // // set internal name // public void setName(String name); // // // ...
import de.jformchecker.FormCheckerElement; import de.jformchecker.TagAttributes; import de.jformchecker.Wrapper;
package de.jformchecker.themes; public class BasicBootstrapFormBuilder extends BasicFormBuilder { @Override public TagAttributes getFormAttributes() { TagAttributes attributes = new TagAttributes(); return attributes; } @Override
// Path: src/main/java/de/jformchecker/FormCheckerElement.java // public interface FormCheckerElement { // // // RFE: check, if some methods can be protected // // // get internal name of this input-element // public String getName(); // // // set internal name // public void setName(String name); // // // ...
public Wrapper getWrapperForInput(FormCheckerElement elem) {
jochen777/jFormchecker
src/main/java/de/jformchecker/themes/BasicBootstrapFormBuilder.java
// Path: src/main/java/de/jformchecker/FormCheckerElement.java // public interface FormCheckerElement { // // // RFE: check, if some methods can be protected // // // get internal name of this input-element // public String getName(); // // // set internal name // public void setName(String name); // // // ...
import de.jformchecker.FormCheckerElement; import de.jformchecker.TagAttributes; import de.jformchecker.Wrapper;
package de.jformchecker.themes; public class BasicBootstrapFormBuilder extends BasicFormBuilder { @Override public TagAttributes getFormAttributes() { TagAttributes attributes = new TagAttributes(); return attributes; } @Override
// Path: src/main/java/de/jformchecker/FormCheckerElement.java // public interface FormCheckerElement { // // // RFE: check, if some methods can be protected // // // get internal name of this input-element // public String getName(); // // // set internal name // public void setName(String name); // // // ...
public Wrapper getWrapperForInput(FormCheckerElement elem) {
jochen777/jFormchecker
src/main/java/de/jformchecker/security/XSRFBuilder.java
// Path: src/main/java/de/jformchecker/request/Request.java // @FunctionalInterface // public interface Request { // public String getParameter(String name); // } // // Path: src/main/java/de/jformchecker/request/SessionGet.java // @FunctionalInterface // public interface SessionGet { // public Object getAttribute(S...
import java.security.SecureRandom; import java.util.Base64; import com.coverity.security.Escape; import de.jformchecker.request.Request; import de.jformchecker.request.SessionGet; import de.jformchecker.request.SessionSet;
package de.jformchecker.security; public class XSRFBuilder { private final SecureRandom random = new SecureRandom();
// Path: src/main/java/de/jformchecker/request/Request.java // @FunctionalInterface // public interface Request { // public String getParameter(String name); // } // // Path: src/main/java/de/jformchecker/request/SessionGet.java // @FunctionalInterface // public interface SessionGet { // public Object getAttribute(S...
public String buildCSRFTokens(Request req, boolean firstRun, SessionGet sessionGet, SessionSet sessionSet) {
jochen777/jFormchecker
src/main/java/de/jformchecker/security/XSRFBuilder.java
// Path: src/main/java/de/jformchecker/request/Request.java // @FunctionalInterface // public interface Request { // public String getParameter(String name); // } // // Path: src/main/java/de/jformchecker/request/SessionGet.java // @FunctionalInterface // public interface SessionGet { // public Object getAttribute(S...
import java.security.SecureRandom; import java.util.Base64; import com.coverity.security.Escape; import de.jformchecker.request.Request; import de.jformchecker.request.SessionGet; import de.jformchecker.request.SessionSet;
package de.jformchecker.security; public class XSRFBuilder { private final SecureRandom random = new SecureRandom();
// Path: src/main/java/de/jformchecker/request/Request.java // @FunctionalInterface // public interface Request { // public String getParameter(String name); // } // // Path: src/main/java/de/jformchecker/request/SessionGet.java // @FunctionalInterface // public interface SessionGet { // public Object getAttribute(S...
public String buildCSRFTokens(Request req, boolean firstRun, SessionGet sessionGet, SessionSet sessionSet) {
jochen777/jFormchecker
src/main/java/de/jformchecker/security/XSRFBuilder.java
// Path: src/main/java/de/jformchecker/request/Request.java // @FunctionalInterface // public interface Request { // public String getParameter(String name); // } // // Path: src/main/java/de/jformchecker/request/SessionGet.java // @FunctionalInterface // public interface SessionGet { // public Object getAttribute(S...
import java.security.SecureRandom; import java.util.Base64; import com.coverity.security.Escape; import de.jformchecker.request.Request; import de.jformchecker.request.SessionGet; import de.jformchecker.request.SessionSet;
package de.jformchecker.security; public class XSRFBuilder { private final SecureRandom random = new SecureRandom();
// Path: src/main/java/de/jformchecker/request/Request.java // @FunctionalInterface // public interface Request { // public String getParameter(String name); // } // // Path: src/main/java/de/jformchecker/request/SessionGet.java // @FunctionalInterface // public interface SessionGet { // public Object getAttribute(S...
public String buildCSRFTokens(Request req, boolean firstRun, SessionGet sessionGet, SessionSet sessionSet) {
jochen777/jFormchecker
src/main/java/de/jformchecker/themes/BasicMaterialLightFormBuilder.java
// Path: src/main/java/de/jformchecker/FormCheckerElement.java // public interface FormCheckerElement { // // // RFE: check, if some methods can be protected // // // get internal name of this input-element // public String getName(); // // // set internal name // public void setName(String name); // // // ...
import java.util.Map; import de.jformchecker.FormCheckerElement; import de.jformchecker.TagAttributes; import de.jformchecker.Wrapper;
package de.jformchecker.themes; public class BasicMaterialLightFormBuilder extends BasicFormBuilder { @Override
// Path: src/main/java/de/jformchecker/FormCheckerElement.java // public interface FormCheckerElement { // // // RFE: check, if some methods can be protected // // // get internal name of this input-element // public String getName(); // // // set internal name // public void setName(String name); // // // ...
public TagAttributes getFormAttributes() {
jochen777/jFormchecker
src/main/java/de/jformchecker/themes/BasicMaterialLightFormBuilder.java
// Path: src/main/java/de/jformchecker/FormCheckerElement.java // public interface FormCheckerElement { // // // RFE: check, if some methods can be protected // // // get internal name of this input-element // public String getName(); // // // set internal name // public void setName(String name); // // // ...
import java.util.Map; import de.jformchecker.FormCheckerElement; import de.jformchecker.TagAttributes; import de.jformchecker.Wrapper;
package de.jformchecker.themes; public class BasicMaterialLightFormBuilder extends BasicFormBuilder { @Override public TagAttributes getFormAttributes() { TagAttributes attributes = new TagAttributes(); return attributes; } @Override
// Path: src/main/java/de/jformchecker/FormCheckerElement.java // public interface FormCheckerElement { // // // RFE: check, if some methods can be protected // // // get internal name of this input-element // public String getName(); // // // set internal name // public void setName(String name); // // // ...
public Wrapper getWrapperForInput(FormCheckerElement elem) {
jochen777/jFormchecker
src/main/java/de/jformchecker/themes/BasicMaterialLightFormBuilder.java
// Path: src/main/java/de/jformchecker/FormCheckerElement.java // public interface FormCheckerElement { // // // RFE: check, if some methods can be protected // // // get internal name of this input-element // public String getName(); // // // set internal name // public void setName(String name); // // // ...
import java.util.Map; import de.jformchecker.FormCheckerElement; import de.jformchecker.TagAttributes; import de.jformchecker.Wrapper;
package de.jformchecker.themes; public class BasicMaterialLightFormBuilder extends BasicFormBuilder { @Override public TagAttributes getFormAttributes() { TagAttributes attributes = new TagAttributes(); return attributes; } @Override
// Path: src/main/java/de/jformchecker/FormCheckerElement.java // public interface FormCheckerElement { // // // RFE: check, if some methods can be protected // // // get internal name of this input-element // public String getName(); // // // set internal name // public void setName(String name); // // // ...
public Wrapper getWrapperForInput(FormCheckerElement elem) {