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 |
|---|---|---|---|---|---|---|
psidnell/ofexport2 | src/main/java/org/psidnell/omnifocus/expr/Date.java | // Path: src/main/java/org/psidnell/omnifocus/ConfigParams.java
// public class ConfigParams {
//
// private String dueSoon;
// private String flattenedRootName;
// private String expressionDateFormat;
// private int icsAlarmMinutes;
// private boolean icsAlarm;
// private String icsStart;
// ... | import java.text.ParseException;
import java.text.SimpleDateFormat;
import java.util.Calendar;
import java.util.GregorianCalendar;
import org.psidnell.omnifocus.ConfigParams; | /*
* Copyright 2015 Paul Sidnell
*
* 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
*
* Unless required by applicable law or agreed to... | // Path: src/main/java/org/psidnell/omnifocus/ConfigParams.java
// public class ConfigParams {
//
// private String dueSoon;
// private String flattenedRootName;
// private String expressionDateFormat;
// private int icsAlarmMinutes;
// private boolean icsAlarm;
// private String icsStart;
// ... | public Date(java.util.Date date, ConfigParams config) { |
psidnell/ofexport2 | src/main/java/org/psidnell/omnifocus/expr/ExprAttributePrinter.java | // Path: src/main/java/org/psidnell/omnifocus/model/Node.java
// public interface Node {
//
// String getName();
//
// void setName(String name);
//
// String getId();
//
// void setId(String id);
//
// int getRank();
//
// void setRank(int rank);
//
// String getType();
//
// bo... | import java.lang.reflect.Method;
import java.util.TreeMap;
import org.psidnell.omnifocus.model.Node;
import org.psidnell.omnifocus.util.StringUtils; | /*
* Copyright 2015 Paul Sidnell
*
* 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
*
* Unless required by applicable law or agreed to... | // Path: src/main/java/org/psidnell/omnifocus/model/Node.java
// public interface Node {
//
// String getName();
//
// void setName(String name);
//
// String getId();
//
// void setId(String id);
//
// int getRank();
//
// void setRank(int rank);
//
// String getType();
//
// bo... | private Class<? extends Node>[] classes; |
psidnell/ofexport2 | src/main/java/org/psidnell/omnifocus/expr/ExprAttributePrinter.java | // Path: src/main/java/org/psidnell/omnifocus/model/Node.java
// public interface Node {
//
// String getName();
//
// void setName(String name);
//
// String getId();
//
// void setId(String id);
//
// int getRank();
//
// void setRank(int rank);
//
// String getType();
//
// bo... | import java.lang.reflect.Method;
import java.util.TreeMap;
import org.psidnell.omnifocus.model.Node;
import org.psidnell.omnifocus.util.StringUtils; | String type = m.getReturnType().getSimpleName().toLowerCase();
String nameAndArgs = name + processArgs(attrib);
v.process(type, nameAndArgs, attrib.help());
}
}
}
private static String padL(String val, int pad) {
String result = val;... | // Path: src/main/java/org/psidnell/omnifocus/model/Node.java
// public interface Node {
//
// String getName();
//
// void setName(String name);
//
// String getId();
//
// void setId(String id);
//
// int getRank();
//
// void setRank(int rank);
//
// String getType();
//
// bo... | return StringUtils.join(attrib.args(), ",", " (",")"); |
psidnell/ofexport2 | src/main/java/org/psidnell/omnifocus/sqlite/SQLiteClassDescriptor.java | // Path: src/main/java/org/psidnell/omnifocus/model/NodeFactory.java
// public class NodeFactory {
//
// private ConfigParams config;
//
// @SuppressWarnings({"unchecked", "deprecation"})
// public <T> T create(String name, Class<T> clazz) {
// Node node;
// switch (clazz.getSimpleName()) ... | import java.lang.reflect.InvocationTargetException;
import java.lang.reflect.Method;
import java.sql.ResultSet;
import java.sql.SQLException;
import java.util.Calendar;
import java.util.TimeZone;
import java.util.Collection;
import java.util.GregorianCalendar;
import java.util.LinkedList;
import org.psidnell.omnifocus.... | if (methodName.startsWith("is")) {
propName = propertyName("is", m.getName());
setterName = m.getName().replaceFirst("^is", "set");
} else if (methodName.startsWith("get")) {
propName = propertyName("get", m.getName());
... | // Path: src/main/java/org/psidnell/omnifocus/model/NodeFactory.java
// public class NodeFactory {
//
// private ConfigParams config;
//
// @SuppressWarnings({"unchecked", "deprecation"})
// public <T> T create(String name, Class<T> clazz) {
// Node node;
// switch (clazz.getSimpleName()) ... | public LinkedList<T> load(ResultSet rs, NodeFactory nodeFactory) throws SQLException, InvocationTargetException, InstantiationException, |
psidnell/ofexport2 | src/main/java/org/psidnell/omnifocus/model/Node.java | // Path: src/main/java/org/psidnell/omnifocus/ConfigParams.java
// public class ConfigParams {
//
// private String dueSoon;
// private String flattenedRootName;
// private String expressionDateFormat;
// private int icsAlarmMinutes;
// private boolean icsAlarm;
// private String icsStart;
// ... | import org.psidnell.omnifocus.ConfigParams; | /*
* Copyright 2015 Paul Sidnell
*
* 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
*
* Unless required by applicable law or agreed to... | // Path: src/main/java/org/psidnell/omnifocus/ConfigParams.java
// public class ConfigParams {
//
// private String dueSoon;
// private String flattenedRootName;
// private String expressionDateFormat;
// private int icsAlarmMinutes;
// private boolean icsAlarm;
// private String icsStart;
// ... | void setConfigParams(ConfigParams config); |
psidnell/ofexport2 | src/main/java/org/psidnell/omnifocus/expr/ExprMarkVisitor.java | // Path: src/main/java/org/psidnell/omnifocus/model/Node.java
// public interface Node {
//
// String getName();
//
// void setName(String name);
//
// String getId();
//
// void setId(String id);
//
// int getRank();
//
// void setRank(int rank);
//
// String getType();
//
// bo... | import org.psidnell.omnifocus.model.Node;
import org.psidnell.omnifocus.visitor.VisitorDescriptor;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory; | /*
* Copyright 2015 Paul Sidnell
*
* 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
*
* Unless required by applicable law or agreed to... | // Path: src/main/java/org/psidnell/omnifocus/model/Node.java
// public interface Node {
//
// String getName();
//
// void setName(String name);
//
// String getId();
//
// void setId(String id);
//
// int getRank();
//
// void setRank(int rank);
//
// String getType();
//
// bo... | public ExprMarkVisitor(String expr, boolean includeMode, VisitorDescriptor visitWhat, |
psidnell/ofexport2 | src/main/java/org/psidnell/omnifocus/expr/ExprMarkVisitor.java | // Path: src/main/java/org/psidnell/omnifocus/model/Node.java
// public interface Node {
//
// String getName();
//
// void setName(String name);
//
// String getId();
//
// void setId(String id);
//
// int getRank();
//
// void setRank(int rank);
//
// String getType();
//
// bo... | import org.psidnell.omnifocus.model.Node;
import org.psidnell.omnifocus.visitor.VisitorDescriptor;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory; | /*
* Copyright 2015 Paul Sidnell
*
* 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
*
* Unless required by applicable law or agreed to... | // Path: src/main/java/org/psidnell/omnifocus/model/Node.java
// public interface Node {
//
// String getName();
//
// void setName(String name);
//
// String getId();
//
// void setId(String id);
//
// int getRank();
//
// void setRank(int rank);
//
// String getType();
//
// bo... | protected void evaluate(Node node) { |
psidnell/ofexport2 | src/test/java/org/psidnell/omnifocus/model/ContextTest.java | // Path: src/main/java/org/psidnell/omnifocus/ApplicationContextFactory.java
// public class ApplicationContextFactory {
//
// public static final String CONFIG_XML = "/config.xml";
// private static final String CONFIG_PROPERTIES = "/config.properties";
//
// public static ApplicationContext getContext()... | import static org.junit.Assert.assertEquals;
import static org.junit.Assert.assertFalse;
import static org.junit.Assert.assertSame;
import static org.junit.Assert.assertTrue;
import org.junit.Before;
import org.junit.Test;
import org.psidnell.omnifocus.ApplicationContextFactory;
import org.springframework.context.Appli... | /*
* Copyright 2015 Paul Sidnell
*
* 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
*
* Unless required by applicable law or agreed to... | // Path: src/main/java/org/psidnell/omnifocus/ApplicationContextFactory.java
// public class ApplicationContextFactory {
//
// public static final String CONFIG_XML = "/config.xml";
// private static final String CONFIG_PROPERTIES = "/config.properties";
//
// public static ApplicationContext getContext()... | ApplicationContext appContext = ApplicationContextFactory.getContext(); |
psidnell/ofexport2 | src/test/java/org/psidnell/omnifocus/model/DataCacheTest.java | // Path: src/main/java/org/psidnell/omnifocus/ApplicationContextFactory.java
// public class ApplicationContextFactory {
//
// public static final String CONFIG_XML = "/config.xml";
// private static final String CONFIG_PROPERTIES = "/config.properties";
//
// public static ApplicationContext getContext()... | import static org.junit.Assert.assertEquals;
import static org.junit.Assert.assertNotNull;
import static org.junit.Assert.assertSame;
import static org.junit.Assert.assertTrue;
import java.util.stream.Collectors;
import org.junit.Before;
import org.junit.Test;
import org.psidnell.omnifocus.ApplicationContextFactory;
im... | /*
* Copyright 2015 Paul Sidnell
*
* 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
*
* Unless required by applicable law or agreed to... | // Path: src/main/java/org/psidnell/omnifocus/ApplicationContextFactory.java
// public class ApplicationContextFactory {
//
// public static final String CONFIG_XML = "/config.xml";
// private static final String CONFIG_PROPERTIES = "/config.properties";
//
// public static ApplicationContext getContext()... | ApplicationContext appContext = ApplicationContextFactory.getContext(); |
psidnell/ofexport2 | src/main/java/org/psidnell/omnifocus/model/CommonProjectAndTaskAttributes.java | // Path: src/main/java/org/psidnell/omnifocus/ConfigParams.java
// public class ConfigParams {
//
// private String dueSoon;
// private String flattenedRootName;
// private String expressionDateFormat;
// private int icsAlarmMinutes;
// private boolean icsAlarm;
// private String icsStart;
// ... | import java.util.Calendar;
import java.util.Date;
import java.util.GregorianCalendar;
import java.util.LinkedList;
import java.util.List;
import org.psidnell.omnifocus.ConfigParams;
import org.psidnell.omnifocus.expr.ExprAttribute;
import org.psidnell.omnifocus.sqlite.SQLiteProperty;
import org.psidnell.omnifocus.util.... |
@JsonIgnore
@ExprAttribute(help = "item is not flagged.")
public boolean isUnflagged() {
return !flagged;
}
@SQLiteProperty
@ExprAttribute(help = "estimated minutes.")
public Integer getEstimatedMinutes() {
return estimatedMinutes;
}
public void setEstimatedMinutes... | // Path: src/main/java/org/psidnell/omnifocus/ConfigParams.java
// public class ConfigParams {
//
// private String dueSoon;
// private String flattenedRootName;
// private String expressionDateFormat;
// private int icsAlarmMinutes;
// private boolean icsAlarm;
// private String icsStart;
// ... | String indentChars = StringUtils.times(indent, depth); |
psidnell/ofexport2 | src/main/java/org/psidnell/omnifocus/model/CommonProjectAndTaskAttributes.java | // Path: src/main/java/org/psidnell/omnifocus/ConfigParams.java
// public class ConfigParams {
//
// private String dueSoon;
// private String flattenedRootName;
// private String expressionDateFormat;
// private int icsAlarmMinutes;
// private boolean icsAlarm;
// private String icsStart;
// ... | import java.util.Calendar;
import java.util.Date;
import java.util.GregorianCalendar;
import java.util.LinkedList;
import java.util.List;
import org.psidnell.omnifocus.ConfigParams;
import org.psidnell.omnifocus.expr.ExprAttribute;
import org.psidnell.omnifocus.sqlite.SQLiteProperty;
import org.psidnell.omnifocus.util.... | return cal.getTime();
} catch (NumberFormatException e) {
LOGGER.warn(e.getMessage());
}
}
return date;
}
@JsonIgnore
public String getIcsModified() {
return getModified().getIcs();
}
@JsonIgnore
public boolean ge... | // Path: src/main/java/org/psidnell/omnifocus/ConfigParams.java
// public class ConfigParams {
//
// private String dueSoon;
// private String flattenedRootName;
// private String expressionDateFormat;
// private int icsAlarmMinutes;
// private boolean icsAlarm;
// private String icsStart;
// ... | public void setConfigParams(ConfigParams config) { |
psidnell/ofexport2 | src/main/java/org/psidnell/omnifocus/expr/Expression.java | // Path: src/main/java/org/psidnell/omnifocus/model/Node.java
// public interface Node {
//
// String getName();
//
// void setName(String name);
//
// String getId();
//
// void setId(String id);
//
// int getRank();
//
// void setRank(int rank);
//
// String getType();
//
// bo... | import ognl.Ognl;
import ognl.OgnlContext;
import ognl.OgnlException;
import org.psidnell.omnifocus.model.Node;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory; | /*
* Copyright 2015 Paul Sidnell
*
* 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
*
* Unless required by applicable law or agreed to... | // Path: src/main/java/org/psidnell/omnifocus/model/Node.java
// public interface Node {
//
// String getName();
//
// void setName(String name);
//
// String getId();
//
// void setId(String id);
//
// int getRank();
//
// void setRank(int rank);
//
// String getType();
//
// bo... | public Object eval(Node node) { |
psidnell/ofexport2 | src/test/java/org/psidnell/omnifocus/model/FolderTest.java | // Path: src/main/java/org/psidnell/omnifocus/ApplicationContextFactory.java
// public class ApplicationContextFactory {
//
// public static final String CONFIG_XML = "/config.xml";
// private static final String CONFIG_PROPERTIES = "/config.properties";
//
// public static ApplicationContext getContext()... | import static org.junit.Assert.*;
import org.junit.Before;
import org.junit.Test;
import org.psidnell.omnifocus.ApplicationContextFactory;
import org.springframework.context.ApplicationContext; | /*
* Copyright 2015 Paul Sidnell
*
* 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
*
* Unless required by applicable law or agreed to... | // Path: src/main/java/org/psidnell/omnifocus/ApplicationContextFactory.java
// public class ApplicationContextFactory {
//
// public static final String CONFIG_XML = "/config.xml";
// private static final String CONFIG_PROPERTIES = "/config.properties";
//
// public static ApplicationContext getContext()... | ApplicationContext appContext = ApplicationContextFactory.getContext(); |
psidnell/ofexport2 | src/test/java/org/psidnell/omnifocus/expr/ExpressionFunctionsTest.java | // Path: src/main/java/org/psidnell/omnifocus/ApplicationContextFactory.java
// public class ApplicationContextFactory {
//
// public static final String CONFIG_XML = "/config.xml";
// private static final String CONFIG_PROPERTIES = "/config.properties";
//
// public static ApplicationContext getContext()... | import static org.junit.Assert.*;
import java.text.ParseException;
import java.text.SimpleDateFormat;
import java.util.Calendar;
import java.util.Date;
import java.util.GregorianCalendar;
import java.util.TimeZone;
import org.junit.Before;
import org.junit.Test;
import org.psidnell.omnifocus.ApplicationContextFactory;
... | /*
* Copyright 2015 Paul Sidnell
*
* 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
*
* Unless required by applicable law or agreed to... | // Path: src/main/java/org/psidnell/omnifocus/ApplicationContextFactory.java
// public class ApplicationContextFactory {
//
// public static final String CONFIG_XML = "/config.xml";
// private static final String CONFIG_PROPERTIES = "/config.properties";
//
// public static ApplicationContext getContext()... | private ConfigParams config; |
psidnell/ofexport2 | src/test/java/org/psidnell/omnifocus/expr/ExpressionFunctionsTest.java | // Path: src/main/java/org/psidnell/omnifocus/ApplicationContextFactory.java
// public class ApplicationContextFactory {
//
// public static final String CONFIG_XML = "/config.xml";
// private static final String CONFIG_PROPERTIES = "/config.properties";
//
// public static ApplicationContext getContext()... | import static org.junit.Assert.*;
import java.text.ParseException;
import java.text.SimpleDateFormat;
import java.util.Calendar;
import java.util.Date;
import java.util.GregorianCalendar;
import java.util.TimeZone;
import org.junit.Before;
import org.junit.Test;
import org.psidnell.omnifocus.ApplicationContextFactory;
... | /*
* Copyright 2015 Paul Sidnell
*
* 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
*
* Unless required by applicable law or agreed to... | // Path: src/main/java/org/psidnell/omnifocus/ApplicationContextFactory.java
// public class ApplicationContextFactory {
//
// public static final String CONFIG_XML = "/config.xml";
// private static final String CONFIG_PROPERTIES = "/config.properties";
//
// public static ApplicationContext getContext()... | ApplicationContext appContext = ApplicationContextFactory.getContext(); |
psidnell/ofexport2 | src/test/java/org/psidnell/omnifocus/model/NodeImplTest.java | // Path: src/main/java/org/psidnell/omnifocus/ApplicationContextFactory.java
// public class ApplicationContextFactory {
//
// public static final String CONFIG_XML = "/config.xml";
// private static final String CONFIG_PROPERTIES = "/config.properties";
//
// public static ApplicationContext getContext()... | import static org.junit.Assert.assertFalse;
import static org.junit.Assert.assertTrue;
import org.junit.Before;
import org.junit.Test;
import org.psidnell.omnifocus.ApplicationContextFactory;
import org.springframework.context.ApplicationContext; | /*
* Copyright 2015 Paul Sidnell
*
* 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
*
* Unless required by applicable law or agreed to... | // Path: src/main/java/org/psidnell/omnifocus/ApplicationContextFactory.java
// public class ApplicationContextFactory {
//
// public static final String CONFIG_XML = "/config.xml";
// private static final String CONFIG_PROPERTIES = "/config.properties";
//
// public static ApplicationContext getContext()... | ApplicationContext appContext = ApplicationContextFactory.getContext(); |
psidnell/ofexport2 | src/main/java/org/psidnell/omnifocus/format/JSONFormatter.java | // Path: src/main/java/org/psidnell/omnifocus/model/Node.java
// public interface Node {
//
// String getName();
//
// void setName(String name);
//
// String getId();
//
// void setId(String id);
//
// int getRank();
//
// void setRank(int rank);
//
// String getType();
//
// bo... | import java.io.IOException;
import java.io.Writer;
import org.psidnell.omnifocus.model.Node;
import org.psidnell.omnifocus.util.IOUtils;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import com.fasterxml.jackson.databind.ObjectMapper; | /*
* Copyright 2015 Paul Sidnell
*
* 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
*
* Unless required by applicable law or agreed to... | // Path: src/main/java/org/psidnell/omnifocus/model/Node.java
// public interface Node {
//
// String getName();
//
// void setName(String name);
//
// String getId();
//
// void setId(String id);
//
// int getRank();
//
// void setRank(int rank);
//
// String getType();
//
// bo... | public void format(Node node, Writer out) throws IOException { |
psidnell/ofexport2 | src/main/java/org/psidnell/omnifocus/format/JSONFormatter.java | // Path: src/main/java/org/psidnell/omnifocus/model/Node.java
// public interface Node {
//
// String getName();
//
// void setName(String name);
//
// String getId();
//
// void setId(String id);
//
// int getRank();
//
// void setRank(int rank);
//
// String getType();
//
// bo... | import java.io.IOException;
import java.io.Writer;
import org.psidnell.omnifocus.model.Node;
import org.psidnell.omnifocus.util.IOUtils;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import com.fasterxml.jackson.databind.ObjectMapper; | /*
* Copyright 2015 Paul Sidnell
*
* 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
*
* Unless required by applicable law or agreed to... | // Path: src/main/java/org/psidnell/omnifocus/model/Node.java
// public interface Node {
//
// String getName();
//
// void setName(String name);
//
// String getId();
//
// void setId(String id);
//
// int getRank();
//
// void setRank(int rank);
//
// String getType();
//
// bo... | Writer closeProofWriter = IOUtils.closeProofWriter(out); |
psidnell/ofexport2 | src/main/java/org/psidnell/omnifocus/format/XMLFormatter.java | // Path: src/main/java/org/psidnell/omnifocus/model/Node.java
// public interface Node {
//
// String getName();
//
// void setName(String name);
//
// String getId();
//
// void setId(String id);
//
// int getRank();
//
// void setRank(int rank);
//
// String getType();
//
// bo... | import java.io.IOException;
import java.io.Writer;
import org.psidnell.omnifocus.model.Node;
import org.psidnell.omnifocus.util.IOUtils;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import com.fasterxml.jackson.databind.SerializationFeature;
import com.fasterxml.jackson.dataformat.xml.XmlMapper; | /*
* Copyright 2015 Paul Sidnell
*
* 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
*
* Unless required by applicable law or agreed to... | // Path: src/main/java/org/psidnell/omnifocus/model/Node.java
// public interface Node {
//
// String getName();
//
// void setName(String name);
//
// String getId();
//
// void setId(String id);
//
// int getRank();
//
// void setRank(int rank);
//
// String getType();
//
// bo... | public void format(Node node, Writer out) throws IOException { |
psidnell/ofexport2 | src/main/java/org/psidnell/omnifocus/format/XMLFormatter.java | // Path: src/main/java/org/psidnell/omnifocus/model/Node.java
// public interface Node {
//
// String getName();
//
// void setName(String name);
//
// String getId();
//
// void setId(String id);
//
// int getRank();
//
// void setRank(int rank);
//
// String getType();
//
// bo... | import java.io.IOException;
import java.io.Writer;
import org.psidnell.omnifocus.model.Node;
import org.psidnell.omnifocus.util.IOUtils;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import com.fasterxml.jackson.databind.SerializationFeature;
import com.fasterxml.jackson.dataformat.xml.XmlMapper; | /*
* Copyright 2015 Paul Sidnell
*
* 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
*
* Unless required by applicable law or agreed to... | // Path: src/main/java/org/psidnell/omnifocus/model/Node.java
// public interface Node {
//
// String getName();
//
// void setName(String name);
//
// String getId();
//
// void setId(String id);
//
// int getRank();
//
// void setRank(int rank);
//
// String getType();
//
// bo... | Writer closeProofWriter = IOUtils.closeProofWriter(out); |
psidnell/ofexport2 | src/main/java/org/psidnell/omnifocus/expr/ExpressionFunctions.java | // Path: src/main/java/org/psidnell/omnifocus/ConfigParams.java
// public class ConfigParams {
//
// private String dueSoon;
// private String flattenedRootName;
// private String expressionDateFormat;
// private int icsAlarmMinutes;
// private boolean icsAlarm;
// private String icsStart;
// ... | import java.text.ParseException;
import java.text.SimpleDateFormat;
import java.util.Calendar;
import java.util.Date;
import java.util.GregorianCalendar;
import org.psidnell.omnifocus.ConfigParams;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory; | /*
* Copyright 2015 Paul Sidnell
*
* 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
*
* Unless required by applicable law or agreed to... | // Path: src/main/java/org/psidnell/omnifocus/ConfigParams.java
// public class ConfigParams {
//
// private String dueSoon;
// private String flattenedRootName;
// private String expressionDateFormat;
// private int icsAlarmMinutes;
// private boolean icsAlarm;
// private String icsStart;
// ... | protected ConfigParams config; |
psidnell/ofexport2 | src/test/java/org/psidnell/omnifocus/model/TaskTest.java | // Path: src/main/java/org/psidnell/omnifocus/ApplicationContextFactory.java
// public class ApplicationContextFactory {
//
// public static final String CONFIG_XML = "/config.xml";
// private static final String CONFIG_PROPERTIES = "/config.properties";
//
// public static ApplicationContext getContext()... | import static org.junit.Assert.assertEquals;
import static org.junit.Assert.assertFalse;
import static org.junit.Assert.assertSame;
import static org.junit.Assert.assertTrue;
import java.text.ParseException;
import java.util.Date;
import org.junit.Before;
import org.junit.Test;
import org.psidnell.omnifocus.Application... | /*
* Copyright 2015 Paul Sidnell
*
* 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
*
* Unless required by applicable law or agreed to... | // Path: src/main/java/org/psidnell/omnifocus/ApplicationContextFactory.java
// public class ApplicationContextFactory {
//
// public static final String CONFIG_XML = "/config.xml";
// private static final String CONFIG_PROPERTIES = "/config.properties";
//
// public static ApplicationContext getContext()... | ApplicationContext appContext = ApplicationContextFactory.getContext(); |
martint/jmxutils | src/main/java/org/weakref/jmx/MBeanExporter.java | // Path: src/main/java/org/weakref/jmx/JmxException.java
// public enum Reason
// {
// INVALID_ANNOTATION,
// MALFORMED_OBJECT_NAME,
// INSTANCE_ALREADY_EXISTS,
// INSTANCE_NOT_FOUND,
// MBEAN_REGISTRATION
// }
| import com.google.common.collect.ImmutableMap;
import com.google.common.collect.MapMaker;
import com.google.inject.Inject;
import org.weakref.jmx.JmxException.Reason;
import javax.management.InstanceAlreadyExistsException;
import javax.management.InstanceNotFoundException;
import javax.management.MBeanRegistrationExcep... | requireNonNull(type, "type is null");
requireNonNull(name, "name is null");
ObjectName objectName = createObjectName(objectNameGenerator.generatedNameOf(type, name));
export(objectName, object);
return new MBeanExport(objectName, () -> unexport(objectName));
}
public MBe... | // Path: src/main/java/org/weakref/jmx/JmxException.java
// public enum Reason
// {
// INVALID_ANNOTATION,
// MALFORMED_OBJECT_NAME,
// INSTANCE_ALREADY_EXISTS,
// INSTANCE_NOT_FOUND,
// MBEAN_REGISTRATION
// }
// Path: src/main/java/org/weakref/jmx/MBeanExporter.java
import com.google.common.coll... | throw new JmxException(Reason.INSTANCE_ALREADY_EXISTS, "key already exported: %s", objectName); |
martint/jmxutils | src/main/java/org/weakref/jmx/guice/NamedExportBinder.java | // Path: src/main/java/org/weakref/jmx/ObjectNameGenerator.java
// public interface ObjectNameGenerator
// {
// static ObjectNameGenerator defaultObjectNameGenerator()
// {
// return (type, properties) -> new ObjectNameBuilder(type.getPackage().getName())
// .withProperties(properties)
/... | import com.google.inject.Key;
import com.google.inject.multibindings.Multibinder;
import com.google.inject.name.Named;
import org.weakref.jmx.ObjectNameGenerator;
import java.util.function.Function; | this.binder = binder;
this.key = key;
}
/**
* Names the MBean according to {@link org.weakref.jmx.ObjectNames} name generator methods.
*/
public void withGeneratedName()
{
if (key.getAnnotation() != null) {
if (key.getAnnotation() instanceof Named) {
... | // Path: src/main/java/org/weakref/jmx/ObjectNameGenerator.java
// public interface ObjectNameGenerator
// {
// static ObjectNameGenerator defaultObjectNameGenerator()
// {
// return (type, properties) -> new ObjectNameBuilder(type.getPackage().getName())
// .withProperties(properties)
/... | public void as(Function<ObjectNameGenerator, String> nameFactory) |
martint/jmxutils | src/main/java/org/weakref/jmx/guice/NamedBindingBuilder.java | // Path: src/main/java/org/weakref/jmx/ObjectNameGenerator.java
// public interface ObjectNameGenerator
// {
// static ObjectNameGenerator defaultObjectNameGenerator()
// {
// return (type, properties) -> new ObjectNameBuilder(type.getPackage().getName())
// .withProperties(properties)
/... | import com.google.inject.Key;
import com.google.inject.multibindings.Multibinder;
import com.google.inject.name.Named;
import org.weakref.jmx.ObjectNameGenerator;
import java.util.function.Function; | this.binder = binder;
this.key = key;
}
/**
* Names the MBean according to {@link org.weakref.jmx.ObjectNames} name generator methods.
*/
public void withGeneratedName()
{
if (key.getAnnotation() != null) {
if (key.getAnnotation() instanceof Named) {
... | // Path: src/main/java/org/weakref/jmx/ObjectNameGenerator.java
// public interface ObjectNameGenerator
// {
// static ObjectNameGenerator defaultObjectNameGenerator()
// {
// return (type, properties) -> new ObjectNameBuilder(type.getPackage().getName())
// .withProperties(properties)
/... | private void as(Function<ObjectNameGenerator, String> mappingNameFactory) |
martint/jmxutils | src/test/java/org/weakref/jmx/TestObjectNames.java | // Path: src/main/java/org/weakref/jmx/ObjectNames.java
// public static String generatedNameOf(Class<?> clazz)
// {
// return builder(clazz).build();
// }
| import com.google.inject.name.Names;
import org.testng.annotations.DataProvider;
import org.testng.annotations.Test;
import javax.management.MalformedObjectNameException;
import javax.management.ObjectName;
import java.lang.annotation.Annotation;
import java.util.ArrayList;
import static org.testng.Assert.assertEquals;... | package org.weakref.jmx;
public class TestObjectNames {
@interface Ann {}
static class AnnImpl implements Ann {
@Override
public Class<? extends Annotation> annotationType() {
return Ann.class;
}
}
static class Inner {}
@Test
public void testGeneratedNameOf1() {
assertE... | // Path: src/main/java/org/weakref/jmx/ObjectNames.java
// public static String generatedNameOf(Class<?> clazz)
// {
// return builder(clazz).build();
// }
// Path: src/test/java/org/weakref/jmx/TestObjectNames.java
import com.google.inject.name.Names;
import org.testng.annotations.DataProvider;
import org.testng... | generatedNameOf(SimpleObject.class), |
martint/jmxutils | src/main/java/org/weakref/jmx/guice/SetExportBinder.java | // Path: src/main/java/org/weakref/jmx/ObjectNameGenerator.java
// public interface ObjectNameGenerator
// {
// static ObjectNameGenerator defaultObjectNameGenerator()
// {
// return (type, properties) -> new ObjectNameBuilder(type.getPackage().getName())
// .withProperties(properties)
/... | import com.google.inject.multibindings.Multibinder;
import org.weakref.jmx.ObjectNameGenerator;
import javax.management.MalformedObjectNameException;
import javax.management.ObjectName;
import java.util.function.BiFunction; | package org.weakref.jmx.guice;
public class SetExportBinder<T>
{
private final Multibinder<SetMapping<?>> binder;
private final Class<T> clazz;
SetExportBinder(Multibinder<SetMapping<?>> binder, Class<T> clazz)
{
this.binder = binder;
this.clazz = clazz;
}
public void withG... | // Path: src/main/java/org/weakref/jmx/ObjectNameGenerator.java
// public interface ObjectNameGenerator
// {
// static ObjectNameGenerator defaultObjectNameGenerator()
// {
// return (type, properties) -> new ObjectNameBuilder(type.getPackage().getName())
// .withProperties(properties)
/... | BiFunction<ObjectNameGenerator, T, ObjectName> nameFactory = (factory, object) -> { |
martint/jmxutils | src/main/java/org/weakref/jmx/testing/TestingMBeanModule.java | // Path: src/main/java/org/weakref/jmx/guice/MBeanModule.java
// public class MBeanModule
// extends AbstractModule
// {
// private ExportBuilder builder;
//
// @Override
// protected final void configure()
// {
// builder = newExporter(binder());
//
// bind(GuiceMBeanExporter.... | import com.google.inject.AbstractModule;
import com.google.inject.Scopes;
import org.weakref.jmx.guice.MBeanModule;
import javax.management.MBeanServer; | package org.weakref.jmx.testing;
public class TestingMBeanModule
extends AbstractModule
{
@Override
protected void configure()
{ | // Path: src/main/java/org/weakref/jmx/guice/MBeanModule.java
// public class MBeanModule
// extends AbstractModule
// {
// private ExportBuilder builder;
//
// @Override
// protected final void configure()
// {
// builder = newExporter(binder());
//
// bind(GuiceMBeanExporter.... | install(new MBeanModule()); |
martint/jmxutils | src/main/java/org/weakref/jmx/MBeanAttributeBuilder.java | // Path: src/main/java/org/weakref/jmx/ReflectionUtils.java
// public static boolean isValidGetter(Method getter)
// {
// if (getter == null) {
// throw new NullPointerException("getter is null");
// }
// if (getter.getParameterTypes().length != 0) {
// return false;
// }
// if (gett... | import javax.management.Descriptor;
import javax.management.ImmutableDescriptor;
import javax.management.MBeanAttributeInfo;
import java.lang.reflect.Method;
import java.util.ArrayList;
import java.util.Collection;
import java.util.Collections;
import java.util.regex.Matcher;
import java.util.regex.Pattern;
import stat... | private Method concreteGetter;
private Method annotatedGetter;
private Method concreteSetter;
private Method annotatedSetter;
private boolean flatten;
private boolean nested;
public MBeanAttributeBuilder onInstance(Object target)
{
if (target == null) {
throw new Nul... | // Path: src/main/java/org/weakref/jmx/ReflectionUtils.java
// public static boolean isValidGetter(Method getter)
// {
// if (getter == null) {
// throw new NullPointerException("getter is null");
// }
// if (getter.getParameterTypes().length != 0) {
// return false;
// }
// if (gett... | if (!isValidGetter(concreteGetter)) { |
martint/jmxutils | src/main/java/org/weakref/jmx/MBeanAttributeBuilder.java | // Path: src/main/java/org/weakref/jmx/ReflectionUtils.java
// public static boolean isValidGetter(Method getter)
// {
// if (getter == null) {
// throw new NullPointerException("getter is null");
// }
// if (getter.getParameterTypes().length != 0) {
// return false;
// }
// if (gett... | import javax.management.Descriptor;
import javax.management.ImmutableDescriptor;
import javax.management.MBeanAttributeInfo;
import java.lang.reflect.Method;
import java.util.ArrayList;
import java.util.Collection;
import java.util.Collections;
import java.util.regex.Matcher;
import java.util.regex.Pattern;
import stat... |
public MBeanAttributeBuilder withConcreteGetter(Method concreteGetter)
{
if (concreteGetter == null) {
throw new NullPointerException("concreteGetter is null");
}
if (!isValidGetter(concreteGetter)) {
throw new IllegalArgumentException("Method is not a valid gett... | // Path: src/main/java/org/weakref/jmx/ReflectionUtils.java
// public static boolean isValidGetter(Method getter)
// {
// if (getter == null) {
// throw new NullPointerException("getter is null");
// }
// if (getter.getParameterTypes().length != 0) {
// return false;
// }
// if (gett... | if (!isValidSetter(concreteSetter)) { |
martint/jmxutils | src/main/java/org/weakref/jmx/guice/SetMapping.java | // Path: src/main/java/org/weakref/jmx/ObjectNameGenerator.java
// public interface ObjectNameGenerator
// {
// static ObjectNameGenerator defaultObjectNameGenerator()
// {
// return (type, properties) -> new ObjectNameBuilder(type.getPackage().getName())
// .withProperties(properties)
/... | import com.google.common.reflect.TypeParameter;
import com.google.common.reflect.TypeToken;
import com.google.inject.Key;
import org.weakref.jmx.ObjectNameGenerator;
import javax.management.ObjectName;
import java.lang.reflect.Type;
import java.util.Set;
import java.util.function.BiFunction; | package org.weakref.jmx.guice;
class SetMapping<T>
{ | // Path: src/main/java/org/weakref/jmx/ObjectNameGenerator.java
// public interface ObjectNameGenerator
// {
// static ObjectNameGenerator defaultObjectNameGenerator()
// {
// return (type, properties) -> new ObjectNameBuilder(type.getPackage().getName())
// .withProperties(properties)
/... | private final BiFunction<ObjectNameGenerator, T, ObjectName> objectNameFunction; |
martint/jmxutils | src/main/java/org/weakref/jmx/guice/MapExportBinder.java | // Path: src/main/java/org/weakref/jmx/ObjectNameGenerator.java
// public interface ObjectNameGenerator
// {
// static ObjectNameGenerator defaultObjectNameGenerator()
// {
// return (type, properties) -> new ObjectNameBuilder(type.getPackage().getName())
// .withProperties(properties)
/... | import com.google.inject.multibindings.Multibinder;
import org.weakref.jmx.ObjectNameGenerator;
import javax.management.MalformedObjectNameException;
import javax.management.ObjectName;
import java.util.Map.Entry;
import java.util.function.BiFunction; | package org.weakref.jmx.guice;
public class MapExportBinder<K, V>
{
protected final Multibinder<MapMapping<?, ?>> binder;
protected final Class<K> keyClass;
private final Class<V> valueClass;
MapExportBinder(Multibinder<MapMapping<?, ?>> binder, Class<K> keyClass, Class<V> valueClass)
{
... | // Path: src/main/java/org/weakref/jmx/ObjectNameGenerator.java
// public interface ObjectNameGenerator
// {
// static ObjectNameGenerator defaultObjectNameGenerator()
// {
// return (type, properties) -> new ObjectNameBuilder(type.getPackage().getName())
// .withProperties(properties)
/... | BiFunction<ObjectNameGenerator, Entry<K, V>, ObjectName> nameFactory = (factory, entry) -> { |
martint/jmxutils | src/main/java/org/weakref/jmx/ObjectNameBuilder.java | // Path: src/main/java/org/weakref/jmx/ObjectNames.java
// static String quoteValueIfNecessary(String name)
// {
// boolean needQuote = false;
// StringBuilder builder = new StringBuilder("\"");
// for (int i = 0; i < name.length(); ++i) {
// char c = name.charAt(i);
// switch (c) {
// ... | import java.util.HashSet;
import java.util.Map;
import java.util.Map.Entry;
import java.util.Set;
import java.util.regex.Pattern;
import static com.google.common.base.Preconditions.checkArgument;
import static java.util.Objects.requireNonNull;
import static org.weakref.jmx.ObjectNames.quoteValueIfNecessary; | package org.weakref.jmx;
public class ObjectNameBuilder
{
private static final Pattern BAD_PACKAGENAME_PATTERN = Pattern.compile("[:?*]");
private final StringBuilder objectName;
private final Set<String> properties = new HashSet<>();
public ObjectNameBuilder(String domain)
{
requireNonN... | // Path: src/main/java/org/weakref/jmx/ObjectNames.java
// static String quoteValueIfNecessary(String name)
// {
// boolean needQuote = false;
// StringBuilder builder = new StringBuilder("\"");
// for (int i = 0; i < name.length(); ++i) {
// char c = name.charAt(i);
// switch (c) {
// ... | objectName.append(name).append('=').append(quoteValueIfNecessary(value)); |
martint/jmxutils | src/main/java/org/weakref/jmx/guice/Mapping.java | // Path: src/main/java/org/weakref/jmx/ObjectNameGenerator.java
// public interface ObjectNameGenerator
// {
// static ObjectNameGenerator defaultObjectNameGenerator()
// {
// return (type, properties) -> new ObjectNameBuilder(type.getPackage().getName())
// .withProperties(properties)
/... | import com.google.inject.Key;
import org.weakref.jmx.ObjectNameGenerator;
import java.util.function.Function; | /**
* Copyright 2009 Martin Traverso
*
* 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
*
* Unless required by applicable law or... | // Path: src/main/java/org/weakref/jmx/ObjectNameGenerator.java
// public interface ObjectNameGenerator
// {
// static ObjectNameGenerator defaultObjectNameGenerator()
// {
// return (type, properties) -> new ObjectNameBuilder(type.getPackage().getName())
// .withProperties(properties)
/... | private final Function<ObjectNameGenerator, String> nameFactory; |
martint/jmxutils | src/main/java/org/weakref/jmx/AnnotationUtils.java | // Path: src/main/java/org/weakref/jmx/JmxException.java
// public enum Reason
// {
// INVALID_ANNOTATION,
// MALFORMED_OBJECT_NAME,
// INSTANCE_ALREADY_EXISTS,
// INSTANCE_NOT_FOUND,
// MBEAN_REGISTRATION
// }
| import java.util.Set;
import java.util.TreeMap;
import static java.util.Arrays.asList;
import org.weakref.jmx.JmxException.Reason;
import javax.management.Descriptor;
import javax.management.DescriptorKey;
import javax.management.ImmutableDescriptor;
import java.lang.annotation.Annotation;
import java.lang.reflect.Invo... | }
}
}
Collections.addAll(result, annotations);
}
private static void processAnnotation(Annotation annotation, Map<String, Object> fieldsCollector)
{
// for each field in the annotation
for (Method field : annotation.annotationType().getMethods())... | // Path: src/main/java/org/weakref/jmx/JmxException.java
// public enum Reason
// {
// INVALID_ANNOTATION,
// MALFORMED_OBJECT_NAME,
// INSTANCE_ALREADY_EXISTS,
// INSTANCE_NOT_FOUND,
// MBEAN_REGISTRATION
// }
// Path: src/main/java/org/weakref/jmx/AnnotationUtils.java
import java.util.Set;
impor... | throw new JmxException(Reason.INVALID_ANNOTATION, cause, |
martint/jmxutils | src/main/java/org/weakref/jmx/guice/MappingNameFactory.java | // Path: src/main/java/org/weakref/jmx/ObjectNameGenerator.java
// public interface ObjectNameGenerator
// {
// static ObjectNameGenerator defaultObjectNameGenerator()
// {
// return (type, properties) -> new ObjectNameBuilder(type.getPackage().getName())
// .withProperties(properties)
/... | import org.weakref.jmx.ObjectNameGenerator; | package org.weakref.jmx.guice;
interface MappingNameFactory
{ | // Path: src/main/java/org/weakref/jmx/ObjectNameGenerator.java
// public interface ObjectNameGenerator
// {
// static ObjectNameGenerator defaultObjectNameGenerator()
// {
// return (type, properties) -> new ObjectNameBuilder(type.getPackage().getName())
// .withProperties(properties)
/... | String getName(ObjectNameGenerator objectNameGenerator); |
martint/jmxutils | src/main/java/org/weakref/jmx/guice/StringMapExportBinder.java | // Path: src/main/java/org/weakref/jmx/ObjectNameGenerator.java
// public interface ObjectNameGenerator
// {
// static ObjectNameGenerator defaultObjectNameGenerator()
// {
// return (type, properties) -> new ObjectNameBuilder(type.getPackage().getName())
// .withProperties(properties)
/... | import com.google.inject.multibindings.Multibinder;
import org.weakref.jmx.ObjectNameGenerator;
import javax.management.MalformedObjectNameException;
import javax.management.ObjectName;
import java.util.Map.Entry;
import java.util.function.BiFunction; | package org.weakref.jmx.guice;
public class StringMapExportBinder<V>
extends MapExportBinder<String, V>
{
private final Class<V> valueClass;
StringMapExportBinder(Multibinder<MapMapping<?, ?>> binder, Class<V> valueClass)
{
super(binder, String.class, valueClass);
this.valueClass = ... | // Path: src/main/java/org/weakref/jmx/ObjectNameGenerator.java
// public interface ObjectNameGenerator
// {
// static ObjectNameGenerator defaultObjectNameGenerator()
// {
// return (type, properties) -> new ObjectNameBuilder(type.getPackage().getName())
// .withProperties(properties)
/... | BiFunction<ObjectNameGenerator, Entry<String, V>, ObjectName> nameFactory = (factory, entry) -> { |
martint/jmxutils | src/main/java/org/weakref/jmx/guice/MapMapping.java | // Path: src/main/java/org/weakref/jmx/ObjectNameGenerator.java
// public interface ObjectNameGenerator
// {
// static ObjectNameGenerator defaultObjectNameGenerator()
// {
// return (type, properties) -> new ObjectNameBuilder(type.getPackage().getName())
// .withProperties(properties)
/... | import com.google.common.reflect.TypeParameter;
import com.google.common.reflect.TypeToken;
import com.google.inject.Key;
import org.weakref.jmx.ObjectNameGenerator;
import javax.management.ObjectName;
import java.lang.reflect.Type;
import java.util.Map;
import java.util.Map.Entry;
import java.util.function.BiFunction; | package org.weakref.jmx.guice;
class MapMapping<K, V>
{ | // Path: src/main/java/org/weakref/jmx/ObjectNameGenerator.java
// public interface ObjectNameGenerator
// {
// static ObjectNameGenerator defaultObjectNameGenerator()
// {
// return (type, properties) -> new ObjectNameBuilder(type.getPackage().getName())
// .withProperties(properties)
/... | private final BiFunction<ObjectNameGenerator, Entry<K, V>, ObjectName> objectNameFunction; |
martint/jmxutils | src/main/java/org/weakref/jmx/MBeanBuilder.java | // Path: src/main/java/org/weakref/jmx/ReflectionUtils.java
// public static String getAttributeName(Method method)
// {
// Matcher matcher = getterOrSetterPattern.matcher(method.getName());
// if (!matcher.matches()) {
// throw new IllegalArgumentException("method does not represent a getter or setter"... | import java.lang.reflect.Method;
import java.util.ArrayList;
import java.util.List;
import java.util.Map;
import java.util.TreeMap;
import static org.weakref.jmx.ReflectionUtils.getAttributeName;
import static org.weakref.jmx.ReflectionUtils.isGetter;
import static org.weakref.jmx.ReflectionUtils.isSetter; | /**
* Copyright 2009 Martin Traverso
*
* 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
*
* Unless required by applicable law or... | // Path: src/main/java/org/weakref/jmx/ReflectionUtils.java
// public static String getAttributeName(Method method)
// {
// Matcher matcher = getterOrSetterPattern.matcher(method.getName());
// if (!matcher.matches()) {
// throw new IllegalArgumentException("method does not represent a getter or setter"... | if (isGetter(concreteMethod) || isSetter(concreteMethod)) { // is it an attribute? |
martint/jmxutils | src/main/java/org/weakref/jmx/MBeanBuilder.java | // Path: src/main/java/org/weakref/jmx/ReflectionUtils.java
// public static String getAttributeName(Method method)
// {
// Matcher matcher = getterOrSetterPattern.matcher(method.getName());
// if (!matcher.matches()) {
// throw new IllegalArgumentException("method does not represent a getter or setter"... | import java.lang.reflect.Method;
import java.util.ArrayList;
import java.util.List;
import java.util.Map;
import java.util.TreeMap;
import static org.weakref.jmx.ReflectionUtils.getAttributeName;
import static org.weakref.jmx.ReflectionUtils.isGetter;
import static org.weakref.jmx.ReflectionUtils.isSetter; | /**
* Copyright 2009 Martin Traverso
*
* 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
*
* Unless required by applicable law or... | // Path: src/main/java/org/weakref/jmx/ReflectionUtils.java
// public static String getAttributeName(Method method)
// {
// Matcher matcher = getterOrSetterPattern.matcher(method.getName());
// if (!matcher.matches()) {
// throw new IllegalArgumentException("method does not represent a getter or setter"... | if (isGetter(concreteMethod) || isSetter(concreteMethod)) { // is it an attribute? |
martint/jmxutils | src/main/java/org/weakref/jmx/MBeanBuilder.java | // Path: src/main/java/org/weakref/jmx/ReflectionUtils.java
// public static String getAttributeName(Method method)
// {
// Matcher matcher = getterOrSetterPattern.matcher(method.getName());
// if (!matcher.matches()) {
// throw new IllegalArgumentException("method does not represent a getter or setter"... | import java.lang.reflect.Method;
import java.util.ArrayList;
import java.util.List;
import java.util.Map;
import java.util.TreeMap;
import static org.weakref.jmx.ReflectionUtils.getAttributeName;
import static org.weakref.jmx.ReflectionUtils.isGetter;
import static org.weakref.jmx.ReflectionUtils.isSetter; | /**
* Copyright 2009 Martin Traverso
*
* 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
*
* Unless required by applicable law or... | // Path: src/main/java/org/weakref/jmx/ReflectionUtils.java
// public static String getAttributeName(Method method)
// {
// Matcher matcher = getterOrSetterPattern.matcher(method.getName());
// if (!matcher.matches()) {
// throw new IllegalArgumentException("method does not represent a getter or setter"... | String attributeName = getAttributeName(concreteMethod); |
martint/jmxutils | src/main/java/org/weakref/jmx/ReflectionMBeanAttribute.java | // Path: src/main/java/org/weakref/jmx/ReflectionUtils.java
// public static Object invoke(Object target, Method method, Object... params)
// throws MBeanException, ReflectionException
// {
// assertNotNull(target, "target");
// assertNotNull(target, "method");
// assertNotNull(target, "params");
//... | import static org.weakref.jmx.ReflectionUtils.invoke;
import javax.management.AttributeNotFoundException;
import javax.management.InvalidAttributeValueException;
import javax.management.MBeanAttributeInfo;
import javax.management.MBeanException;
import javax.management.ReflectionException;
import java.lang.reflect.Meth... | this.target = target;
this.name = info.getName();
this.getter = getter;
this.setter = setter;
}
@Override
public MBeanAttributeInfo getInfo()
{
return info;
}
public Object getTarget()
{
return target;
}
@Override
public String g... | // Path: src/main/java/org/weakref/jmx/ReflectionUtils.java
// public static Object invoke(Object target, Method method, Object... params)
// throws MBeanException, ReflectionException
// {
// assertNotNull(target, "target");
// assertNotNull(target, "method");
// assertNotNull(target, "params");
//... | Object result = invoke(target, getter); |
mickare/xserver | XServer-API/src/main/java/de/mickare/xserver/net/XServer.java | // Path: XServer-API/src/main/java/de/mickare/xserver/AbstractXServerManager.java
// public interface AbstractXServerManager {
//
// public abstract void start() throws IOException;
//
// public abstract void start_async();
//
// public abstract void reconnectAll_soft();
//
// public abstract void reconnect... | import java.io.IOException;
import java.net.UnknownHostException;
import java.util.Set;
import de.mickare.xserver.AbstractXServerManager;
import de.mickare.xserver.Message;
import de.mickare.xserver.XGroup;
import de.mickare.xserver.XType;
import de.mickare.xserver.exceptions.NotInitializedException; | package de.mickare.xserver.net;
public interface XServer {
/**
* Try to establish a connection to this server
*
* @throws UnknownHostException
* @throws IOException
* @throws InterruptedException
* @throws NotInitializedException
*/
public abstract void connect() throws UnknownHostExceptio... | // Path: XServer-API/src/main/java/de/mickare/xserver/AbstractXServerManager.java
// public interface AbstractXServerManager {
//
// public abstract void start() throws IOException;
//
// public abstract void start_async();
//
// public abstract void reconnectAll_soft();
//
// public abstract void reconnect... | public abstract boolean sendMessage(Message message) throws IOException; |
mickare/xserver | XServer-API/src/main/java/de/mickare/xserver/net/XServer.java | // Path: XServer-API/src/main/java/de/mickare/xserver/AbstractXServerManager.java
// public interface AbstractXServerManager {
//
// public abstract void start() throws IOException;
//
// public abstract void start_async();
//
// public abstract void reconnectAll_soft();
//
// public abstract void reconnect... | import java.io.IOException;
import java.net.UnknownHostException;
import java.util.Set;
import de.mickare.xserver.AbstractXServerManager;
import de.mickare.xserver.Message;
import de.mickare.xserver.XGroup;
import de.mickare.xserver.XType;
import de.mickare.xserver.exceptions.NotInitializedException; | package de.mickare.xserver.net;
public interface XServer {
/**
* Try to establish a connection to this server
*
* @throws UnknownHostException
* @throws IOException
* @throws InterruptedException
* @throws NotInitializedException
*/
public abstract void connect() throws UnknownHostExceptio... | // Path: XServer-API/src/main/java/de/mickare/xserver/AbstractXServerManager.java
// public interface AbstractXServerManager {
//
// public abstract void start() throws IOException;
//
// public abstract void start_async();
//
// public abstract void reconnectAll_soft();
//
// public abstract void reconnect... | public abstract XType getType(); |
mickare/xserver | XServer-API/src/main/java/de/mickare/xserver/EventHandler.java | // Path: XServer-API/src/main/java/de/mickare/xserver/events/XServerEvent.java
// public class XServerEvent {
//
// private final String text;
//
// public XServerEvent() {
// text = "";
// }
//
// public XServerEvent(String text) {
// this.text = text;
// }
//
// public String getText() {
// ... | import java.util.Map;
import de.mickare.xserver.events.XServerEvent; | package de.mickare.xserver;
public interface EventHandler<T> {
/**
* Get all Listeners...
*
* @return new Map
*/
public abstract Map<XServerListener, XServerListenerPlugin<T>> getListeners();
/**
* Register a new listener...
*
* @param plugin
* @param lis
*/
public abstract voi... | // Path: XServer-API/src/main/java/de/mickare/xserver/events/XServerEvent.java
// public class XServerEvent {
//
// private final String text;
//
// public XServerEvent() {
// text = "";
// }
//
// public XServerEvent(String text) {
// this.text = text;
// }
//
// public String getText() {
// ... | public abstract XServerEvent callEvent(XServerEvent event); |
mickare/xserver | XServer-Bukkit/src/main/java/de/mickare/xserver/commands/XServerCommands.java | // Path: XServer-Bukkit/src/main/java/de/mickare/xserver/BukkitXServerPlugin.java
// public class BukkitXServerPlugin extends JavaPlugin implements XServerPlugin {
//
// private static final long AUTORECONNECT = 10000;
// public static final XType HOMETYPE = XType.Bukkit;
//
// private Logger log;
//
// priv... | import java.util.Arrays;
import java.util.HashSet;
import org.bukkit.ChatColor;
import org.bukkit.command.Command;
import org.bukkit.command.CommandSender;
import de.mickare.xserver.BukkitXServerPlugin;
import de.mickare.xserver.commands.XServerSubCommands.*; | package de.mickare.xserver.commands;
public class XServerCommands extends AbstractCommand {
private HashSet<SubCommand> commands = new HashSet<SubCommand>();
| // Path: XServer-Bukkit/src/main/java/de/mickare/xserver/BukkitXServerPlugin.java
// public class BukkitXServerPlugin extends JavaPlugin implements XServerPlugin {
//
// private static final long AUTORECONNECT = 10000;
// public static final XType HOMETYPE = XType.Bukkit;
//
// private Logger log;
//
// priv... | public XServerCommands(BukkitXServerPlugin plugin) { |
mickare/xserver | XServer-Core/src/main/java/de/mickare/xserver/EventHandlerObj.java | // Path: XServer-API/src/main/java/de/mickare/xserver/events/XServerEvent.java
// public class XServerEvent {
//
// private final String text;
//
// public XServerEvent() {
// text = "";
// }
//
// public XServerEvent(String text) {
// this.text = text;
// }
//
// public String getText() {
// ... | import java.util.HashMap;
import java.util.HashSet;
import java.util.Map;
import java.util.Map.Entry;
import java.util.concurrent.ConcurrentHashMap;
import java.util.logging.Level;
import de.mickare.xserver.events.XServerEvent; | @Override
public synchronized void unregisterAll(XServerListenerPlugin<T> plugin) {
for (Entry<XServerListener, XServerListenerPlugin<T>> e : new HashSet<Entry<XServerListener, XServerListenerPlugin<T>>>(
listeners.entrySet())) {
if (e.getValue() == plugin) {
bus.unregister(e.getKey());
... | // Path: XServer-API/src/main/java/de/mickare/xserver/events/XServerEvent.java
// public class XServerEvent {
//
// private final String text;
//
// public XServerEvent() {
// text = "";
// }
//
// public XServerEvent(String text) {
// this.text = text;
// }
//
// public String getText() {
// ... | public XServerEvent callEvent(final XServerEvent event) { |
mickare/xserver | XServer-Bungee/src/main/java/de/mickare/xserver/BungeeXServerManager.java | // Path: XServer-API/src/main/java/de/mickare/xserver/exceptions/NotInitializedException.java
// @SuppressWarnings("serial")
// public class NotInitializedException extends RuntimeException {
//
// public NotInitializedException() {}
//
// public NotInitializedException(String reason) {
// super(reason);
// ... | import java.io.IOException;
import de.mickare.xserver.exceptions.InvalidConfigurationException;
import de.mickare.xserver.exceptions.NotInitializedException;
import de.mickare.xserver.listener.StressTestListener;
import de.mickare.xserver.util.MySQL; | package de.mickare.xserver;
public class BungeeXServerManager extends XServerManager {
public static BungeeXServerManager getInstance() throws NotInitializedException {
return (BungeeXServerManager) XServerManager.getInstance();
}
private final BungeeEventHandler eventhandler;
private final BungeeXServ... | // Path: XServer-API/src/main/java/de/mickare/xserver/exceptions/NotInitializedException.java
// @SuppressWarnings("serial")
// public class NotInitializedException extends RuntimeException {
//
// public NotInitializedException() {}
//
// public NotInitializedException(String reason) {
// super(reason);
// ... | protected BungeeXServerManager(String servername, BungeeXServerPlugin bungeePlugin, MySQL connection, String sql_table_xservers, |
mickare/xserver | XServer-API/src/main/java/de/mickare/xserver/util/InterruptableRunnable.java | // Path: XServer-API/src/main/java/de/mickare/xserver/ServerThreadPoolExecutor.java
// public interface ServerThreadPoolExecutor {
//
// /**
// * Here we add our jobs to working queue
// *
// * @param task a Runnable task
// */
// public abstract Future<?> runTask(Runnable task);
//
// /**
// *... | import de.mickare.xserver.ServerThreadPoolExecutor; | package de.mickare.xserver.util;
public abstract class InterruptableRunnable implements Runnable {
private volatile boolean interrupted = false;
private final String name;
public InterruptableRunnable(String name) {
this.name = name;
}
| // Path: XServer-API/src/main/java/de/mickare/xserver/ServerThreadPoolExecutor.java
// public interface ServerThreadPoolExecutor {
//
// /**
// * Here we add our jobs to working queue
// *
// * @param task a Runnable task
// */
// public abstract Future<?> runTask(Runnable task);
//
// /**
// *... | public void start(ServerThreadPoolExecutor threadpool) { |
mickare/xserver | XServer-API/src/main/java/de/mickare/xserver/events/XServerMessageEvent.java | // Path: XServer-API/src/main/java/de/mickare/xserver/Message.java
// public interface Message {
//
// /**
// * Get Sender Server Name
// *
// * @return sender name
// */
// public abstract XServer getSender();
//
// /**
// * SubChannel
// *
// * @return subchannel name
// */
// publ... | import de.mickare.xserver.Message;
import de.mickare.xserver.net.XServer; | package de.mickare.xserver.events;
public class XServerMessageEvent extends XServerEvent {
private final XServer server; | // Path: XServer-API/src/main/java/de/mickare/xserver/Message.java
// public interface Message {
//
// /**
// * Get Sender Server Name
// *
// * @return sender name
// */
// public abstract XServer getSender();
//
// /**
// * SubChannel
// *
// * @return subchannel name
// */
// publ... | private final Message message; |
mickare/xserver | XServer-API/src/main/java/de/mickare/xserver/net/Ping.java | // Path: XServer-API/src/main/java/de/mickare/xserver/user/ComSender.java
// public interface ComSender {
//
// public String getName();
//
// public boolean hasPermission(String perm);
//
// public void sendMessage(String message);
//
// }
| import java.util.Collection;
import de.mickare.xserver.user.ComSender; | package de.mickare.xserver.net;
public interface Ping {
public abstract boolean start();
public abstract void add(XServer server);
public abstract void addAll(Collection<XServer> servers);
public abstract void receive(XServer server);
public abstract boolean isPending();
public abstract String getF... | // Path: XServer-API/src/main/java/de/mickare/xserver/user/ComSender.java
// public interface ComSender {
//
// public String getName();
//
// public boolean hasPermission(String perm);
//
// public void sendMessage(String message);
//
// }
// Path: XServer-API/src/main/java/de/mickare/xserver/net/Ping.java... | public abstract ComSender getSender(); |
mickare/xserver | XServer-API/src/main/java/de/mickare/xserver/AbstractXServerManager.java | // Path: XServer-API/src/main/java/de/mickare/xserver/net/XServer.java
// public interface XServer {
//
// /**
// * Try to establish a connection to this server
// *
// * @throws UnknownHostException
// * @throws IOException
// * @throws InterruptedException
// * @throws NotInitializedException
//... | import java.io.IOException;
import java.util.Set;
import java.util.logging.Logger;
import javax.net.SocketFactory;
import de.mickare.xserver.exceptions.InvalidConfigurationException;
import de.mickare.xserver.net.XServer; | package de.mickare.xserver;
public interface AbstractXServerManager {
public abstract void start() throws IOException;
public abstract void start_async();
public abstract void reconnectAll_soft();
public abstract void reconnectAll_forced();
public abstract void stop() throws IOException;
/**
* ... | // Path: XServer-API/src/main/java/de/mickare/xserver/net/XServer.java
// public interface XServer {
//
// /**
// * Try to establish a connection to this server
// *
// * @throws UnknownHostException
// * @throws IOException
// * @throws InterruptedException
// * @throws NotInitializedException
//... | public abstract XServer getHomeServer(); |
mickare/xserver | XServer-Core/src/main/java/de/mickare/xserver/XServerManager.java | // Path: XServer-API/src/main/java/de/mickare/xserver/exceptions/NotInitializedException.java
// @SuppressWarnings("serial")
// public class NotInitializedException extends RuntimeException {
//
// public NotInitializedException() {}
//
// public NotInitializedException(String reason) {
// super(reason);
// ... | import java.io.IOException;
import de.mickare.xserver.exceptions.InvalidConfigurationException;
import de.mickare.xserver.exceptions.NotInitializedException;
import de.mickare.xserver.util.MySQL; | package de.mickare.xserver;
public abstract class XServerManager extends AbstractXServerManagerObj {
private static XServerManager instance = null;
| // Path: XServer-API/src/main/java/de/mickare/xserver/exceptions/NotInitializedException.java
// @SuppressWarnings("serial")
// public class NotInitializedException extends RuntimeException {
//
// public NotInitializedException() {}
//
// public NotInitializedException(String reason) {
// super(reason);
// ... | public static XServerManager getInstance() throws NotInitializedException { |
mickare/xserver | XServer-Core/src/main/java/de/mickare/xserver/XServerManager.java | // Path: XServer-API/src/main/java/de/mickare/xserver/exceptions/NotInitializedException.java
// @SuppressWarnings("serial")
// public class NotInitializedException extends RuntimeException {
//
// public NotInitializedException() {}
//
// public NotInitializedException(String reason) {
// super(reason);
// ... | import java.io.IOException;
import de.mickare.xserver.exceptions.InvalidConfigurationException;
import de.mickare.xserver.exceptions.NotInitializedException;
import de.mickare.xserver.util.MySQL; | package de.mickare.xserver;
public abstract class XServerManager extends AbstractXServerManagerObj {
private static XServerManager instance = null;
public static XServerManager getInstance() throws NotInitializedException {
if (instance == null) {
throw new NotInitializedException();
}
return... | // Path: XServer-API/src/main/java/de/mickare/xserver/exceptions/NotInitializedException.java
// @SuppressWarnings("serial")
// public class NotInitializedException extends RuntimeException {
//
// public NotInitializedException() {}
//
// public NotInitializedException(String reason) {
// super(reason);
// ... | protected XServerManager(String servername, XServerPlugin plugin, MySQL connection, String sql_table_xservers, String sql_table_xgroups, |
mickare/xserver | XServer-Core/src/main/java/de/mickare/xserver/EventBus.java | // Path: XServer-API/src/main/java/de/mickare/xserver/events/XServerEvent.java
// public class XServerEvent {
//
// private final String text;
//
// public XServerEvent() {
// text = "";
// }
//
// public XServerEvent(String text) {
// this.text = text;
// }
//
// public String getText() {
// ... | import java.lang.reflect.InvocationTargetException;
import java.lang.reflect.Method;
import java.text.MessageFormat;
import java.util.Collections;
import java.util.HashMap;
import java.util.HashSet;
import java.util.Map;
import java.util.Set;
import java.util.concurrent.ConcurrentHashMap;
import java.util.logging.Level... | package de.mickare.xserver;
// Class from MD5 - BungeeCord
public class EventBus<T> {
private final Map<Class<?>, Map<Object, Method[]>> eventToHandler = new HashMap<>();
private final Map<Method, Boolean> synced = Collections.synchronizedMap(new HashMap<Method, Boolean>());
private final Map<Method, String>... | // Path: XServer-API/src/main/java/de/mickare/xserver/events/XServerEvent.java
// public class XServerEvent {
//
// private final String text;
//
// public XServerEvent() {
// text = "";
// }
//
// public XServerEvent(String text) {
// this.text = text;
// }
//
// public String getText() {
// ... | private final CloseableReadWriteLock lock = new CloseableReentrantReadWriteLock(); |
mickare/xserver | XServer-Core/src/main/java/de/mickare/xserver/EventBus.java | // Path: XServer-API/src/main/java/de/mickare/xserver/events/XServerEvent.java
// public class XServerEvent {
//
// private final String text;
//
// public XServerEvent() {
// text = "";
// }
//
// public XServerEvent(String text) {
// this.text = text;
// }
//
// public String getText() {
// ... | import java.lang.reflect.InvocationTargetException;
import java.lang.reflect.Method;
import java.text.MessageFormat;
import java.util.Collections;
import java.util.HashMap;
import java.util.HashSet;
import java.util.Map;
import java.util.Set;
import java.util.concurrent.ConcurrentHashMap;
import java.util.logging.Level... | package de.mickare.xserver;
// Class from MD5 - BungeeCord
public class EventBus<T> {
private final Map<Class<?>, Map<Object, Method[]>> eventToHandler = new HashMap<>();
private final Map<Method, Boolean> synced = Collections.synchronizedMap(new HashMap<Method, Boolean>());
private final Map<Method, String>... | // Path: XServer-API/src/main/java/de/mickare/xserver/events/XServerEvent.java
// public class XServerEvent {
//
// private final String text;
//
// public XServerEvent() {
// text = "";
// }
//
// public XServerEvent(String text) {
// this.text = text;
// }
//
// public String getText() {
// ... | private Map<Object, Method[]> getHandlers(final XServerEvent event) { |
mickare/xserver | XServer-Bukkit/src/main/java/de/mickare/xserver/BukkitXServerManager.java | // Path: XServer-API/src/main/java/de/mickare/xserver/exceptions/NotInitializedException.java
// @SuppressWarnings("serial")
// public class NotInitializedException extends RuntimeException {
//
// public NotInitializedException() {}
//
// public NotInitializedException(String reason) {
// super(reason);
// ... | import java.io.IOException;
import de.mickare.xserver.exceptions.InvalidConfigurationException;
import de.mickare.xserver.exceptions.NotInitializedException;
import de.mickare.xserver.listener.StressTestListener;
import de.mickare.xserver.util.MySQL; | package de.mickare.xserver;
public class BukkitXServerManager extends XServerManager {
public static BukkitXServerManager getInstance() throws NotInitializedException {
return (BukkitXServerManager) XServerManager.getInstance();
}
private final BukkitEventHandler eventhandler;
private final BukkitXServ... | // Path: XServer-API/src/main/java/de/mickare/xserver/exceptions/NotInitializedException.java
// @SuppressWarnings("serial")
// public class NotInitializedException extends RuntimeException {
//
// public NotInitializedException() {}
//
// public NotInitializedException(String reason) {
// super(reason);
// ... | protected BukkitXServerManager(String servername, BukkitXServerPlugin bukkitPlugin, MySQL connection, String sql_table_xservers, |
chiehmin/MinMinGuard | app/src/main/java/tw/fatminmin/xposed/minminguard/ui/adapter/ModeFragmentAdapter.java | // Path: app/src/main/java/tw/fatminmin/xposed/minminguard/ui/fragments/MainFragment.java
// public class MainFragment extends Fragment
// {
//
// public boolean isAlive = false;
// private MainActivity mainActivity;
// private FragmentMode mMode;
// private Button mBtnMode;
// private AppsAdapter ... | import android.content.Context;
import androidx.fragment.app.Fragment;
import androidx.fragment.app.FragmentManager;
import androidx.fragment.app.FragmentPagerAdapter;
import tw.fatminmin.xposed.minminguard.R;
import tw.fatminmin.xposed.minminguard.ui.fragments.MainFragment; | package tw.fatminmin.xposed.minminguard.ui.adapter;
/**
* Created by fatminmin on 4/21/16.
*/
public final class ModeFragmentAdapter extends FragmentPagerAdapter
{
private static final int PAGE_COUNT = 3;
private Context mContext;
private String[] mTabTitles = new String[]{"AUTO", "Blacklist", "Whitel... | // Path: app/src/main/java/tw/fatminmin/xposed/minminguard/ui/fragments/MainFragment.java
// public class MainFragment extends Fragment
// {
//
// public boolean isAlive = false;
// private MainActivity mainActivity;
// private FragmentMode mMode;
// private Button mBtnMode;
// private AppsAdapter ... | private MainFragment[] mFragments = new MainFragment[]{ |
chiehmin/MinMinGuard | app/src/main/java/tw/fatminmin/xposed/minminguard/blocker/custom_mod/PeriodCalendar.java | // Path: app/src/main/java/tw/fatminmin/xposed/minminguard/blocker/ViewBlocking.java
// public class ViewBlocking
// {
// public static void removeAdView(String packageName, View view)
// {
// Util.notifyRemoveAdView(view.getContext(), packageName, 1);
// removeAdView(packageName, view, true, 51... | import android.view.View;
import de.robv.android.xposed.callbacks.XC_InitPackageResources;
import de.robv.android.xposed.callbacks.XC_LayoutInflated;
import tw.fatminmin.xposed.minminguard.blocker.ViewBlocking; | package tw.fatminmin.xposed.minminguard.blocker.custom_mod;
/**
* Created by fatminmin on 2015/10/30.
*/
final class PeriodCalendar
{
private static String pkgName = "com.popularapp.periodcalendar";
private PeriodCalendar() throws InstantiationException
{
throw new InstantiationException("This... | // Path: app/src/main/java/tw/fatminmin/xposed/minminguard/blocker/ViewBlocking.java
// public class ViewBlocking
// {
// public static void removeAdView(String packageName, View view)
// {
// Util.notifyRemoveAdView(view.getContext(), packageName, 1);
// removeAdView(packageName, view, true, 51... | ViewBlocking.removeAdView(pkgName, ad); |
chiehmin/MinMinGuard | app/src/main/java/tw/fatminmin/xposed/minminguard/blocker/custom_mod/_2chMate.java | // Path: app/src/main/java/tw/fatminmin/xposed/minminguard/blocker/Util.java
// public final class Util
// {
// // change it to false for release build
// public static boolean DEBUG = BuildConfig.DEBUG;
//
// public static ExecutorService notifyWorker;
//
// public static final String TAG = "MinMinGu... | import android.view.View;
import de.robv.android.xposed.XC_MethodHook;
import de.robv.android.xposed.XposedBridge;
import de.robv.android.xposed.XposedHelpers;
import de.robv.android.xposed.XposedHelpers.ClassNotFoundError;
import de.robv.android.xposed.callbacks.XC_LoadPackage.LoadPackageParam;
import tw.fatminmin.xpo... | package tw.fatminmin.xposed.minminguard.blocker.custom_mod;
public final class _2chMate
{
private _2chMate() throws InstantiationException
{
throw new InstantiationException("This class is not for instantiation");
}
public static boolean handleLoadPackage(final String packageName, LoadPackag... | // Path: app/src/main/java/tw/fatminmin/xposed/minminguard/blocker/Util.java
// public final class Util
// {
// // change it to false for release build
// public static boolean DEBUG = BuildConfig.DEBUG;
//
// public static ExecutorService notifyWorker;
//
// public static final String TAG = "MinMinGu... | Util.log(packageName, "Detect 2chmate MyAdView in " + packageName); |
chiehmin/MinMinGuard | app/src/main/java/tw/fatminmin/xposed/minminguard/blocker/adnetwork/Onelouder.java | // Path: app/src/main/java/tw/fatminmin/xposed/minminguard/blocker/Blocker.java
// public abstract class Blocker
// {
// /**
// * @param packageName
// * @param lpparam
// * @return True if currrent handling app using this adnetwork. False otherwise.
// */
// abstract public boolean handleLo... | import android.view.View;
import de.robv.android.xposed.XC_MethodHook;
import de.robv.android.xposed.XposedBridge;
import de.robv.android.xposed.XposedHelpers;
import de.robv.android.xposed.XposedHelpers.ClassNotFoundError;
import de.robv.android.xposed.callbacks.XC_LoadPackage.LoadPackageParam;
import tw.fatminmin.xpo... | package tw.fatminmin.xposed.minminguard.blocker.adnetwork;
public class Onelouder extends Blocker
{
private static final String BANNER = "com.onelouder.adlib.AdView";
private static final String BANNER_PREFIX = "com.onelouder.adlib";
//TODO Use APIBlocking
public boolean handleLoadPackage(final Str... | // Path: app/src/main/java/tw/fatminmin/xposed/minminguard/blocker/Blocker.java
// public abstract class Blocker
// {
// /**
// * @param packageName
// * @param lpparam
// * @return True if currrent handling app using this adnetwork. False otherwise.
// */
// abstract public boolean handleLo... | Util.log(packageName, "Detect onelouder AdView setVisibility in " + packageName); |
chiehmin/MinMinGuard | app/src/main/java/tw/fatminmin/xposed/minminguard/blocker/adnetwork/mAdserve.java | // Path: app/src/main/java/tw/fatminmin/xposed/minminguard/blocker/Blocker.java
// public abstract class Blocker
// {
// /**
// * @param packageName
// * @param lpparam
// * @return True if currrent handling app using this adnetwork. False otherwise.
// */
// abstract public boolean handleLo... | import de.robv.android.xposed.XC_MethodHook;
import de.robv.android.xposed.XposedBridge;
import de.robv.android.xposed.XposedHelpers;
import de.robv.android.xposed.XposedHelpers.ClassNotFoundError;
import de.robv.android.xposed.callbacks.XC_LoadPackage.LoadPackageParam;
import tw.fatminmin.xposed.minminguard.blocker.Bl... | package tw.fatminmin.xposed.minminguard.blocker.adnetwork;
public class mAdserve extends Blocker
{
private static final String BANNER = "com.adsdk.sdk.banner.InAppWebView";
private static final String BANNER_PREFIX = "com.adsdk.sdk.banner";
public boolean handleLoadPackage(final String packageName, Load... | // Path: app/src/main/java/tw/fatminmin/xposed/minminguard/blocker/Blocker.java
// public abstract class Blocker
// {
// /**
// * @param packageName
// * @param lpparam
// * @return True if currrent handling app using this adnetwork. False otherwise.
// */
// abstract public boolean handleLo... | Util.log(packageName, "Detect mAdserve InAppWebView constructor in " + packageName); |
chiehmin/MinMinGuard | app/src/main/java/tw/fatminmin/xposed/minminguard/blocker/custom_mod/Viafree.java | // Path: app/src/main/java/tw/fatminmin/xposed/minminguard/blocker/Util.java
// public final class Util
// {
// // change it to false for release build
// public static boolean DEBUG = BuildConfig.DEBUG;
//
// public static ExecutorService notifyWorker;
//
// public static final String TAG = "MinMinGu... | import de.robv.android.xposed.XC_MethodHook;
import de.robv.android.xposed.XposedHelpers;
import de.robv.android.xposed.callbacks.XC_LoadPackage;
import tw.fatminmin.xposed.minminguard.blocker.Util;
import java.util.ArrayList; | package tw.fatminmin.xposed.minminguard.blocker.custom_mod;
public final class Viafree
{
private static final String pkg = "viafree.android";
private static final String className = "com.viafree.android.videoplayer.ad.models.Freewheel";
private static final String method = "f";
private Viafree() thr... | // Path: app/src/main/java/tw/fatminmin/xposed/minminguard/blocker/Util.java
// public final class Util
// {
// // change it to false for release build
// public static boolean DEBUG = BuildConfig.DEBUG;
//
// public static ExecutorService notifyWorker;
//
// public static final String TAG = "MinMinGu... | Util.notifyRemoveAdView(null, packageName, 1); |
chiehmin/MinMinGuard | app/src/main/java/tw/fatminmin/xposed/minminguard/Common.java | // Path: app/src/main/java/tw/fatminmin/xposed/minminguard/ui/fragments/MainFragment.java
// public class MainFragment extends Fragment
// {
//
// public boolean isAlive = false;
// private MainActivity mainActivity;
// private FragmentMode mMode;
// private Button mBtnMode;
// private AppsAdapter ... | import tw.fatminmin.xposed.minminguard.ui.fragments.MainFragment; | package tw.fatminmin.xposed.minminguard;
/**
* Created by fatminmin on 2015/10/1.
*/
public class Common
{
public final static String PACKAGE_NAME = BuildConfig.APPLICATION_ID;
public final static String MOD_PREFS = "ModSettings";
public final static String UI_PREFS = "UI_PREF";
// UI Pref
pub... | // Path: app/src/main/java/tw/fatminmin/xposed/minminguard/ui/fragments/MainFragment.java
// public class MainFragment extends Fragment
// {
//
// public boolean isAlive = false;
// private MainActivity mainActivity;
// private FragmentMode mMode;
// private Button mBtnMode;
// private AppsAdapter ... | public static String getModeString(MainFragment.FragmentMode mode) |
chiehmin/MinMinGuard | app/src/main/java/tw/fatminmin/xposed/minminguard/blocker/Util.java | // Path: app/src/main/java/tw/fatminmin/xposed/minminguard/Common.java
// public class Common
// {
// public final static String PACKAGE_NAME = BuildConfig.APPLICATION_ID;
//
// public final static String MOD_PREFS = "ModSettings";
// public final static String UI_PREFS = "UI_PREF";
//
// // UI Pref
/... | import android.app.AndroidAppHelper;
import android.app.Application;
import android.content.ContentResolver;
import android.content.ContentValues;
import android.content.Context;
import android.content.pm.PackageManager;
import android.net.Uri;
import android.os.Handler;
import java.io.File;
import java.util.concurrent... | {
@Override
public void run()
{
try
{
}
catch (Exception e)
{
e.printStackTrace();
}
}
});
}
public static void notifyAdNetwork(f... | // Path: app/src/main/java/tw/fatminmin/xposed/minminguard/Common.java
// public class Common
// {
// public final static String PACKAGE_NAME = BuildConfig.APPLICATION_ID;
//
// public final static String MOD_PREFS = "ModSettings";
// public final static String UI_PREFS = "UI_PREF";
//
// // UI Pref
/... | values.put(Common.KEY_PKG_NAME, pkgName); |
chiehmin/MinMinGuard | app/src/main/java/tw/fatminmin/xposed/minminguard/ui/dialog/AppDetailDialogFragment.java | // Path: app/src/main/java/tw/fatminmin/xposed/minminguard/Common.java
// public class Common
// {
// public final static String PACKAGE_NAME = BuildConfig.APPLICATION_ID;
//
// public final static String MOD_PREFS = "ModSettings";
// public final static String UI_PREFS = "UI_PREF";
//
// // UI Pref
/... | import android.content.Context;
import android.content.SharedPreferences;
import android.content.pm.PackageManager;
import android.graphics.drawable.Drawable;
import android.os.Bundle;
import androidx.annotation.Nullable;
import androidx.core.content.ContextCompat;
import androidx.fragment.app.DialogFragment;
import an... | package tw.fatminmin.xposed.minminguard.ui.dialog;
/**
* Created by fatminmin on 2015/10/25.
*/
public class AppDetailDialogFragment extends DialogFragment
{
private ImageView imgAppIcon;
private TextView txtAppName;
private TextView txtPkgName;
private TextView txtAdNetworks;
private TextView ... | // Path: app/src/main/java/tw/fatminmin/xposed/minminguard/Common.java
// public class Common
// {
// public final static String PACKAGE_NAME = BuildConfig.APPLICATION_ID;
//
// public final static String MOD_PREFS = "ModSettings";
// public final static String UI_PREFS = "UI_PREF";
//
// // UI Pref
/... | public static AppDetailDialogFragment newInstance(String appName, String pkgName, AppData appData) |
chiehmin/MinMinGuard | app/src/main/java/tw/fatminmin/xposed/minminguard/ui/dialog/AppDetailDialogFragment.java | // Path: app/src/main/java/tw/fatminmin/xposed/minminguard/Common.java
// public class Common
// {
// public final static String PACKAGE_NAME = BuildConfig.APPLICATION_ID;
//
// public final static String MOD_PREFS = "ModSettings";
// public final static String UI_PREFS = "UI_PREF";
//
// // UI Pref
/... | import android.content.Context;
import android.content.SharedPreferences;
import android.content.pm.PackageManager;
import android.graphics.drawable.Drawable;
import android.os.Bundle;
import androidx.annotation.Nullable;
import androidx.core.content.ContextCompat;
import androidx.fragment.app.DialogFragment;
import an... | {
Bundle args = new Bundle();
args.putString("appName", appName);
args.putString("pkgName", pkgName);
if (appData != null)
{
args.putString("adNetworks", appData.getAdNetworks());
args.putInt("blockNum", appData.getBlockNum());
}
AppDe... | // Path: app/src/main/java/tw/fatminmin/xposed/minminguard/Common.java
// public class Common
// {
// public final static String PACKAGE_NAME = BuildConfig.APPLICATION_ID;
//
// public final static String MOD_PREFS = "ModSettings";
// public final static String UI_PREFS = "UI_PREF";
//
// // UI Pref
/... | mPref = ctx.getSharedPreferences(Common.MOD_PREFS, Context.MODE_PRIVATE); |
chiehmin/MinMinGuard | app/src/main/java/tw/fatminmin/xposed/minminguard/ui/models/AppDetails.java | // Path: app/src/main/java/tw/fatminmin/xposed/minminguard/ui/image/GlideModule.java
// @com.bumptech.glide.annotation.GlideModule
// public class GlideModule extends AppGlideModule {
//
// @Override
// public void registerComponents(@NonNull Context context, @NonNull Glide glide, @NonNull Registry registry) {... | import android.content.pm.ApplicationInfo;
import android.widget.ImageView;
import tw.fatminmin.xposed.minminguard.ui.image.GlideModule; | package tw.fatminmin.xposed.minminguard.ui.models;
public class AppDetails
{
private String name;
private String packageName;
private ApplicationInfo applicationInfo;
private boolean isEnabled;
public AppDetails(String name, String packageName, ApplicationInfo applicationInfo, boolean isEnabled... | // Path: app/src/main/java/tw/fatminmin/xposed/minminguard/ui/image/GlideModule.java
// @com.bumptech.glide.annotation.GlideModule
// public class GlideModule extends AppGlideModule {
//
// @Override
// public void registerComponents(@NonNull Context context, @NonNull Glide glide, @NonNull Registry registry) {... | GlideModule.loadApplicationIcon(imageView.getContext(), applicationInfo, imageView); |
chiehmin/MinMinGuard | app/src/main/java/tw/fatminmin/xposed/minminguard/blocker/custom_mod/Train.java | // Path: app/src/main/java/tw/fatminmin/xposed/minminguard/blocker/Util.java
// public final class Util
// {
// // change it to false for release build
// public static boolean DEBUG = BuildConfig.DEBUG;
//
// public static ExecutorService notifyWorker;
//
// public static final String TAG = "MinMinGu... | import android.view.View;
import de.robv.android.xposed.XC_MethodHook;
import de.robv.android.xposed.XposedHelpers;
import de.robv.android.xposed.callbacks.XC_InitPackageResources.InitPackageResourcesParam;
import de.robv.android.xposed.callbacks.XC_LayoutInflated;
import de.robv.android.xposed.callbacks.XC_LoadPackage... | package tw.fatminmin.xposed.minminguard.blocker.custom_mod;
//TODO Fix formatting
final class Train
{
private static String pkg = "idv.nightgospel.TWRailScheduleLookUp";
private Train() throws InstantiationException
{
throw new InstantiationException("This class is not for instantiation");
}... | // Path: app/src/main/java/tw/fatminmin/xposed/minminguard/blocker/Util.java
// public final class Util
// {
// // change it to false for release build
// public static boolean DEBUG = BuildConfig.DEBUG;
//
// public static ExecutorService notifyWorker;
//
// public static final String TAG = "MinMinGu... | Util.log(pkg, "Prevent WSAdBanner setWSAdListener " + pkg); |
sladkoff/minecraft-prometheus-exporter | src/main/java/de/sldk/mc/config/PrometheusExporterConfig.java | // Path: src/main/java/de/sldk/mc/MetricRegistry.java
// public class MetricRegistry {
//
// private static final MetricRegistry INSTANCE = new MetricRegistry();
//
// private final List<Metric> metrics = new ArrayList<>();
//
// private MetricRegistry() {
//
// }
//
// public s... | import de.sldk.mc.MetricRegistry;
import de.sldk.mc.PrometheusExporter;
import de.sldk.mc.metrics.*;
import org.bukkit.configuration.file.FileConfiguration;
import org.bukkit.plugin.Plugin;
import java.util.Arrays;
import java.util.List;
import java.util.function.Function; | package de.sldk.mc.config;
public class PrometheusExporterConfig {
public static final PluginConfig<String> HOST = new PluginConfig<>("host", "localhost");
public static final PluginConfig<Integer> PORT = new PluginConfig<>("port", 9225);
public static final List<MetricConfig> METRICS = Arrays.asList(
... | // Path: src/main/java/de/sldk/mc/MetricRegistry.java
// public class MetricRegistry {
//
// private static final MetricRegistry INSTANCE = new MetricRegistry();
//
// private final List<Metric> metrics = new ArrayList<>();
//
// private MetricRegistry() {
//
// }
//
// public s... | private final PrometheusExporter prometheusExporter; |
sladkoff/minecraft-prometheus-exporter | src/main/java/de/sldk/mc/config/PrometheusExporterConfig.java | // Path: src/main/java/de/sldk/mc/MetricRegistry.java
// public class MetricRegistry {
//
// private static final MetricRegistry INSTANCE = new MetricRegistry();
//
// private final List<Metric> metrics = new ArrayList<>();
//
// private MetricRegistry() {
//
// }
//
// public s... | import de.sldk.mc.MetricRegistry;
import de.sldk.mc.PrometheusExporter;
import de.sldk.mc.metrics.*;
import org.bukkit.configuration.file.FileConfiguration;
import org.bukkit.plugin.Plugin;
import java.util.Arrays;
import java.util.List;
import java.util.function.Function; | }
private static MetricConfig metricConfig(String key, boolean defaultValue, Function<Plugin, Metric> metricInitializer) {
return new MetricConfig(key, defaultValue, metricInitializer);
}
public void loadDefaultsAndSave() {
FileConfiguration configFile = prometheusExporter.getConfig();... | // Path: src/main/java/de/sldk/mc/MetricRegistry.java
// public class MetricRegistry {
//
// private static final MetricRegistry INSTANCE = new MetricRegistry();
//
// private final List<Metric> metrics = new ArrayList<>();
//
// private MetricRegistry() {
//
// }
//
// public s... | MetricRegistry.getInstance().register(metric); |
sladkoff/minecraft-prometheus-exporter | src/test/java/de/sldk/mc/metrics/PlayerStatisticLoaderFromFileTest.java | // Path: src/main/java/de/sldk/mc/metrics/player/PlayerStatisticLoaderFromFile.java
// public class PlayerStatisticLoaderFromFile implements PlayerStatisticLoader {
// public final String SERVER_PROPERTIES = "server.properties";
// public final String DEFAULT_WORLD = "world";
//
// private final Plugin plu... | import de.sldk.mc.metrics.player.PlayerStatisticLoaderFromFile;
import org.bukkit.plugin.Plugin;
import org.junit.jupiter.api.BeforeAll;
import org.junit.jupiter.api.Test;
import java.nio.file.Paths;
import java.util.logging.Logger;
import static org.assertj.core.api.Assertions.assertThat;
import static org.mockito.Moc... | package de.sldk.mc.metrics;
public class PlayerStatisticLoaderFromFileTest {
private static Plugin plugin; | // Path: src/main/java/de/sldk/mc/metrics/player/PlayerStatisticLoaderFromFile.java
// public class PlayerStatisticLoaderFromFile implements PlayerStatisticLoader {
// public final String SERVER_PROPERTIES = "server.properties";
// public final String DEFAULT_WORLD = "world";
//
// private final Plugin plu... | private static PlayerStatisticLoaderFromFile playerStatisticLoader; |
sladkoff/minecraft-prometheus-exporter | src/test/java/de/sldk/mc/exporter/PrometheusExporterTest.java | // Path: src/main/java/de/sldk/mc/MetricsServer.java
// public class MetricsServer {
//
// private final String host;
// private final int port;
// private final PrometheusExporter prometheusExporter;
//
// private Server server;
//
// public MetricsServer(String host, int port, PrometheusExporter prometheusExp... | import static org.assertj.core.api.Assertions.assertThat;
import static org.mockito.ArgumentMatchers.any;
import static org.mockito.Mockito.when;
import de.sldk.mc.MetricsServer;
import de.sldk.mc.PrometheusExporter;
import io.prometheus.client.CollectorRegistry;
import io.prometheus.client.Counter;
import io.prometheu... | package de.sldk.mc.exporter;
@ExtendWith(MockitoExtension.class)
public class PrometheusExporterTest {
@Mock | // Path: src/main/java/de/sldk/mc/MetricsServer.java
// public class MetricsServer {
//
// private final String host;
// private final int port;
// private final PrometheusExporter prometheusExporter;
//
// private Server server;
//
// public MetricsServer(String host, int port, PrometheusExporter prometheusExp... | private PrometheusExporter exporterMock; |
sladkoff/minecraft-prometheus-exporter | src/test/java/de/sldk/mc/exporter/PrometheusExporterTest.java | // Path: src/main/java/de/sldk/mc/MetricsServer.java
// public class MetricsServer {
//
// private final String host;
// private final int port;
// private final PrometheusExporter prometheusExporter;
//
// private Server server;
//
// public MetricsServer(String host, int port, PrometheusExporter prometheusExp... | import static org.assertj.core.api.Assertions.assertThat;
import static org.mockito.ArgumentMatchers.any;
import static org.mockito.Mockito.when;
import de.sldk.mc.MetricsServer;
import de.sldk.mc.PrometheusExporter;
import io.prometheus.client.CollectorRegistry;
import io.prometheus.client.Counter;
import io.prometheu... | package de.sldk.mc.exporter;
@ExtendWith(MockitoExtension.class)
public class PrometheusExporterTest {
@Mock
private PrometheusExporter exporterMock;
@Mock
private Server mockServer;
@Mock
private BukkitScheduler mockScheduler;
private int metricsServerPort; | // Path: src/main/java/de/sldk/mc/MetricsServer.java
// public class MetricsServer {
//
// private final String host;
// private final int port;
// private final PrometheusExporter prometheusExporter;
//
// private Server server;
//
// public MetricsServer(String host, int port, PrometheusExporter prometheusExp... | private MetricsServer metricsServer; |
sladkoff/minecraft-prometheus-exporter | src/main/java/de/sldk/mc/metrics/Tps.java | // Path: src/main/java/de/sldk/mc/tps/TpsCollector.java
// public class TpsCollector implements Runnable {
//
// /**
// * Max amount of ticks that should happen per second
// */
// static final int TICKS_PER_SECOND = 20;
// /**
// * Every 40 ticks (2s ideally) the server will be polled
// ... | import de.sldk.mc.tps.TpsCollector;
import io.prometheus.client.Gauge;
import org.bukkit.Bukkit;
import org.bukkit.plugin.Plugin; | package de.sldk.mc.metrics;
public class Tps extends Metric {
private static final Gauge TPS = Gauge.build()
.name(prefix("tps"))
.help("Server TPS (ticks per second)")
.create();
private int taskId;
| // Path: src/main/java/de/sldk/mc/tps/TpsCollector.java
// public class TpsCollector implements Runnable {
//
// /**
// * Max amount of ticks that should happen per second
// */
// static final int TICKS_PER_SECOND = 20;
// /**
// * Every 40 ticks (2s ideally) the server will be polled
// ... | private TpsCollector tpsCollector = new TpsCollector(); |
sladkoff/minecraft-prometheus-exporter | src/main/java/de/sldk/mc/MetricRegistry.java | // Path: src/main/java/de/sldk/mc/metrics/Metric.java
// public abstract class Metric {
//
// private final static String COMMON_PREFIX = "mc_";
//
// private final Plugin plugin;
// private final Collector collector;
//
// private boolean enabled = false;
//
// protected Metric(Plugin plugin, C... | import de.sldk.mc.metrics.Metric;
import java.util.ArrayList;
import java.util.List; | package de.sldk.mc;
public class MetricRegistry {
private static final MetricRegistry INSTANCE = new MetricRegistry();
| // Path: src/main/java/de/sldk/mc/metrics/Metric.java
// public abstract class Metric {
//
// private final static String COMMON_PREFIX = "mc_";
//
// private final Plugin plugin;
// private final Collector collector;
//
// private boolean enabled = false;
//
// protected Metric(Plugin plugin, C... | private final List<Metric> metrics = new ArrayList<>(); |
sladkoff/minecraft-prometheus-exporter | src/main/java/de/sldk/mc/config/MetricConfig.java | // Path: src/main/java/de/sldk/mc/metrics/Metric.java
// public abstract class Metric {
//
// private final static String COMMON_PREFIX = "mc_";
//
// private final Plugin plugin;
// private final Collector collector;
//
// private boolean enabled = false;
//
// protected Metric(Plugin plugin, C... | import de.sldk.mc.metrics.Metric;
import org.bukkit.plugin.Plugin;
import java.util.function.Function; | package de.sldk.mc.config;
public class MetricConfig extends PluginConfig<Boolean> {
private static final String CONFIG_PATH_PREFIX = "enable_metrics";
| // Path: src/main/java/de/sldk/mc/metrics/Metric.java
// public abstract class Metric {
//
// private final static String COMMON_PREFIX = "mc_";
//
// private final Plugin plugin;
// private final Collector collector;
//
// private boolean enabled = false;
//
// protected Metric(Plugin plugin, C... | private Function<Plugin, Metric> metricInitializer; |
binghuo365/csustRepo | trunk/src/com/yunstudio/struts/action/admin/asks/AsksAction.java | // Path: trunk/src/com/yunstudio/entity/RepMessage.java
// @SuppressWarnings("serial")
// public class RepMessage implements Serializable {
//
//
// private Integer id;
//
//
// private String title;
//
//
// private Date addtime;
//
//
// private String content;
//
//
// ... | import java.lang.reflect.InvocationTargetException;
import java.util.Arrays;
import java.util.Date;
import java.util.HashSet;
import java.util.List;
import java.util.Map;
import java.util.Set;
import org.apache.commons.beanutils.BeanUtils;
import org.hibernate.Session;
import org.hibernate.criterion.Criterion;
import o... | package com.yunstudio.struts.action.admin.asks;
@SuppressWarnings("serial")
public class AsksAction extends BaseAction{
private UserService userService;
private AdminService adminService; | // Path: trunk/src/com/yunstudio/entity/RepMessage.java
// @SuppressWarnings("serial")
// public class RepMessage implements Serializable {
//
//
// private Integer id;
//
//
// private String title;
//
//
// private Date addtime;
//
//
// private String content;
//
//
// ... | private MessageService messageService; |
binghuo365/csustRepo | trunk/src/com/yunstudio/struts/action/admin/asks/AsksAction.java | // Path: trunk/src/com/yunstudio/entity/RepMessage.java
// @SuppressWarnings("serial")
// public class RepMessage implements Serializable {
//
//
// private Integer id;
//
//
// private String title;
//
//
// private Date addtime;
//
//
// private String content;
//
//
// ... | import java.lang.reflect.InvocationTargetException;
import java.util.Arrays;
import java.util.Date;
import java.util.HashSet;
import java.util.List;
import java.util.Map;
import java.util.Set;
import org.apache.commons.beanutils.BeanUtils;
import org.hibernate.Session;
import org.hibernate.criterion.Criterion;
import o... | orders.remove(order);
orders.add(Order.asc("id"));
}else if (value.equals("addtime_desc")) {
orders.remove(order);
orders.add(Order.desc("addtime"));
}else if (value.equals("addtime_asc")) {
orders.remove(order);
orders.add(Order.asc("addtime"));
}
} else if (name.... | // Path: trunk/src/com/yunstudio/entity/RepMessage.java
// @SuppressWarnings("serial")
// public class RepMessage implements Serializable {
//
//
// private Integer id;
//
//
// private String title;
//
//
// private Date addtime;
//
//
// private String content;
//
//
// ... | RepMessage message=new RepMessage(); |
binghuo365/csustRepo | trunk/src/com/yunstudio/entity/RepResource.java | // Path: trunk/src/com/yunstudio/utils/StringUtil.java
// public class StringUtil {
// public static boolean isNullOrEmpty(String s) {
// return s==null||s.isEmpty();
// }
// public static List<RepFormat> paramsFormatParseList(String formatStr) {
// List<RepFormat> list=new ArrayList<RepFormat>();
// if (isNul... | import java.io.File;
import java.io.Serializable;
import java.util.Date;
import java.util.HashSet;
import java.util.Set;
import org.apache.commons.lang3.builder.ToStringBuilder;
import org.apache.struts2.ServletActionContext;
import com.yunstudio.utils.StringUtil; |
private Set<RepComment> repComments=new HashSet<RepComment>(0);
public RepResource(){}
public RepResource(String path,String translateurl) {
super();
this.path = path;
this.translateurl=translateurl;
}
public RepResource(String path,String title,String translateurl) {
super();
this.path = p... | // Path: trunk/src/com/yunstudio/utils/StringUtil.java
// public class StringUtil {
// public static boolean isNullOrEmpty(String s) {
// return s==null||s.isEmpty();
// }
// public static List<RepFormat> paramsFormatParseList(String formatStr) {
// List<RepFormat> list=new ArrayList<RepFormat>();
// if (isNul... | if(!StringUtil.isNullOrEmpty(repUserName)){ |
binghuo365/csustRepo | trunk/src/com/yunstudio/struts/action/admin/catalog/GsCatalogAction.java | // Path: trunk/src/com/yunstudio/utils/StringUtil.java
// public class StringUtil {
// public static boolean isNullOrEmpty(String s) {
// return s==null||s.isEmpty();
// }
// public static List<RepFormat> paramsFormatParseList(String formatStr) {
// List<RepFormat> list=new ArrayList<RepFormat>();
// if (isNul... | import java.util.HashSet;
import java.util.List;
import java.util.Set;
import javax.annotation.Resource;
import org.hibernate.criterion.Criterion;
import org.hibernate.criterion.Order;
import org.hibernate.criterion.Restrictions;
import com.yunstudio.entity.Page;
import com.yunstudio.entity.RepGscatalog;
import com.yun... | package com.yunstudio.struts.action.admin.catalog;
public class GsCatalogAction extends BaseAction{
@Resource(name="gsCatalogService")
private GsCatalogService gsCatalogService;
@SuppressWarnings("unchecked")
public String list() {
int pageNum=1;
int pageSize=20;
String name=getRequest().getParameter(... | // Path: trunk/src/com/yunstudio/utils/StringUtil.java
// public class StringUtil {
// public static boolean isNullOrEmpty(String s) {
// return s==null||s.isEmpty();
// }
// public static List<RepFormat> paramsFormatParseList(String formatStr) {
// List<RepFormat> list=new ArrayList<RepFormat>();
// if (isNul... | if(!StringUtil.isNullOrEmpty(name)){ |
binghuo365/csustRepo | trunk/src/com/yunstudio/struts/action/admin/catalog/TagAction.java | // Path: trunk/src/com/yunstudio/utils/StringUtil.java
// public class StringUtil {
// public static boolean isNullOrEmpty(String s) {
// return s==null||s.isEmpty();
// }
// public static List<RepFormat> paramsFormatParseList(String formatStr) {
// List<RepFormat> list=new ArrayList<RepFormat>();
// if (isNul... | import java.util.HashSet;
import java.util.List;
import java.util.Set;
import javax.annotation.Resource;
import org.hibernate.criterion.Criterion;
import org.hibernate.criterion.Order;
import org.hibernate.criterion.Restrictions;
import com.yunstudio.entity.Page;
import com.yunstudio.entity.RepTag;
import com.yunstudio... | package com.yunstudio.struts.action.admin.catalog;
public class TagAction extends BaseAction{
@Resource(name="tagService")
private TagService tagService;
@SuppressWarnings("unchecked")
public String list() {
int pageNum=1;
int pageSize=20;
String name=getRequest().getParameter("name");
String queryO... | // Path: trunk/src/com/yunstudio/utils/StringUtil.java
// public class StringUtil {
// public static boolean isNullOrEmpty(String s) {
// return s==null||s.isEmpty();
// }
// public static List<RepFormat> paramsFormatParseList(String formatStr) {
// List<RepFormat> list=new ArrayList<RepFormat>();
// if (isNul... | if(!StringUtil.isNullOrEmpty(name)){ |
Coreoz/Plume | plume-db-querydsl/src/main/java/com/coreoz/plume/db/querydsl/crud/CrudDaoQuerydsl.java | // Path: plume-db/src/main/java/com/coreoz/plume/db/crud/CrudDao.java
// public interface CrudDao<T> {
//
// List<T> findAll();
//
// T findById(Long id);
//
// T save(T entityToUpdate);
//
// long delete(Long id);
//
// }
//
// Path: plume-db-querydsl/src/main/java/com/coreoz/plume/db/querydsl/transaction/Tr... | import java.sql.Connection;
import com.coreoz.plume.db.crud.CrudDao;
import com.coreoz.plume.db.querydsl.transaction.TransactionManagerQuerydsl;
import com.coreoz.plume.db.utils.IdGenerator;
import com.querydsl.core.types.OrderSpecifier;
import com.querydsl.core.types.dsl.NumberPath;
import com.querydsl.sql.RelationalP... | package com.coreoz.plume.db.querydsl.crud;
public class CrudDaoQuerydsl<T extends CrudEntity> extends QueryDslDao<T> implements CrudDao<T> {
private final NumberPath<Long> idPath;
| // Path: plume-db/src/main/java/com/coreoz/plume/db/crud/CrudDao.java
// public interface CrudDao<T> {
//
// List<T> findAll();
//
// T findById(Long id);
//
// T save(T entityToUpdate);
//
// long delete(Long id);
//
// }
//
// Path: plume-db-querydsl/src/main/java/com/coreoz/plume/db/querydsl/transaction/Tr... | public CrudDaoQuerydsl(TransactionManagerQuerydsl transactionManager, |
Coreoz/Plume | plume-db-querydsl/src/main/java/com/coreoz/plume/db/querydsl/crud/CrudDaoQuerydsl.java | // Path: plume-db/src/main/java/com/coreoz/plume/db/crud/CrudDao.java
// public interface CrudDao<T> {
//
// List<T> findAll();
//
// T findById(Long id);
//
// T save(T entityToUpdate);
//
// long delete(Long id);
//
// }
//
// Path: plume-db-querydsl/src/main/java/com/coreoz/plume/db/querydsl/transaction/Tr... | import java.sql.Connection;
import com.coreoz.plume.db.crud.CrudDao;
import com.coreoz.plume.db.querydsl.transaction.TransactionManagerQuerydsl;
import com.coreoz.plume.db.utils.IdGenerator;
import com.querydsl.core.types.OrderSpecifier;
import com.querydsl.core.types.dsl.NumberPath;
import com.querydsl.sql.RelationalP... | .populate(entityToUpdate)
.execute();
return entityToUpdate;
}
// update
transactionManager
.update(table, connection)
.populate(entityToUpdate, DefaultMapper.WITH_NULL_BINDINGS)
.where(idPath.eq(entityToUpdate.getId()))
.execute();
return entityToUpdate;
}
@Override
public long delet... | // Path: plume-db/src/main/java/com/coreoz/plume/db/crud/CrudDao.java
// public interface CrudDao<T> {
//
// List<T> findAll();
//
// T findById(Long id);
//
// T save(T entityToUpdate);
//
// long delete(Long id);
//
// }
//
// Path: plume-db-querydsl/src/main/java/com/coreoz/plume/db/querydsl/transaction/Tr... | return IdGenerator.generate(); |
Coreoz/Plume | plume-db-querydsl/src/test/java/com/coreoz/plume/db/querydsl/crud/CrudDaoQuerydslTransactionTest.java | // Path: plume-db-querydsl/src/test/java/com/coreoz/plume/db/querydsl/DbQuerydslTestModule.java
// public class DbQuerydslTestModule extends AbstractModule {
//
// @Override
// protected void configure() {
// install(new GuiceConfModule());
// install(new DataSourceModule());
// install(new GuiceDbTestModule()... | import static org.assertj.core.api.Assertions.assertThat;
import java.sql.SQLException;
import javax.inject.Inject;
import javax.sql.DataSource;
import org.junit.Test;
import org.junit.runner.RunWith;
import com.carlosbecker.guice.GuiceModules;
import com.carlosbecker.guice.GuiceTestRunner;
import com.coreoz.plume.db.q... | package com.coreoz.plume.db.querydsl.crud;
/**
* Ensure that transaction management behave as expected for daos
*/
@RunWith(GuiceTestRunner.class)
@GuiceModules(DbQuerydslTestModule.class)
public class CrudDaoQuerydslTransactionTest {
@Inject
DataSource dataSource;
@Test
public void check_that_connection_... | // Path: plume-db-querydsl/src/test/java/com/coreoz/plume/db/querydsl/DbQuerydslTestModule.java
// public class DbQuerydslTestModule extends AbstractModule {
//
// @Override
// protected void configure() {
// install(new GuiceConfModule());
// install(new DataSourceModule());
// install(new GuiceDbTestModule()... | User user = new User(); |
Coreoz/Plume | plume-db-querydsl/src/test/java/com/coreoz/plume/db/querydsl/crud/CrudDaoQuerydslTransactionTest.java | // Path: plume-db-querydsl/src/test/java/com/coreoz/plume/db/querydsl/DbQuerydslTestModule.java
// public class DbQuerydslTestModule extends AbstractModule {
//
// @Override
// protected void configure() {
// install(new GuiceConfModule());
// install(new DataSourceModule());
// install(new GuiceDbTestModule()... | import static org.assertj.core.api.Assertions.assertThat;
import java.sql.SQLException;
import javax.inject.Inject;
import javax.sql.DataSource;
import org.junit.Test;
import org.junit.runner.RunWith;
import com.carlosbecker.guice.GuiceModules;
import com.carlosbecker.guice.GuiceTestRunner;
import com.coreoz.plume.db.q... |
@Test
public void check_that_connection_is_NOT_released_after_transactional_save() throws SQLException {
DaoInstancesHolder daoInstancesHolder = new DaoInstancesHolder(dataSource);
User user = new User();
user.setName("test");
daoInstancesHolder.userDao.save(user, daoInstancesHolder.getMockedConnection());
... | // Path: plume-db-querydsl/src/test/java/com/coreoz/plume/db/querydsl/DbQuerydslTestModule.java
// public class DbQuerydslTestModule extends AbstractModule {
//
// @Override
// protected void configure() {
// install(new GuiceConfModule());
// install(new DataSourceModule());
// install(new GuiceDbTestModule()... | private static class DaoInstancesHolder extends TransactionInstancesHolder { |
Coreoz/Plume | plume-db-querydsl/src/test/java/com/coreoz/plume/db/querydsl/crud/CrudDaoQuerydslTransactionTest.java | // Path: plume-db-querydsl/src/test/java/com/coreoz/plume/db/querydsl/DbQuerydslTestModule.java
// public class DbQuerydslTestModule extends AbstractModule {
//
// @Override
// protected void configure() {
// install(new GuiceConfModule());
// install(new DataSourceModule());
// install(new GuiceDbTestModule()... | import static org.assertj.core.api.Assertions.assertThat;
import java.sql.SQLException;
import javax.inject.Inject;
import javax.sql.DataSource;
import org.junit.Test;
import org.junit.runner.RunWith;
import com.carlosbecker.guice.GuiceModules;
import com.carlosbecker.guice.GuiceTestRunner;
import com.coreoz.plume.db.q... | @Test
public void check_that_connection_is_NOT_released_after_transactional_save() throws SQLException {
DaoInstancesHolder daoInstancesHolder = new DaoInstancesHolder(dataSource);
User user = new User();
user.setName("test");
daoInstancesHolder.userDao.save(user, daoInstancesHolder.getMockedConnection());
... | // Path: plume-db-querydsl/src/test/java/com/coreoz/plume/db/querydsl/DbQuerydslTestModule.java
// public class DbQuerydslTestModule extends AbstractModule {
//
// @Override
// protected void configure() {
// install(new GuiceConfModule());
// install(new DataSourceModule());
// install(new GuiceDbTestModule()... | private UserDao userDao; |
Coreoz/Plume | plume-conf/src/main/java/com/coreoz/plume/conf/dagger/DaggerConfModule.java | // Path: plume-conf/src/main/java/com/coreoz/plume/conf/ConfigProvider.java
// @Singleton
// public class ConfigProvider implements Provider<Config> {
//
// private Config config;
//
// @Inject
// public ConfigProvider() {
// this.config = ConfigFactory.load();
// }
//
// @Override
// public Config get() {
/... | import com.coreoz.plume.conf.ConfigProvider;
import com.typesafe.config.Config;
import dagger.Module;
import dagger.Provides;
import javax.inject.Singleton; | package com.coreoz.plume.conf.dagger;
@Module
public class DaggerConfModule {
@Provides
@Singleton | // Path: plume-conf/src/main/java/com/coreoz/plume/conf/ConfigProvider.java
// @Singleton
// public class ConfigProvider implements Provider<Config> {
//
// private Config config;
//
// @Inject
// public ConfigProvider() {
// this.config = ConfigFactory.load();
// }
//
// @Override
// public Config get() {
/... | static Config provideConfig(ConfigProvider configProvider) { |
Coreoz/Plume | plume-db-querydsl/src/test/java/com/coreoz/plume/db/querydsl/DbQuerydslTestModule.java | // Path: plume-conf/src/main/java/com/coreoz/plume/conf/guice/GuiceConfModule.java
// public class GuiceConfModule extends AbstractModule {
//
// @Override
// protected void configure() {
// bind(Config.class).toProvider(ConfigProvider.class);
// }
//
// }
//
// Path: plume-db/src/main/java/com/coreoz/plume/db/... | import com.coreoz.plume.conf.guice.GuiceConfModule;
import com.coreoz.plume.db.guice.DataSourceModule;
import com.coreoz.plume.db.guice.GuiceDbTestModule;
import com.google.inject.AbstractModule; | package com.coreoz.plume.db.querydsl;
public class DbQuerydslTestModule extends AbstractModule {
@Override
protected void configure() { | // Path: plume-conf/src/main/java/com/coreoz/plume/conf/guice/GuiceConfModule.java
// public class GuiceConfModule extends AbstractModule {
//
// @Override
// protected void configure() {
// bind(Config.class).toProvider(ConfigProvider.class);
// }
//
// }
//
// Path: plume-db/src/main/java/com/coreoz/plume/db/... | install(new GuiceConfModule()); |
Coreoz/Plume | plume-db-querydsl/src/test/java/com/coreoz/plume/db/querydsl/DbQuerydslTestModule.java | // Path: plume-conf/src/main/java/com/coreoz/plume/conf/guice/GuiceConfModule.java
// public class GuiceConfModule extends AbstractModule {
//
// @Override
// protected void configure() {
// bind(Config.class).toProvider(ConfigProvider.class);
// }
//
// }
//
// Path: plume-db/src/main/java/com/coreoz/plume/db/... | import com.coreoz.plume.conf.guice.GuiceConfModule;
import com.coreoz.plume.db.guice.DataSourceModule;
import com.coreoz.plume.db.guice.GuiceDbTestModule;
import com.google.inject.AbstractModule; | package com.coreoz.plume.db.querydsl;
public class DbQuerydslTestModule extends AbstractModule {
@Override
protected void configure() {
install(new GuiceConfModule()); | // Path: plume-conf/src/main/java/com/coreoz/plume/conf/guice/GuiceConfModule.java
// public class GuiceConfModule extends AbstractModule {
//
// @Override
// protected void configure() {
// bind(Config.class).toProvider(ConfigProvider.class);
// }
//
// }
//
// Path: plume-db/src/main/java/com/coreoz/plume/db/... | install(new DataSourceModule()); |
Coreoz/Plume | plume-db-querydsl/src/test/java/com/coreoz/plume/db/querydsl/DbQuerydslTestModule.java | // Path: plume-conf/src/main/java/com/coreoz/plume/conf/guice/GuiceConfModule.java
// public class GuiceConfModule extends AbstractModule {
//
// @Override
// protected void configure() {
// bind(Config.class).toProvider(ConfigProvider.class);
// }
//
// }
//
// Path: plume-db/src/main/java/com/coreoz/plume/db/... | import com.coreoz.plume.conf.guice.GuiceConfModule;
import com.coreoz.plume.db.guice.DataSourceModule;
import com.coreoz.plume.db.guice.GuiceDbTestModule;
import com.google.inject.AbstractModule; | package com.coreoz.plume.db.querydsl;
public class DbQuerydslTestModule extends AbstractModule {
@Override
protected void configure() {
install(new GuiceConfModule());
install(new DataSourceModule()); | // Path: plume-conf/src/main/java/com/coreoz/plume/conf/guice/GuiceConfModule.java
// public class GuiceConfModule extends AbstractModule {
//
// @Override
// protected void configure() {
// bind(Config.class).toProvider(ConfigProvider.class);
// }
//
// }
//
// Path: plume-db/src/main/java/com/coreoz/plume/db/... | install(new GuiceDbTestModule()); |
Coreoz/Plume | plume-web-jersey/src/main/java/com/coreoz/plume/jersey/async/AsyncJersey.java | // Path: plume-web-jersey/src/main/java/com/coreoz/plume/jersey/errors/ErrorResponse.java
// public class ErrorResponse {
//
// private final String errorCode;
// private final Iterable<String> statusArguments;
//
// public ErrorResponse(WsError error, Iterable<String> statusArguments) {
// this.errorCode = erro... | import java.util.concurrent.CompletableFuture;
import java.util.function.BiConsumer;
import javax.ws.rs.container.AsyncResponse;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import com.coreoz.plume.jersey.errors.ErrorResponse;
import com.coreoz.plume.jersey.errors.WsError;
import com.google.common.collect.I... | package com.coreoz.plume.jersey.async;
/**
* Provides a bridge between JAX-RS asynchronous API and Java 8 asynchronous API
* @see CompletableFuture
* @see AsyncResponse
*/
public class AsyncJersey {
private static final Logger logger = LoggerFactory.getLogger(AsyncJersey.class);
/**
* Provides a {@link B... | // Path: plume-web-jersey/src/main/java/com/coreoz/plume/jersey/errors/ErrorResponse.java
// public class ErrorResponse {
//
// private final String errorCode;
// private final Iterable<String> statusArguments;
//
// public ErrorResponse(WsError error, Iterable<String> statusArguments) {
// this.errorCode = erro... | asyncResponse.resume(new ErrorResponse(WsError.INTERNAL_ERROR, ImmutableList.of())); |
Coreoz/Plume | plume-web-jersey/src/main/java/com/coreoz/plume/jersey/async/AsyncJersey.java | // Path: plume-web-jersey/src/main/java/com/coreoz/plume/jersey/errors/ErrorResponse.java
// public class ErrorResponse {
//
// private final String errorCode;
// private final Iterable<String> statusArguments;
//
// public ErrorResponse(WsError error, Iterable<String> statusArguments) {
// this.errorCode = erro... | import java.util.concurrent.CompletableFuture;
import java.util.function.BiConsumer;
import javax.ws.rs.container.AsyncResponse;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import com.coreoz.plume.jersey.errors.ErrorResponse;
import com.coreoz.plume.jersey.errors.WsError;
import com.google.common.collect.I... | package com.coreoz.plume.jersey.async;
/**
* Provides a bridge between JAX-RS asynchronous API and Java 8 asynchronous API
* @see CompletableFuture
* @see AsyncResponse
*/
public class AsyncJersey {
private static final Logger logger = LoggerFactory.getLogger(AsyncJersey.class);
/**
* Provides a {@link B... | // Path: plume-web-jersey/src/main/java/com/coreoz/plume/jersey/errors/ErrorResponse.java
// public class ErrorResponse {
//
// private final String errorCode;
// private final Iterable<String> statusArguments;
//
// public ErrorResponse(WsError error, Iterable<String> statusArguments) {
// this.errorCode = erro... | asyncResponse.resume(new ErrorResponse(WsError.INTERNAL_ERROR, ImmutableList.of())); |
Coreoz/Plume | plume-db-querydsl/src/test/java/com/coreoz/plume/db/querydsl/transaction/TransactionManagerQuerydslTest.java | // Path: plume-db-querydsl/src/test/java/com/coreoz/plume/db/querydsl/DbQuerydslTestModule.java
// public class DbQuerydslTestModule extends AbstractModule {
//
// @Override
// protected void configure() {
// install(new GuiceConfModule());
// install(new DataSourceModule());
// install(new GuiceDbTestModule()... | import static org.assertj.core.api.Assertions.assertThat;
import java.sql.SQLException;
import javax.inject.Inject;
import javax.sql.DataSource;
import org.junit.Test;
import org.junit.runner.RunWith;
import com.carlosbecker.guice.GuiceModules;
import com.carlosbecker.guice.GuiceTestRunner;
import com.coreoz.plume.db.q... | package com.coreoz.plume.db.querydsl.transaction;
@RunWith(GuiceTestRunner.class)
@GuiceModules(DbQuerydslTestModule.class)
public class TransactionManagerQuerydslTest {
@Inject
DataSource dataSource;
// exception release checks
@Test
public void check_that_connection_is_released_after_exception_during_se... | // Path: plume-db-querydsl/src/test/java/com/coreoz/plume/db/querydsl/DbQuerydslTestModule.java
// public class DbQuerydslTestModule extends AbstractModule {
//
// @Override
// protected void configure() {
// install(new GuiceConfModule());
// install(new DataSourceModule());
// install(new GuiceDbTestModule()... | .delete(QUser.user); |
Coreoz/Plume | plume-conf/src/main/java/com/coreoz/plume/conf/guice/GuiceConfModule.java | // Path: plume-conf/src/main/java/com/coreoz/plume/conf/ConfigProvider.java
// @Singleton
// public class ConfigProvider implements Provider<Config> {
//
// private Config config;
//
// @Inject
// public ConfigProvider() {
// this.config = ConfigFactory.load();
// }
//
// @Override
// public Config get() {
/... | import com.coreoz.plume.conf.ConfigProvider;
import com.google.inject.AbstractModule;
import com.typesafe.config.Config; | package com.coreoz.plume.conf.guice;
public class GuiceConfModule extends AbstractModule {
@Override
protected void configure() { | // Path: plume-conf/src/main/java/com/coreoz/plume/conf/ConfigProvider.java
// @Singleton
// public class ConfigProvider implements Provider<Config> {
//
// private Config config;
//
// @Inject
// public ConfigProvider() {
// this.config = ConfigFactory.load();
// }
//
// @Override
// public Config get() {
/... | bind(Config.class).toProvider(ConfigProvider.class); |
Coreoz/Plume | plume-db-test/src/main/java/com/coreoz/plume/db/guice/GuiceDbTestModule.java | // Path: plume-db-test/src/main/java/com/coreoz/plume/db/InitializeDatabase.java
// @Singleton
// public class InitializeDatabase {
//
// @Inject
// public InitializeDatabase(DataSource dataSource) {
// Flyway
// .configure()
// .dataSource(dataSource)
// .outOfOrder(true)
// .load()
// .migrate();
... | import com.coreoz.plume.db.InitializeDatabase;
import com.google.inject.AbstractModule; | package com.coreoz.plume.db.guice;
public class GuiceDbTestModule extends AbstractModule {
@Override
protected void configure() { | // Path: plume-db-test/src/main/java/com/coreoz/plume/db/InitializeDatabase.java
// @Singleton
// public class InitializeDatabase {
//
// @Inject
// public InitializeDatabase(DataSource dataSource) {
// Flyway
// .configure()
// .dataSource(dataSource)
// .outOfOrder(true)
// .load()
// .migrate();
... | bind(InitializeDatabase.class).asEagerSingleton(); |
Coreoz/Plume | plume-db-querydsl/src/test/java/com/coreoz/plume/db/querydsl/crud/CrudDaoQuerydslTest.java | // Path: plume-db-querydsl/src/test/java/com/coreoz/plume/db/querydsl/DbQuerydslTestModule.java
// public class DbQuerydslTestModule extends AbstractModule {
//
// @Override
// protected void configure() {
// install(new GuiceConfModule());
// install(new DataSourceModule());
// install(new GuiceDbTestModule()... | import static org.assertj.core.api.Assertions.assertThat;
import java.time.LocalDateTime;
import java.time.temporal.ChronoUnit;
import java.util.List;
import javax.inject.Inject;
import org.assertj.core.api.Assertions;
import org.junit.Test;
import org.junit.runner.RunWith;
import com.carlosbecker.guice.GuiceModules;
i... | package com.coreoz.plume.db.querydsl.crud;
@RunWith(GuiceTestRunner.class)
@GuiceModules(DbQuerydslTestModule.class)
public class CrudDaoQuerydslTest {
@Inject | // Path: plume-db-querydsl/src/test/java/com/coreoz/plume/db/querydsl/DbQuerydslTestModule.java
// public class DbQuerydslTestModule extends AbstractModule {
//
// @Override
// protected void configure() {
// install(new GuiceConfModule());
// install(new DataSourceModule());
// install(new GuiceDbTestModule()... | UserDao userDao; |
Coreoz/Plume | plume-db-querydsl/src/test/java/com/coreoz/plume/db/querydsl/crud/CrudDaoQuerydslTest.java | // Path: plume-db-querydsl/src/test/java/com/coreoz/plume/db/querydsl/DbQuerydslTestModule.java
// public class DbQuerydslTestModule extends AbstractModule {
//
// @Override
// protected void configure() {
// install(new GuiceConfModule());
// install(new DataSourceModule());
// install(new GuiceDbTestModule()... | import static org.assertj.core.api.Assertions.assertThat;
import java.time.LocalDateTime;
import java.time.temporal.ChronoUnit;
import java.util.List;
import javax.inject.Inject;
import org.assertj.core.api.Assertions;
import org.junit.Test;
import org.junit.runner.RunWith;
import com.carlosbecker.guice.GuiceModules;
i... | package com.coreoz.plume.db.querydsl.crud;
@RunWith(GuiceTestRunner.class)
@GuiceModules(DbQuerydslTestModule.class)
public class CrudDaoQuerydslTest {
@Inject
UserDao userDao;
@Test
public void should_list_users() { | // Path: plume-db-querydsl/src/test/java/com/coreoz/plume/db/querydsl/DbQuerydslTestModule.java
// public class DbQuerydslTestModule extends AbstractModule {
//
// @Override
// protected void configure() {
// install(new GuiceConfModule());
// install(new DataSourceModule());
// install(new GuiceDbTestModule()... | User user = new User(); |
Coreoz/Plume | plume-db-querydsl/src/main/java/com/coreoz/plume/db/querydsl/dagger/DaggerQuerydslModule.java | // Path: plume-db-querydsl/src/main/java/com/coreoz/plume/db/querydsl/transaction/TransactionManagerQuerydsl.java
// @Singleton
// public class TransactionManagerQuerydsl extends TransactionManager {
//
// private final Configuration querydslConfiguration;
//
// @Inject
// public TransactionManagerQuerydsl(Config ... | import javax.inject.Singleton;
import com.coreoz.plume.db.querydsl.transaction.TransactionManagerQuerydsl;
import com.coreoz.plume.db.transaction.TransactionManager;
import dagger.Module;
import dagger.Provides; | package com.coreoz.plume.db.querydsl.dagger;
@Module
public class DaggerQuerydslModule {
@Provides
@Singleton | // Path: plume-db-querydsl/src/main/java/com/coreoz/plume/db/querydsl/transaction/TransactionManagerQuerydsl.java
// @Singleton
// public class TransactionManagerQuerydsl extends TransactionManager {
//
// private final Configuration querydslConfiguration;
//
// @Inject
// public TransactionManagerQuerydsl(Config ... | static TransactionManager provideTransactionManager(TransactionManagerQuerydsl transactionManagerQuerydsl) { |
Coreoz/Plume | plume-db-querydsl/src/main/java/com/coreoz/plume/db/querydsl/dagger/DaggerQuerydslModule.java | // Path: plume-db-querydsl/src/main/java/com/coreoz/plume/db/querydsl/transaction/TransactionManagerQuerydsl.java
// @Singleton
// public class TransactionManagerQuerydsl extends TransactionManager {
//
// private final Configuration querydslConfiguration;
//
// @Inject
// public TransactionManagerQuerydsl(Config ... | import javax.inject.Singleton;
import com.coreoz.plume.db.querydsl.transaction.TransactionManagerQuerydsl;
import com.coreoz.plume.db.transaction.TransactionManager;
import dagger.Module;
import dagger.Provides; | package com.coreoz.plume.db.querydsl.dagger;
@Module
public class DaggerQuerydslModule {
@Provides
@Singleton | // Path: plume-db-querydsl/src/main/java/com/coreoz/plume/db/querydsl/transaction/TransactionManagerQuerydsl.java
// @Singleton
// public class TransactionManagerQuerydsl extends TransactionManager {
//
// private final Configuration querydslConfiguration;
//
// @Inject
// public TransactionManagerQuerydsl(Config ... | static TransactionManager provideTransactionManager(TransactionManagerQuerydsl transactionManagerQuerydsl) { |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.