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
AlexAUT/Kroniax
core/src/com/alexaut/kroniax/Application.java
// Path: core/src/com/alexaut/kroniax/game/ProgressManager.java // public class ProgressManager { // private Preferences mUnlockedLevels; // // public ProgressManager() { // mUnlockedLevels = Gdx.app.getPreferences("progress"); // if (!mUnlockedLevels.contains("unlocked_levels")) { // ...
import com.alexaut.kroniax.game.ProgressManager; import com.alexaut.kroniax.screens.MenuScene; import com.badlogic.gdx.Game; import com.badlogic.gdx.Gdx; import com.badlogic.gdx.Preferences; import com.badlogic.gdx.graphics.g2d.SpriteBatch; import com.badlogic.gdx.graphics.glutils.ShapeRenderer; import com.badlogic.gdx...
package com.alexaut.kroniax; public class Application extends Game { private SpriteBatch mSpriteBatch; private ShapeRenderer mShapeRenderer; private Skin mSkin; private ProgressManager mProgressManager; private Preferences mSettings;
// Path: core/src/com/alexaut/kroniax/game/ProgressManager.java // public class ProgressManager { // private Preferences mUnlockedLevels; // // public ProgressManager() { // mUnlockedLevels = Gdx.app.getPreferences("progress"); // if (!mUnlockedLevels.contains("unlocked_levels")) { // ...
private MenuScene mMenuScene;
AlexAUT/Kroniax
android/src/com/alexaut/kroniax/android/AndroidLauncher.java
// Path: core/src/com/alexaut/kroniax/Application.java // public class Application extends Game { // // private SpriteBatch mSpriteBatch; // private ShapeRenderer mShapeRenderer; // // private Skin mSkin; // // private ProgressManager mProgressManager; // private Preferences mSettings; // // ...
import android.os.Bundle; import com.badlogic.gdx.backends.android.AndroidApplication; import com.badlogic.gdx.backends.android.AndroidApplicationConfiguration; import com.alexaut.kroniax.Application;
package com.alexaut.kroniax.android; public class AndroidLauncher extends AndroidApplication { @Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); AndroidApplicationConfiguration config = new AndroidApplicationConfiguration();
// Path: core/src/com/alexaut/kroniax/Application.java // public class Application extends Game { // // private SpriteBatch mSpriteBatch; // private ShapeRenderer mShapeRenderer; // // private Skin mSkin; // // private ProgressManager mProgressManager; // private Preferences mSettings; // // ...
initialize(new Application(), config);
Vauff/Maunz-Discord
src/com/vauff/maunzdiscord/commands/templates/AbstractLegacyCommand.java
// Path: src/com/vauff/maunzdiscord/objects/Await.java // public class Await // { // private Snowflake id; // private AbstractCommand command; // private ChatInputInteractionEvent event; // // /** // * @param id An ID of a user who triggered the message or a message to be removed later on // * @param comm...
import com.vauff.maunzdiscord.objects.Await; import discord4j.common.util.Snowflake; import discord4j.core.event.domain.message.MessageCreateEvent; import discord4j.core.event.domain.message.ReactionAddEvent; import discord4j.core.object.entity.Message; import discord4j.core.object.entity.User; import discord4j.core.ob...
package com.vauff.maunzdiscord.commands.templates; public abstract class AbstractLegacyCommand<M extends MessageCreateEvent> extends AbstractCommand { /** * Executes this command * * @param event The event by which this command got triggered * @throws Exception If an exception gets thrown by any implementing...
// Path: src/com/vauff/maunzdiscord/objects/Await.java // public class Await // { // private Snowflake id; // private AbstractCommand command; // private ChatInputInteractionEvent event; // // /** // * @param id An ID of a user who triggered the message or a message to be removed later on // * @param comm...
AWAITED.put(messageID, new Await(userID, this));
Vauff/Maunz-Discord
src/com/vauff/maunzdiscord/commands/templates/AbstractCommand.java
// Path: src/com/vauff/maunzdiscord/objects/Await.java // public class Await // { // private Snowflake id; // private AbstractCommand command; // private ChatInputInteractionEvent event; // // /** // * @param id An ID of a user who triggered the message or a message to be removed later on // * @param comm...
import com.vauff.maunzdiscord.objects.Await; import com.vauff.maunzdiscord.objects.CommandHelp; import discord4j.common.util.Snowflake; import java.util.HashMap;
package com.vauff.maunzdiscord.commands.templates; public abstract class AbstractCommand { /** * Holds all messages as keys which await a reaction by a specific user. * The values hold an instance of {@link Await} */
// Path: src/com/vauff/maunzdiscord/objects/Await.java // public class Await // { // private Snowflake id; // private AbstractCommand command; // private ChatInputInteractionEvent event; // // /** // * @param id An ID of a user who triggered the message or a message to be removed later on // * @param comm...
public static final HashMap<Snowflake, Await> AWAITED = new HashMap<>();
Vauff/Maunz-Discord
src/com/vauff/maunzdiscord/commands/templates/AbstractCommand.java
// Path: src/com/vauff/maunzdiscord/objects/Await.java // public class Await // { // private Snowflake id; // private AbstractCommand command; // private ChatInputInteractionEvent event; // // /** // * @param id An ID of a user who triggered the message or a message to be removed later on // * @param comm...
import com.vauff.maunzdiscord.objects.Await; import com.vauff.maunzdiscord.objects.CommandHelp; import discord4j.common.util.Snowflake; import java.util.HashMap;
package com.vauff.maunzdiscord.commands.templates; public abstract class AbstractCommand { /** * Holds all messages as keys which await a reaction by a specific user. * The values hold an instance of {@link Await} */ public static final HashMap<Snowflake, Await> AWAITED = new HashMap<>(); /** * Enum hold...
// Path: src/com/vauff/maunzdiscord/objects/Await.java // public class Await // { // private Snowflake id; // private AbstractCommand command; // private ChatInputInteractionEvent event; // // /** // * @param id An ID of a user who triggered the message or a message to be removed later on // * @param comm...
public abstract CommandHelp[] getHelp();
Vauff/Maunz-Discord
src/com/vauff/maunzdiscord/commands/templates/AbstractSlashCommand.java
// Path: src/com/vauff/maunzdiscord/objects/Await.java // public class Await // { // private Snowflake id; // private AbstractCommand command; // private ChatInputInteractionEvent event; // // /** // * @param id An ID of a user who triggered the message or a message to be removed later on // * @param comm...
import com.vauff.maunzdiscord.objects.Await; import com.vauff.maunzdiscord.objects.CommandHelp; import discord4j.common.util.Snowflake; import discord4j.core.event.domain.interaction.ChatInputInteractionEvent; import discord4j.core.event.domain.message.ReactionAddEvent; import discord4j.core.object.command.ApplicationC...
package com.vauff.maunzdiscord.commands.templates; public abstract class AbstractSlashCommand<M extends ChatInputInteractionEvent> extends AbstractCommand { /** * Executes this command * * @param interaction The interaction that executing this command creates * @throws Exception If an exception gets thrown ...
// Path: src/com/vauff/maunzdiscord/objects/Await.java // public class Await // { // private Snowflake id; // private AbstractCommand command; // private ChatInputInteractionEvent event; // // /** // * @param id An ID of a user who triggered the message or a message to be removed later on // * @param comm...
AWAITED.put(messageID, new Await(userID, this, event));
Vauff/Maunz-Discord
src/com/vauff/maunzdiscord/commands/templates/AbstractSlashCommand.java
// Path: src/com/vauff/maunzdiscord/objects/Await.java // public class Await // { // private Snowflake id; // private AbstractCommand command; // private ChatInputInteractionEvent event; // // /** // * @param id An ID of a user who triggered the message or a message to be removed later on // * @param comm...
import com.vauff.maunzdiscord.objects.Await; import com.vauff.maunzdiscord.objects.CommandHelp; import discord4j.common.util.Snowflake; import discord4j.core.event.domain.interaction.ChatInputInteractionEvent; import discord4j.core.event.domain.message.ReactionAddEvent; import discord4j.core.object.command.ApplicationC...
package com.vauff.maunzdiscord.commands.templates; public abstract class AbstractSlashCommand<M extends ChatInputInteractionEvent> extends AbstractCommand { /** * Executes this command * * @param interaction The interaction that executing this command creates * @throws Exception If an exception gets thrown ...
// Path: src/com/vauff/maunzdiscord/objects/Await.java // public class Await // { // private Snowflake id; // private AbstractCommand command; // private ChatInputInteractionEvent event; // // /** // * @param id An ID of a user who triggered the message or a message to be removed later on // * @param comm...
public final CommandHelp[] getHelp()
kite-sdk/kite-examples
logging-webapp/src/test/java/org/kitesdk/examples/logging/webapp/ITLoggingWebapp.java
// Path: logging/src/main/java/org/kitesdk/examples/logging/CreateDataset.java // public class CreateDataset extends Configured implements Tool { // // @Override // public int run(String[] args) throws Exception { // // // Create a dataset of events with the Avro schema // DatasetDescriptor descriptor = n...
import java.io.ByteArrayOutputStream; import java.io.File; import java.io.FileFilter; import java.io.IOException; import java.io.PrintStream; import org.apache.catalina.core.AprLifecycleListener; import org.apache.catalina.core.StandardServer; import org.apache.catalina.startup.Tomcat; import org.apache.flume.clients.l...
/** * Copyright 2013 Cloudera Inc. * * 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 i...
// Path: logging/src/main/java/org/kitesdk/examples/logging/CreateDataset.java // public class CreateDataset extends Configured implements Tool { // // @Override // public int run(String[] args) throws Exception { // // // Create a dataset of events with the Avro schema // DatasetDescriptor descriptor = n...
run(any(Integer.class), any(String.class), new DeleteDataset());
kite-sdk/kite-examples
logging-webapp/src/test/java/org/kitesdk/examples/logging/webapp/ITLoggingWebapp.java
// Path: logging/src/main/java/org/kitesdk/examples/logging/CreateDataset.java // public class CreateDataset extends Configured implements Tool { // // @Override // public int run(String[] args) throws Exception { // // // Create a dataset of events with the Avro schema // DatasetDescriptor descriptor = n...
import java.io.ByteArrayOutputStream; import java.io.File; import java.io.FileFilter; import java.io.IOException; import java.io.PrintStream; import org.apache.catalina.core.AprLifecycleListener; import org.apache.catalina.core.StandardServer; import org.apache.catalina.startup.Tomcat; import org.apache.flume.clients.l...
} startTomcat(); } @AfterClass public static void stopCluster() { try { cluster.stop(); } catch (Exception e) { // ignore problems during shutdown } } private static void configureLog4j() throws Exception { // configuration is done programmatically and not in log4j.prope...
// Path: logging/src/main/java/org/kitesdk/examples/logging/CreateDataset.java // public class CreateDataset extends Configured implements Tool { // // @Override // public int run(String[] args) throws Exception { // // // Create a dataset of events with the Avro schema // DatasetDescriptor descriptor = n...
run(new CreateDataset());
kite-sdk/kite-examples
logging-webapp/src/test/java/org/kitesdk/examples/logging/webapp/ITLoggingWebapp.java
// Path: logging/src/main/java/org/kitesdk/examples/logging/CreateDataset.java // public class CreateDataset extends Configured implements Tool { // // @Override // public int run(String[] args) throws Exception { // // // Create a dataset of events with the Avro schema // DatasetDescriptor descriptor = n...
import java.io.ByteArrayOutputStream; import java.io.File; import java.io.FileFilter; import java.io.IOException; import java.io.PrintStream; import org.apache.catalina.core.AprLifecycleListener; import org.apache.catalina.core.StandardServer; import org.apache.catalina.startup.Tomcat; import org.apache.flume.clients.l...
@AfterClass public static void stopCluster() { try { cluster.stop(); } catch (Exception e) { // ignore problems during shutdown } } private static void configureLog4j() throws Exception { // configuration is done programmatically and not in log4j.properties so that so we // can ...
// Path: logging/src/main/java/org/kitesdk/examples/logging/CreateDataset.java // public class CreateDataset extends Configured implements Tool { // // @Override // public int run(String[] args) throws Exception { // // // Create a dataset of events with the Avro schema // DatasetDescriptor descriptor = n...
run(containsString("{\"id\": 10, \"message\": \"Hello-10\"}"), new ReadDataset());
RoboTricker/Transport-Pipes
src/main/java/de/robotricker/transportpipes/config/GeneralConf.java
// Path: src/main/java/de/robotricker/transportpipes/ResourcepackService.java // public class ResourcepackService implements Listener { // // private static String URL = "https://raw.githubusercontent.com/RoboTricker/Transport-Pipes/master/src/main/resources/wiki/resourcepack.zip"; // // private SentryService...
import de.robotricker.transportpipes.ResourcepackService; import org.bukkit.plugin.Plugin; import java.util.List; import javax.inject.Inject;
public boolean isDefaultShowItems() { return (boolean) read("default_show_items"); } public int getDefaultRenderDistance() { return (int) read("default_render_distance"); } @SuppressWarnings("unchecked") public List<String> getDisabledWorlds() { return (List<String>) r...
// Path: src/main/java/de/robotricker/transportpipes/ResourcepackService.java // public class ResourcepackService implements Listener { // // private static String URL = "https://raw.githubusercontent.com/RoboTricker/Transport-Pipes/master/src/main/resources/wiki/resourcepack.zip"; // // private SentryService...
public ResourcepackService.ResourcepackMode getResourcepackMode() {
RoboTricker/Transport-Pipes
src/main/java/de/robotricker/transportpipes/rendersystems/VanillaRenderSystem.java
// Path: src/main/java/de/robotricker/transportpipes/duct/DuctRegister.java // public class DuctRegister { // // private List<BaseDuctType<? extends Duct>> baseDuctTypes; // // private TransportPipes plugin; // private GeneralConf generalConf; // // @Inject // public DuctRegister(TransportPipes p...
import org.bukkit.inventory.ItemStack; import de.robotricker.transportpipes.duct.DuctRegister; import de.robotricker.transportpipes.duct.types.BaseDuctType;
package de.robotricker.transportpipes.rendersystems; public abstract class VanillaRenderSystem extends RenderSystem { public VanillaRenderSystem(BaseDuctType baseDuctType) { super(baseDuctType); }
// Path: src/main/java/de/robotricker/transportpipes/duct/DuctRegister.java // public class DuctRegister { // // private List<BaseDuctType<? extends Duct>> baseDuctTypes; // // private TransportPipes plugin; // private GeneralConf generalConf; // // @Inject // public DuctRegister(TransportPipes p...
public static ItemStack getItem(DuctRegister ductRegister) {
RoboTricker/Transport-Pipes
src/main/java/de/robotricker/transportpipes/PlayerSettingsService.java
// Path: src/main/java/de/robotricker/transportpipes/config/GeneralConf.java // public class GeneralConf extends Conf { // // @Inject // public GeneralConf(Plugin configPlugin) { // super(configPlugin, "config.yml", "config.yml", true); // } // // public int getMaxItemsPerPipe() { // r...
import org.bukkit.entity.Player; import java.util.HashMap; import java.util.Map; import javax.inject.Inject; import de.robotricker.transportpipes.config.GeneralConf; import de.robotricker.transportpipes.config.PlayerSettingsConf;
package de.robotricker.transportpipes; public class PlayerSettingsService { @Inject private TransportPipes transportPipes; @Inject
// Path: src/main/java/de/robotricker/transportpipes/config/GeneralConf.java // public class GeneralConf extends Conf { // // @Inject // public GeneralConf(Plugin configPlugin) { // super(configPlugin, "config.yml", "config.yml", true); // } // // public int getMaxItemsPerPipe() { // r...
private GeneralConf generalConf;
RoboTricker/Transport-Pipes
src/main/java/de/robotricker/transportpipes/PlayerSettingsService.java
// Path: src/main/java/de/robotricker/transportpipes/config/GeneralConf.java // public class GeneralConf extends Conf { // // @Inject // public GeneralConf(Plugin configPlugin) { // super(configPlugin, "config.yml", "config.yml", true); // } // // public int getMaxItemsPerPipe() { // r...
import org.bukkit.entity.Player; import java.util.HashMap; import java.util.Map; import javax.inject.Inject; import de.robotricker.transportpipes.config.GeneralConf; import de.robotricker.transportpipes.config.PlayerSettingsConf;
package de.robotricker.transportpipes; public class PlayerSettingsService { @Inject private TransportPipes transportPipes; @Inject private GeneralConf generalConf;
// Path: src/main/java/de/robotricker/transportpipes/config/GeneralConf.java // public class GeneralConf extends Conf { // // @Inject // public GeneralConf(Plugin configPlugin) { // super(configPlugin, "config.yml", "config.yml", true); // } // // public int getMaxItemsPerPipe() { // r...
private Map<Player, PlayerSettingsConf> cachedSettingsConfs;
mikaelhg/openblocks
src/main/java/edu/mit/blocks/renderable/RBHighlightHandler.java
// Path: src/main/java/edu/mit/blocks/workspace/RBParent.java // public interface RBParent { // // /** // * Add this Component the BlockLayer, which is understood to be above the // * HighlightLayer, although no guarantee is made about its order relative // * to any other layers this RBParent m...
import java.awt.AlphaComposite; import java.awt.BasicStroke; import java.awt.Color; import java.awt.Container; import java.awt.Graphics; import java.awt.Graphics2D; import java.awt.GraphicsEnvironment; import java.awt.Point; import java.awt.RenderingHints; import java.awt.event.ComponentEvent; import java.awt...
public void repaint() { if (rb.isVisible()) { if (blockArea == null || blockArea != rb.getBlockArea() || (rb.getBlock() != null && rb.getBlock().hasFocus() != hasFocus)) { updateImage(); blockArea = rb.getBlockArea(); } // only upda...
// Path: src/main/java/edu/mit/blocks/workspace/RBParent.java // public interface RBParent { // // /** // * Add this Component the BlockLayer, which is understood to be above the // * HighlightLayer, although no guarantee is made about its order relative // * to any other layers this RBParent m...
public void setParent(RBParent newParent) {
mikaelhg/openblocks
src/main/java/edu/mit/blocks/renderable/RBHighlightHandler.java
// Path: src/main/java/edu/mit/blocks/workspace/RBParent.java // public interface RBParent { // // /** // * Add this Component the BlockLayer, which is understood to be above the // * HighlightLayer, although no guarantee is made about its order relative // * to any other layers this RBParent m...
import java.awt.AlphaComposite; import java.awt.BasicStroke; import java.awt.Color; import java.awt.Container; import java.awt.Graphics; import java.awt.Graphics2D; import java.awt.GraphicsEnvironment; import java.awt.Point; import java.awt.RenderingHints; import java.awt.event.ComponentEvent; import java.awt...
removeFromParent(); newParent.addToHighlightLayer(this); updateImage(); ((Container) newParent).validate(); } public void removeFromParent() { if (this.getParent() != null) { this.getParent().remove(this); } } public void updateIm...
// Path: src/main/java/edu/mit/blocks/workspace/RBParent.java // public interface RBParent { // // /** // * Add this Component the BlockLayer, which is understood to be above the // * HighlightLayer, although no guarantee is made about its order relative // * to any other layers this RBParent m...
GraphicsManager.recycleGCCompatibleImage(hImage);
brettwooldridge/NuProcess
src/test/java/com/zaxxer/nuprocess/DirectWriteTest.java
// Path: src/test/java/com/zaxxer/nuprocess/CatTest.java // private static byte[] getLotsOfBytes() // { // return getLotsOfBytes(6000); // }
import java.nio.ByteBuffer; import java.util.concurrent.Semaphore; import java.util.concurrent.TimeUnit; import java.util.concurrent.atomic.AtomicInteger; import java.util.zip.Adler32; import org.junit.Assert; import org.junit.Before; import org.junit.Test; import static com.zaxxer.nuprocess.CatTest.getLotsOfBytes;
{ count.addAndGet(buffer.remaining()); buffer.position(buffer.limit()); } }; NuProcessBuilder pb = new NuProcessBuilder(processListener, command); NuProcess nuProcess = pb.start(); // TODO: given a large i (e.g. 1,000, 10,000), this unit test (testConse...
// Path: src/test/java/com/zaxxer/nuprocess/CatTest.java // private static byte[] getLotsOfBytes() // { // return getLotsOfBytes(6000); // } // Path: src/test/java/com/zaxxer/nuprocess/DirectWriteTest.java import java.nio.ByteBuffer; import java.util.concurrent.Semaphore; import java.util.concurrent.TimeUnit; impo...
final byte[] bytes = getLotsOfBytes(34632);
brettwooldridge/NuProcess
src/main/java/com/zaxxer/nuprocess/windows/ProcessCompletions.java
// Path: src/main/java/com/zaxxer/nuprocess/windows/NuWinNT.java // class HANDLE extends PointerType // { // static final Pointer INVALID = Pointer.createConstant(Native.POINTER_SIZE == 8 ? -1 : 0xFFFFFFFFL); // // public HANDLE() // { // } // // public HANDLE(Pointer p) // { // setPointer(p);...
import java.util.Collection; import java.util.HashMap; import java.util.Iterator; import java.util.LinkedList; import java.util.List; import java.util.Map; import java.util.concurrent.ArrayBlockingQueue; import java.util.concurrent.BlockingQueue; import java.util.concurrent.CyclicBarrier; import java.util.concurrent.Li...
/* * Copyright (C) 2013 Brett Wooldridge * * 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 agree...
// Path: src/main/java/com/zaxxer/nuprocess/windows/NuWinNT.java // class HANDLE extends PointerType // { // static final Pointer INVALID = Pointer.createConstant(Native.POINTER_SIZE == 8 ? -1 : 0xFFFFFFFFL); // // public HANDLE() // { // } // // public HANDLE(Pointer p) // { // setPointer(p);...
private HANDLE ioCompletionPort;
brettwooldridge/NuProcess
src/main/java/com/zaxxer/nuprocess/windows/ProcessCompletions.java
// Path: src/main/java/com/zaxxer/nuprocess/windows/NuWinNT.java // class HANDLE extends PointerType // { // static final Pointer INVALID = Pointer.createConstant(Native.POINTER_SIZE == 8 ? -1 : 0xFFFFFFFFL); // // public HANDLE() // { // } // // public HANDLE(Pointer p) // { // setPointer(p);...
import java.util.Collection; import java.util.HashMap; import java.util.Iterator; import java.util.LinkedList; import java.util.List; import java.util.Map; import java.util.concurrent.ArrayBlockingQueue; import java.util.concurrent.BlockingQueue; import java.util.concurrent.CyclicBarrier; import java.util.concurrent.Li...
/* * Copyright (C) 2013 Brett Wooldridge * * 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 agree...
// Path: src/main/java/com/zaxxer/nuprocess/windows/NuWinNT.java // class HANDLE extends PointerType // { // static final Pointer INVALID = Pointer.createConstant(Native.POINTER_SIZE == 8 ? -1 : 0xFFFFFFFFL); // // public HANDLE() // { // } // // public HANDLE(Pointer p) // { // setPointer(p);...
private ULONG_PTRByReference completionKey;
brettwooldridge/NuProcess
src/main/java/com/zaxxer/nuprocess/windows/ProcessCompletions.java
// Path: src/main/java/com/zaxxer/nuprocess/windows/NuWinNT.java // class HANDLE extends PointerType // { // static final Pointer INVALID = Pointer.createConstant(Native.POINTER_SIZE == 8 ? -1 : 0xFFFFFFFFL); // // public HANDLE() // { // } // // public HANDLE(Pointer p) // { // setPointer(p);...
import java.util.Collection; import java.util.HashMap; import java.util.Iterator; import java.util.LinkedList; import java.util.List; import java.util.Map; import java.util.concurrent.ArrayBlockingQueue; import java.util.concurrent.BlockingQueue; import java.util.concurrent.CyclicBarrier; import java.util.concurrent.Li...
finally { checkDeadPool(); } } void shutdown() { shutdown = true; Collection<WindowsProcess> processes = completionKeyToProcessMap.values(); for (WindowsProcess process : processes) { NuKernel32.TerminateProcess(process.getPidHandle(), Integer.MAX_VALUE - 1); ...
// Path: src/main/java/com/zaxxer/nuprocess/windows/NuWinNT.java // class HANDLE extends PointerType // { // static final Pointer INVALID = Pointer.createConstant(Native.POINTER_SIZE == 8 ? -1 : 0xFFFFFFFFL); // // public HANDLE() // { // } // // public HANDLE(Pointer p) // { // setPointer(p);...
NuKernel32.PostQueuedCompletionStatus(ioCompletionPort, 0, new ULONG_PTR(0), null);
brettwooldridge/NuProcess
src/main/java/com/zaxxer/nuprocess/windows/ProcessCompletions.java
// Path: src/main/java/com/zaxxer/nuprocess/windows/NuWinNT.java // class HANDLE extends PointerType // { // static final Pointer INVALID = Pointer.createConstant(Native.POINTER_SIZE == 8 ? -1 : 0xFFFFFFFFL); // // public HANDLE() // { // } // // public HANDLE(Pointer p) // { // setPointer(p);...
import java.util.Collection; import java.util.HashMap; import java.util.Iterator; import java.util.LinkedList; import java.util.List; import java.util.Map; import java.util.concurrent.ArrayBlockingQueue; import java.util.concurrent.BlockingQueue; import java.util.concurrent.CyclicBarrier; import java.util.concurrent.Li...
try { wantsWrite.put(process); NuKernel32.PostQueuedCompletionStatus(ioCompletionPort, 0, new ULONG_PTR(0), null); } catch (InterruptedException e) { // ignore } } void registerProcess(final WindowsProcess process) { if (shutdown) { return; ...
// Path: src/main/java/com/zaxxer/nuprocess/windows/NuWinNT.java // class HANDLE extends PointerType // { // static final Pointer INVALID = Pointer.createConstant(Native.POINTER_SIZE == 8 ? -1 : 0xFFFFFFFFL); // // public HANDLE() // { // } // // public HANDLE(Pointer p) // { // setPointer(p);...
final PipeBundle stdinPipe = process.getStdinPipe();
raphaeljolivet/java2typescript
java2typescript-jackson/src/main/java/java2typescript/jackson/module/grammar/ClassType.java
// Path: java2typescript-jackson/src/main/java/java2typescript/jackson/module/grammar/base/AbstractNamedType.java // abstract public class AbstractNamedType extends AbstractType { // // protected final String name; // // public AbstractNamedType(String className) { // this.name = className; // } // // @Overrid...
import java2typescript.jackson.module.writer.SortUtil; import java2typescript.jackson.module.writer.WriterPreferences; import static java.lang.String.format; import java.io.IOException; import java.io.Writer; import java.util.ArrayList; import java.util.Collection; import java.util.Collections; import java.util.LinkedH...
/******************************************************************************* * Copyright 2013 Raphael Jolivet * * 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.apa...
// Path: java2typescript-jackson/src/main/java/java2typescript/jackson/module/grammar/base/AbstractNamedType.java // abstract public class AbstractNamedType extends AbstractType { // // protected final String name; // // public AbstractNamedType(String className) { // this.name = className; // } // // @Overrid...
public void writeDefInternal(Writer writer, WriterPreferences preferences) throws IOException {
raphaeljolivet/java2typescript
sample-web-app/src/main/java/com/example/rs/PeopleRestService.java
// Path: sample-web-app/src/main/java/com/example/model/Person.java // public class Person { // private String email; // private String firstName; // private String lastName; // // public Person() { // } // // public Person( final String email ) { // this.email = email; // } // // public Person( final ...
import java.util.Collection; import javax.inject.Inject; import javax.ws.rs.DELETE; import javax.ws.rs.DefaultValue; import javax.ws.rs.FormParam; import javax.ws.rs.GET; import javax.ws.rs.POST; import javax.ws.rs.PUT; import javax.ws.rs.Path; import javax.ws.rs.PathParam; import javax.ws.rs.Produces; import javax.ws....
package com.example.rs; @Path("/people") public class PeopleRestService { @Inject
// Path: sample-web-app/src/main/java/com/example/model/Person.java // public class Person { // private String email; // private String firstName; // private String lastName; // // public Person() { // } // // public Person( final String email ) { // this.email = email; // } // // public Person( final ...
private PeopleService peopleService;
raphaeljolivet/java2typescript
sample-web-app/src/main/java/com/example/rs/PeopleRestService.java
// Path: sample-web-app/src/main/java/com/example/model/Person.java // public class Person { // private String email; // private String firstName; // private String lastName; // // public Person() { // } // // public Person( final String email ) { // this.email = email; // } // // public Person( final ...
import java.util.Collection; import javax.inject.Inject; import javax.ws.rs.DELETE; import javax.ws.rs.DefaultValue; import javax.ws.rs.FormParam; import javax.ws.rs.GET; import javax.ws.rs.POST; import javax.ws.rs.PUT; import javax.ws.rs.Path; import javax.ws.rs.PathParam; import javax.ws.rs.Produces; import javax.ws....
package com.example.rs; @Path("/people") public class PeopleRestService { @Inject private PeopleService peopleService; @Produces({ MediaType.APPLICATION_JSON }) @GET
// Path: sample-web-app/src/main/java/com/example/model/Person.java // public class Person { // private String email; // private String firstName; // private String lastName; // // public Person() { // } // // public Person( final String email ) { // this.email = email; // } // // public Person( final ...
public Collection<Person> getPeopleList(@QueryParam("page") @DefaultValue("1") final int page) {
raphaeljolivet/java2typescript
java2typescript-jaxrs/src/test/java/java2typescript/jaxrs/DescriptorGeneratorTest.java
// Path: java2typescript-jackson/src/main/java/java2typescript/jackson/module/grammar/Module.java // public class Module { // // private String name; // // private Map<String, AbstractNamedType> namedTypes = new HashMap<String, AbstractNamedType>(); // // private Map<String, AbstractType> vars = new HashMap<Strin...
import com.example.rs.PeopleRestService; import com.fasterxml.jackson.core.JsonGenerationException; import com.fasterxml.jackson.databind.JsonMappingException; import com.fasterxml.jackson.databind.ObjectMapper; import com.fasterxml.jackson.databind.module.SimpleModule; import java.io.IOException; import java.io.Output...
/******************************************************************************* * Copyright 2013 Raphael Jolivet * * 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.apa...
// Path: java2typescript-jackson/src/main/java/java2typescript/jackson/module/grammar/Module.java // public class Module { // // private String name; // // private Map<String, AbstractNamedType> namedTypes = new HashMap<String, AbstractNamedType>(); // // private Map<String, AbstractType> vars = new HashMap<Strin...
Collections.singletonList(PeopleRestService.class));
raphaeljolivet/java2typescript
java2typescript-jaxrs/src/test/java/java2typescript/jaxrs/DescriptorGeneratorTest.java
// Path: java2typescript-jackson/src/main/java/java2typescript/jackson/module/grammar/Module.java // public class Module { // // private String name; // // private Map<String, AbstractNamedType> namedTypes = new HashMap<String, AbstractNamedType>(); // // private Map<String, AbstractType> vars = new HashMap<Strin...
import com.example.rs.PeopleRestService; import com.fasterxml.jackson.core.JsonGenerationException; import com.fasterxml.jackson.databind.JsonMappingException; import com.fasterxml.jackson.databind.ObjectMapper; import com.fasterxml.jackson.databind.module.SimpleModule; import java.io.IOException; import java.io.Output...
@QueryParam("q1") String queryParam, // @PathParam("id") String id, // @FormParam("formParam") Integer formParam, // MyObject postPayload); } @Before public void setUp() { out = new OutputStreamWriter(System.out); } @Test public void testJSGenerate() throws JsonGenerationException, JsonMappin...
// Path: java2typescript-jackson/src/main/java/java2typescript/jackson/module/grammar/Module.java // public class Module { // // private String name; // // private Map<String, AbstractNamedType> namedTypes = new HashMap<String, AbstractNamedType>(); // // private Map<String, AbstractType> vars = new HashMap<Strin...
Module tsModule = descGen.generateTypeScript("modName");
raphaeljolivet/java2typescript
java2typescript-jackson/src/main/java/java2typescript/jackson/module/writer/EnumTypeToStringLiteralTypeWriter.java
// Path: java2typescript-jackson/src/main/java/java2typescript/jackson/module/grammar/base/AbstractNamedType.java // abstract public class AbstractNamedType extends AbstractType { // // protected final String name; // // public AbstractNamedType(String className) { // this.name = className; // } // // @Overrid...
import static java.lang.String.format; import java.io.IOException; import java.io.Writer; import java.util.Iterator; import java.util.List; import java2typescript.jackson.module.grammar.EnumType; import java2typescript.jackson.module.grammar.base.AbstractNamedType;
package java2typescript.jackson.module.writer; /** * Another alternate way of converting Java enums. This writer will convert enums to what is known as a String Literal * Type in TypeScript (>=1.8). The advantage here is that the generated typescript definitions can be used with JSON * that has the string value ...
// Path: java2typescript-jackson/src/main/java/java2typescript/jackson/module/grammar/base/AbstractNamedType.java // abstract public class AbstractNamedType extends AbstractType { // // protected final String name; // // public AbstractNamedType(String className) { // this.name = className; // } // // @Overrid...
public boolean accepts(AbstractNamedType type, WriterPreferences preferences) {
raphaeljolivet/java2typescript
java2typescript-jackson/src/main/java/java2typescript/jackson/module/grammar/Module.java
// Path: java2typescript-jackson/src/main/java/java2typescript/jackson/module/grammar/base/AbstractNamedType.java // abstract public class AbstractNamedType extends AbstractType { // // protected final String name; // // public AbstractNamedType(String className) { // this.name = className; // } // // @Overrid...
import java.io.IOException; import java.io.Writer; import java.util.HashMap; import java.util.Map; import java2typescript.jackson.module.grammar.base.AbstractNamedType; import java2typescript.jackson.module.grammar.base.AbstractType; import java2typescript.jackson.module.writer.InternalModuleFormatWriter;
/******************************************************************************* * Copyright 2013 Raphael Jolivet * * 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.apa...
// Path: java2typescript-jackson/src/main/java/java2typescript/jackson/module/grammar/base/AbstractNamedType.java // abstract public class AbstractNamedType extends AbstractType { // // protected final String name; // // public AbstractNamedType(String className) { // this.name = className; // } // // @Overrid...
private Map<String, AbstractNamedType> namedTypes = new HashMap<String, AbstractNamedType>();
raphaeljolivet/java2typescript
java2typescript-jackson/src/main/java/java2typescript/jackson/module/writer/EnumTypeToEnumPatternWriter.java
// Path: java2typescript-jackson/src/main/java/java2typescript/jackson/module/grammar/base/AbstractNamedType.java // abstract public class AbstractNamedType extends AbstractType { // // protected final String name; // // public AbstractNamedType(String className) { // this.name = className; // } // // @Overrid...
import java.io.IOException; import java.io.Writer; import java.util.List; import java2typescript.jackson.module.grammar.EnumType; import java2typescript.jackson.module.grammar.base.AbstractNamedType;
package java2typescript.jackson.module.writer; /** * Alternative to writing Java enum type to TypeScript enum type. Usefult, if You have following goals:<br> * 1) JavaScript object containing field of "enum" must contain enum name instead of ordinal value. This is good for several reasons: a) easy to understand JS...
// Path: java2typescript-jackson/src/main/java/java2typescript/jackson/module/grammar/base/AbstractNamedType.java // abstract public class AbstractNamedType extends AbstractType { // // protected final String name; // // public AbstractNamedType(String className) { // this.name = className; // } // // @Overrid...
public boolean accepts(AbstractNamedType type, WriterPreferences preferences) {
raphaeljolivet/java2typescript
sample-web-app/src/main/java/com/example/services/PeopleService.java
// Path: sample-web-app/src/main/java/com/example/exceptions/PersonAlreadyExistsException.java // public class PersonAlreadyExistsException extends WebApplicationException { // private static final long serialVersionUID = 6817489620338221395L; // // public PersonAlreadyExistsException( final String email ) { // su...
import java.util.ArrayList; import java.util.Collection; import java.util.Iterator; import java.util.concurrent.ConcurrentHashMap; import java.util.concurrent.ConcurrentMap; import org.springframework.stereotype.Service; import com.example.exceptions.PersonAlreadyExistsException; import com.example.exceptions.PersonNot...
package com.example.services; @Service public class PeopleService {
// Path: sample-web-app/src/main/java/com/example/exceptions/PersonAlreadyExistsException.java // public class PersonAlreadyExistsException extends WebApplicationException { // private static final long serialVersionUID = 6817489620338221395L; // // public PersonAlreadyExistsException( final String email ) { // su...
private final ConcurrentMap< String, Person > persons = new ConcurrentHashMap< String, Person >();
raphaeljolivet/java2typescript
sample-web-app/src/main/java/com/example/services/PeopleService.java
// Path: sample-web-app/src/main/java/com/example/exceptions/PersonAlreadyExistsException.java // public class PersonAlreadyExistsException extends WebApplicationException { // private static final long serialVersionUID = 6817489620338221395L; // // public PersonAlreadyExistsException( final String email ) { // su...
import java.util.ArrayList; import java.util.Collection; import java.util.Iterator; import java.util.concurrent.ConcurrentHashMap; import java.util.concurrent.ConcurrentMap; import org.springframework.stereotype.Service; import com.example.exceptions.PersonAlreadyExistsException; import com.example.exceptions.PersonNot...
package com.example.services; @Service public class PeopleService { private final ConcurrentMap< String, Person > persons = new ConcurrentHashMap< String, Person >(); public Collection< Person > getPeople( int page, int pageSize ) { final Collection< Person > slice = new ArrayList< Person >( pageSize ); ...
// Path: sample-web-app/src/main/java/com/example/exceptions/PersonAlreadyExistsException.java // public class PersonAlreadyExistsException extends WebApplicationException { // private static final long serialVersionUID = 6817489620338221395L; // // public PersonAlreadyExistsException( final String email ) { // su...
throw new PersonNotFoundException( email );
raphaeljolivet/java2typescript
sample-web-app/src/main/java/com/example/services/PeopleService.java
// Path: sample-web-app/src/main/java/com/example/exceptions/PersonAlreadyExistsException.java // public class PersonAlreadyExistsException extends WebApplicationException { // private static final long serialVersionUID = 6817489620338221395L; // // public PersonAlreadyExistsException( final String email ) { // su...
import java.util.ArrayList; import java.util.Collection; import java.util.Iterator; import java.util.concurrent.ConcurrentHashMap; import java.util.concurrent.ConcurrentMap; import org.springframework.stereotype.Service; import com.example.exceptions.PersonAlreadyExistsException; import com.example.exceptions.PersonNot...
package com.example.services; @Service public class PeopleService { private final ConcurrentMap< String, Person > persons = new ConcurrentHashMap< String, Person >(); public Collection< Person > getPeople( int page, int pageSize ) { final Collection< Person > slice = new ArrayList< Person >( pageSize ); ...
// Path: sample-web-app/src/main/java/com/example/exceptions/PersonAlreadyExistsException.java // public class PersonAlreadyExistsException extends WebApplicationException { // private static final long serialVersionUID = 6817489620338221395L; // // public PersonAlreadyExistsException( final String email ) { // su...
throw new PersonAlreadyExistsException( email );
raphaeljolivet/java2typescript
java2typescript-jackson/src/main/java/java2typescript/jackson/module/writer/WriterPreferences.java
// Path: java2typescript-jackson/src/main/java/java2typescript/jackson/module/grammar/base/AbstractNamedType.java // abstract public class AbstractNamedType extends AbstractType { // // protected final String name; // // public AbstractNamedType(String className) { // this.name = className; // } // // @Overrid...
import java.io.IOException; import java.io.Writer; import java.util.ArrayList; import java.util.List; import java2typescript.jackson.module.grammar.base.AbstractNamedType;
package java2typescript.jackson.module.writer; public class WriterPreferences { private String indentationStep = " "; private int indentationLevel = 0; private List<CustomAbstractTypeWriter> customWriters = new ArrayList<CustomAbstractTypeWriter>(); private boolean useEnumPattern; private boolean enumAsStri...
// Path: java2typescript-jackson/src/main/java/java2typescript/jackson/module/grammar/base/AbstractNamedType.java // abstract public class AbstractNamedType extends AbstractType { // // protected final String name; // // public AbstractNamedType(String className) { // this.name = className; // } // // @Overrid...
public boolean hasCustomWriter(AbstractNamedType type) {
raphaeljolivet/java2typescript
java2typescript-jackson/src/main/java/java2typescript/jackson/module/visitors/TSJsonFormatVisitorWrapper.java
// Path: java2typescript-jackson/src/main/java/java2typescript/jackson/module/grammar/Module.java // public class Module { // // private String name; // // private Map<String, AbstractNamedType> namedTypes = new HashMap<String, AbstractNamedType>(); // // private Map<String, AbstractType> vars = new HashMap<Strin...
import java2typescript.jackson.module.grammar.EnumType; import java2typescript.jackson.module.grammar.Module; import java2typescript.jackson.module.grammar.base.AbstractNamedType; import java2typescript.jackson.module.grammar.base.AbstractType; import com.fasterxml.jackson.annotation.JsonTypeName; import com.fasterxml....
/******************************************************************************* * Copyright 2013 Raphael Jolivet * * 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.apa...
// Path: java2typescript-jackson/src/main/java/java2typescript/jackson/module/grammar/Module.java // public class Module { // // private String name; // // private Map<String, AbstractNamedType> namedTypes = new HashMap<String, AbstractNamedType>(); // // private Map<String, AbstractType> vars = new HashMap<Strin...
public TSJsonFormatVisitorWrapper(Module module, Configuration conf) {
raphaeljolivet/java2typescript
java2typescript-jackson/src/main/java/java2typescript/jackson/module/visitors/TSJsonFormatVisitorWrapper.java
// Path: java2typescript-jackson/src/main/java/java2typescript/jackson/module/grammar/Module.java // public class Module { // // private String name; // // private Map<String, AbstractNamedType> namedTypes = new HashMap<String, AbstractNamedType>(); // // private Map<String, AbstractType> vars = new HashMap<Strin...
import java2typescript.jackson.module.grammar.EnumType; import java2typescript.jackson.module.grammar.Module; import java2typescript.jackson.module.grammar.base.AbstractNamedType; import java2typescript.jackson.module.grammar.base.AbstractType; import com.fasterxml.jackson.annotation.JsonTypeName; import com.fasterxml....
/******************************************************************************* * Copyright 2013 Raphael Jolivet * * 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.apa...
// Path: java2typescript-jackson/src/main/java/java2typescript/jackson/module/grammar/Module.java // public class Module { // // private String name; // // private Map<String, AbstractNamedType> namedTypes = new HashMap<String, AbstractNamedType>(); // // private Map<String, AbstractType> vars = new HashMap<Strin...
AbstractNamedType namedType = getModule().getNamedTypes().get(name);
raphaeljolivet/java2typescript
java2typescript-jackson/src/test/java/java2typescript/jackson/module/StaticFieldExporterTest.java
// Path: java2typescript-jackson/src/main/java/java2typescript/jackson/module/grammar/Module.java // public class Module { // // private String name; // // private Map<String, AbstractNamedType> namedTypes = new HashMap<String, AbstractNamedType>(); // // private Map<String, AbstractType> vars = new HashMap<Strin...
import static org.junit.Assert.assertFalse; import static org.junit.Assert.assertTrue; import java.io.IOException; import java.io.StringWriter; import java.io.Writer; import java.util.ArrayList; import java2typescript.jackson.module.grammar.Module; import org.junit.Test; import com.fasterxml.jackson.annotation.JsonType...
/******************************************************************************* * Copyright 2014 Florian Benz * * 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...
// Path: java2typescript-jackson/src/main/java/java2typescript/jackson/module/grammar/Module.java // public class Module { // // private String name; // // private Map<String, AbstractNamedType> namedTypes = new HashMap<String, AbstractNamedType>(); // // private Map<String, AbstractType> vars = new HashMap<Strin...
Module module = new Module("mod");
raphaeljolivet/java2typescript
java2typescript-jackson/src/main/java/java2typescript/jackson/module/writer/ExternalModuleFormatWriter.java
// Path: java2typescript-jackson/src/main/java/java2typescript/jackson/module/grammar/Module.java // public class Module { // // private String name; // // private Map<String, AbstractNamedType> namedTypes = new HashMap<String, AbstractNamedType>(); // // private Map<String, AbstractType> vars = new HashMap<Strin...
import java.io.IOException; import java.io.Writer; import java.util.Collection; import java.util.Map.Entry; import java2typescript.jackson.module.grammar.EnumType; import java2typescript.jackson.module.grammar.Module; import java2typescript.jackson.module.grammar.base.AbstractNamedType; import java2typescript.jackson.m...
package java2typescript.jackson.module.writer; /** * Generates TypeScript type definitions for given module in external module format */ public class ExternalModuleFormatWriter implements ModuleWriter { public WriterPreferences preferences = new WriterPreferences(); @Override
// Path: java2typescript-jackson/src/main/java/java2typescript/jackson/module/grammar/Module.java // public class Module { // // private String name; // // private Map<String, AbstractNamedType> namedTypes = new HashMap<String, AbstractNamedType>(); // // private Map<String, AbstractType> vars = new HashMap<Strin...
public void write(Module module, Writer writer) throws IOException {
raphaeljolivet/java2typescript
java2typescript-jackson/src/main/java/java2typescript/jackson/module/writer/ExternalModuleFormatWriter.java
// Path: java2typescript-jackson/src/main/java/java2typescript/jackson/module/grammar/Module.java // public class Module { // // private String name; // // private Map<String, AbstractNamedType> namedTypes = new HashMap<String, AbstractNamedType>(); // // private Map<String, AbstractType> vars = new HashMap<Strin...
import java.io.IOException; import java.io.Writer; import java.util.Collection; import java.util.Map.Entry; import java2typescript.jackson.module.grammar.EnumType; import java2typescript.jackson.module.grammar.Module; import java2typescript.jackson.module.grammar.base.AbstractNamedType; import java2typescript.jackson.m...
package java2typescript.jackson.module.writer; /** * Generates TypeScript type definitions for given module in external module format */ public class ExternalModuleFormatWriter implements ModuleWriter { public WriterPreferences preferences = new WriterPreferences(); @Override public void write(Module module, ...
// Path: java2typescript-jackson/src/main/java/java2typescript/jackson/module/grammar/Module.java // public class Module { // // private String name; // // private Map<String, AbstractNamedType> namedTypes = new HashMap<String, AbstractNamedType>(); // // private Map<String, AbstractType> vars = new HashMap<Strin...
Collection<AbstractNamedType> namedTypes = module.getNamedTypes().values();
raphaeljolivet/java2typescript
sample-web-app/src/main/java/com/example/Starter.java
// Path: sample-web-app/src/main/java/com/example/config/AppConfig.java // @Configuration // public class AppConfig { // @Bean( destroyMethod = "shutdown" ) // public SpringBus cxf() { // return new SpringBus(); // } // // @Bean @DependsOn( "cxf" ) // public Server jaxRsServer() { // JAXRSServerFactoryBean ...
import java.io.IOException; import java.net.URISyntaxException; import org.apache.cxf.transport.servlet.CXFServlet; import org.eclipse.jetty.server.Server; import org.eclipse.jetty.server.handler.HandlerCollection; import org.eclipse.jetty.server.handler.ResourceHandler; import org.eclipse.jetty.servlet.ServletContextH...
package com.example; public class Starter { public static void main(final String[] args) throws Exception { Server server = new Server(8080); HandlerCollection handlerCollection = new HandlerCollection(); server.setHandler(handlerCollection); addSpringContext(handlerCollection); // Default ...
// Path: sample-web-app/src/main/java/com/example/config/AppConfig.java // @Configuration // public class AppConfig { // @Bean( destroyMethod = "shutdown" ) // public SpringBus cxf() { // return new SpringBus(); // } // // @Bean @DependsOn( "cxf" ) // public Server jaxRsServer() { // JAXRSServerFactoryBean ...
context.setInitParameter("contextConfigLocation", AppConfig.class.getName());
raphaeljolivet/java2typescript
sample-web-app/src/main/java/com/example/config/AppConfig.java
// Path: sample-web-app/src/main/java/com/example/rs/JaxRsApiApplication.java // @ApplicationPath( "api" ) // public class JaxRsApiApplication extends Application { // } // // Path: sample-web-app/src/main/java/com/example/rs/PeopleRestService.java // @Path("/people") // public class PeopleRestService { // @Inject //...
import java.util.Arrays; import javax.ws.rs.ext.RuntimeDelegate; import org.apache.cxf.bus.spring.SpringBus; import org.apache.cxf.endpoint.Server; import org.apache.cxf.jaxrs.JAXRSServerFactoryBean; import org.codehaus.jackson.jaxrs.JacksonJsonProvider; import org.springframework.context.annotation.Bean; import org.sp...
package com.example.config; @Configuration public class AppConfig { @Bean( destroyMethod = "shutdown" ) public SpringBus cxf() { return new SpringBus(); } @Bean @DependsOn( "cxf" ) public Server jaxRsServer() { JAXRSServerFactoryBean factory = RuntimeDelegate.getInstance().createEndpoint( jaxRsApiAppli...
// Path: sample-web-app/src/main/java/com/example/rs/JaxRsApiApplication.java // @ApplicationPath( "api" ) // public class JaxRsApiApplication extends Application { // } // // Path: sample-web-app/src/main/java/com/example/rs/PeopleRestService.java // @Path("/people") // public class PeopleRestService { // @Inject //...
public JaxRsApiApplication jaxRsApiApplication() {
raphaeljolivet/java2typescript
sample-web-app/src/main/java/com/example/config/AppConfig.java
// Path: sample-web-app/src/main/java/com/example/rs/JaxRsApiApplication.java // @ApplicationPath( "api" ) // public class JaxRsApiApplication extends Application { // } // // Path: sample-web-app/src/main/java/com/example/rs/PeopleRestService.java // @Path("/people") // public class PeopleRestService { // @Inject //...
import java.util.Arrays; import javax.ws.rs.ext.RuntimeDelegate; import org.apache.cxf.bus.spring.SpringBus; import org.apache.cxf.endpoint.Server; import org.apache.cxf.jaxrs.JAXRSServerFactoryBean; import org.codehaus.jackson.jaxrs.JacksonJsonProvider; import org.springframework.context.annotation.Bean; import org.sp...
package com.example.config; @Configuration public class AppConfig { @Bean( destroyMethod = "shutdown" ) public SpringBus cxf() { return new SpringBus(); } @Bean @DependsOn( "cxf" ) public Server jaxRsServer() { JAXRSServerFactoryBean factory = RuntimeDelegate.getInstance().createEndpoint( jaxRsApiAppli...
// Path: sample-web-app/src/main/java/com/example/rs/JaxRsApiApplication.java // @ApplicationPath( "api" ) // public class JaxRsApiApplication extends Application { // } // // Path: sample-web-app/src/main/java/com/example/rs/PeopleRestService.java // @Path("/people") // public class PeopleRestService { // @Inject //...
public PeopleRestService peopleRestService() {
raphaeljolivet/java2typescript
sample-web-app/src/main/java/com/example/config/AppConfig.java
// Path: sample-web-app/src/main/java/com/example/rs/JaxRsApiApplication.java // @ApplicationPath( "api" ) // public class JaxRsApiApplication extends Application { // } // // Path: sample-web-app/src/main/java/com/example/rs/PeopleRestService.java // @Path("/people") // public class PeopleRestService { // @Inject //...
import java.util.Arrays; import javax.ws.rs.ext.RuntimeDelegate; import org.apache.cxf.bus.spring.SpringBus; import org.apache.cxf.endpoint.Server; import org.apache.cxf.jaxrs.JAXRSServerFactoryBean; import org.codehaus.jackson.jaxrs.JacksonJsonProvider; import org.springframework.context.annotation.Bean; import org.sp...
package com.example.config; @Configuration public class AppConfig { @Bean( destroyMethod = "shutdown" ) public SpringBus cxf() { return new SpringBus(); } @Bean @DependsOn( "cxf" ) public Server jaxRsServer() { JAXRSServerFactoryBean factory = RuntimeDelegate.getInstance().createEndpoint( jaxRsApiAppli...
// Path: sample-web-app/src/main/java/com/example/rs/JaxRsApiApplication.java // @ApplicationPath( "api" ) // public class JaxRsApiApplication extends Application { // } // // Path: sample-web-app/src/main/java/com/example/rs/PeopleRestService.java // @Path("/people") // public class PeopleRestService { // @Inject //...
public PeopleService peopleService() {
sw360/sw360rest
subprojects/resource-server/src/main/java/org/eclipse/sw360/rest/resourceserver/vendor/VendorController.java
// Path: subprojects/resource-server/src/main/java/org/eclipse/sw360/rest/resourceserver/core/HalResource.java // @JsonInclude(JsonInclude.Include.NON_NULL) // public class HalResource<T> extends Resource<T> { // // private Map<String, Object> embeddedMap; // // public HalResource(T content, Link... links) { ...
import lombok.NonNull; import lombok.RequiredArgsConstructor; import lombok.extern.slf4j.Slf4j; import org.eclipse.sw360.datahandler.thrift.vendors.Vendor; import org.eclipse.sw360.rest.resourceserver.core.HalResource; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.data.rest.w...
/* * Copyright Siemens AG, 2017. Part of the SW360 Portal Vendor. * * All rights reserved. This program and the accompanying materials * are made available under the terms of the Eclipse Public License v1.0 * which accompanies this distribution, and is available at * http://www.eclipse.org/legal/epl-v10.html */ ...
// Path: subprojects/resource-server/src/main/java/org/eclipse/sw360/rest/resourceserver/core/HalResource.java // @JsonInclude(JsonInclude.Include.NON_NULL) // public class HalResource<T> extends Resource<T> { // // private Map<String, Object> embeddedMap; // // public HalResource(T content, Link... links) { ...
HalResource<Vendor> userHalResource = createHalVendor(sw360Vendor);
sw360/sw360rest
subprojects/resource-server/src/test/java/org/eclipse/sw360/rest/resourceserver/integration/UserTest.java
// Path: subprojects/resource-server/src/test/java/org/eclipse/sw360/rest/resourceserver/TestHelper.java // public class TestHelper { // // static public void checkResponse(String responseBody, String linkRelation, int embeddedArraySize) throws IOException { // JsonNode responseBodyJsonNode = new ObjectMap...
import org.eclipse.sw360.datahandler.thrift.users.User; import org.eclipse.sw360.rest.resourceserver.TestHelper; import org.eclipse.sw360.rest.resourceserver.user.Sw360UserService; import org.junit.Before; import org.junit.Test; import org.springframework.beans.factory.annotation.Value; import org.springframework.boot....
/* * Copyright Siemens AG, 2017. Part of the SW360 Portal Project. * * All rights reserved. This program and the accompanying materials * are made available under the terms of the Eclipse Public License v1.0 * which accompanies this distribution, and is available at * http://www.eclipse.org/legal/epl-v10.html */...
// Path: subprojects/resource-server/src/test/java/org/eclipse/sw360/rest/resourceserver/TestHelper.java // public class TestHelper { // // static public void checkResponse(String responseBody, String linkRelation, int embeddedArraySize) throws IOException { // JsonNode responseBodyJsonNode = new ObjectMap...
private Sw360UserService userServiceMock;
sw360/sw360rest
subprojects/resource-server/src/test/java/org/eclipse/sw360/rest/resourceserver/integration/UserTest.java
// Path: subprojects/resource-server/src/test/java/org/eclipse/sw360/rest/resourceserver/TestHelper.java // public class TestHelper { // // static public void checkResponse(String responseBody, String linkRelation, int embeddedArraySize) throws IOException { // JsonNode responseBodyJsonNode = new ObjectMap...
import org.eclipse.sw360.datahandler.thrift.users.User; import org.eclipse.sw360.rest.resourceserver.TestHelper; import org.eclipse.sw360.rest.resourceserver.user.Sw360UserService; import org.junit.Before; import org.junit.Test; import org.springframework.beans.factory.annotation.Value; import org.springframework.boot....
@Before public void before() { List<User> userList = new ArrayList<>(); User user = new User(); user.setId("admin@sw360.org"); user.setEmail("admin@sw360.org"); user.setFullname("John Doe"); userList.add(user); user = new User(); user.setId("jane@sw360.org")...
// Path: subprojects/resource-server/src/test/java/org/eclipse/sw360/rest/resourceserver/TestHelper.java // public class TestHelper { // // static public void checkResponse(String responseBody, String linkRelation, int embeddedArraySize) throws IOException { // JsonNode responseBodyJsonNode = new ObjectMap...
TestHelper.checkResponse(response.getBody(), "users", 2);
sw360/sw360rest
subprojects/resource-server/src/test/java/org/eclipse/sw360/rest/resourceserver/restdocs/UserSpec.java
// Path: subprojects/resource-server/src/test/java/org/eclipse/sw360/rest/resourceserver/TestHelper.java // public class TestHelper { // // static public void checkResponse(String responseBody, String linkRelation, int embeddedArraySize) throws IOException { // JsonNode responseBodyJsonNode = new ObjectMap...
import org.eclipse.sw360.datahandler.thrift.users.User; import org.eclipse.sw360.datahandler.thrift.users.UserGroup; import org.eclipse.sw360.rest.resourceserver.TestHelper; import org.eclipse.sw360.rest.resourceserver.user.Sw360UserService; import org.junit.Before; import org.junit.Test; import org.springframework.boo...
/* * Copyright Siemens AG, 2017. Part of the SW360 Portal Project. * * All rights reserved. This program and the accompanying materials * are made available under the terms of the Eclipse Public License v1.0 * which accompanies this distribution, and is available at * http://www.eclipse.org/legal/epl-v10.html */...
// Path: subprojects/resource-server/src/test/java/org/eclipse/sw360/rest/resourceserver/TestHelper.java // public class TestHelper { // // static public void checkResponse(String responseBody, String linkRelation, int embeddedArraySize) throws IOException { // JsonNode responseBodyJsonNode = new ObjectMap...
private Sw360UserService userServiceMock;
sw360/sw360rest
subprojects/resource-server/src/test/java/org/eclipse/sw360/rest/resourceserver/restdocs/UserSpec.java
// Path: subprojects/resource-server/src/test/java/org/eclipse/sw360/rest/resourceserver/TestHelper.java // public class TestHelper { // // static public void checkResponse(String responseBody, String linkRelation, int embeddedArraySize) throws IOException { // JsonNode responseBodyJsonNode = new ObjectMap...
import org.eclipse.sw360.datahandler.thrift.users.User; import org.eclipse.sw360.datahandler.thrift.users.UserGroup; import org.eclipse.sw360.rest.resourceserver.TestHelper; import org.eclipse.sw360.rest.resourceserver.user.Sw360UserService; import org.junit.Before; import org.junit.Test; import org.springframework.boo...
user.setEmail("admin@sw360.org"); user.setId(Base64.getEncoder().encodeToString(user.getEmail().getBytes("utf-8"))); user.setType("user"); user.setUserGroup(UserGroup.ADMIN); user.setFullname("John Doe"); user.setGivenname("John"); user.setLastname("Doe"); ...
// Path: subprojects/resource-server/src/test/java/org/eclipse/sw360/rest/resourceserver/TestHelper.java // public class TestHelper { // // static public void checkResponse(String responseBody, String linkRelation, int embeddedArraySize) throws IOException { // JsonNode responseBodyJsonNode = new ObjectMap...
String accessToken = TestHelper.getAccessToken(mockMvc, "admin@sw360.org", "sw360-password");
sw360/sw360rest
subprojects/resource-server/src/test/java/org/eclipse/sw360/rest/resourceserver/restdocs/LicenseSpec.java
// Path: subprojects/resource-server/src/test/java/org/eclipse/sw360/rest/resourceserver/TestHelper.java // public class TestHelper { // // static public void checkResponse(String responseBody, String linkRelation, int embeddedArraySize) throws IOException { // JsonNode responseBodyJsonNode = new ObjectMap...
import org.eclipse.sw360.datahandler.thrift.licenses.License; import org.eclipse.sw360.rest.resourceserver.TestHelper; import org.eclipse.sw360.rest.resourceserver.license.Sw360LicenseService; import org.junit.Before; import org.junit.Test; import org.springframework.boot.test.mock.mockito.MockBean; import org.springfr...
/* * Copyright Siemens AG, 2017. Part of the SW360 Portal Project. * * All rights reserved. This program and the accompanying materials * are made available under the terms of the Eclipse Public License v1.0 * which accompanies this distribution, and is available at * http://www.eclipse.org/legal/epl-v10.html */...
// Path: subprojects/resource-server/src/test/java/org/eclipse/sw360/rest/resourceserver/TestHelper.java // public class TestHelper { // // static public void checkResponse(String responseBody, String linkRelation, int embeddedArraySize) throws IOException { // JsonNode responseBodyJsonNode = new ObjectMap...
private Sw360LicenseService licenseServiceMock;
messaginghub/pooled-jms
pooled-jms/src/main/java/org/messaginghub/pooled/jms/JmsPoolJcaConnectionFactory.java
// Path: pooled-jms/src/main/java/org/messaginghub/pooled/jms/pool/PooledJCAConnection.java // public class PooledJCAConnection extends PooledXAConnection { // // private final String name; // // public PooledJCAConnection(Connection connection, TransactionManager transactionManager, String name) { // ...
import javax.jms.Connection; import org.messaginghub.pooled.jms.pool.PooledJCAConnection;
/* * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. * The ASF licenses this file to You under the Apache License, Version 2.0 * (the "License"); you may ...
// Path: pooled-jms/src/main/java/org/messaginghub/pooled/jms/pool/PooledJCAConnection.java // public class PooledJCAConnection extends PooledXAConnection { // // private final String name; // // public PooledJCAConnection(Connection connection, TransactionManager transactionManager, String name) { // ...
protected PooledJCAConnection createPooledConnection(Connection connection) {
messaginghub/pooled-jms
pooled-jms/src/test/java/org/messaginghub/pooled/jms/JmsPoolQueueReceiverTest.java
// Path: pooled-jms/src/test/java/org/messaginghub/pooled/jms/mock/MockJMSQueueReceiver.java // public class MockJMSQueueReceiver extends MockJMSMessageConsumer implements AutoCloseable, QueueReceiver { // // protected MockJMSQueueReceiver(MockJMSSession session, String consumerId, MockJMSDestination destination, ...
import org.messaginghub.pooled.jms.mock.MockJMSQueueReceiver; import static org.junit.jupiter.api.Assertions.assertNotNull; import static org.junit.jupiter.api.Assertions.assertSame; import static org.junit.jupiter.api.Assertions.assertTrue; import static org.junit.jupiter.api.Assertions.fail; import javax.jms.IllegalS...
assertNotNull(receiver.toString()); } @Test public void testGetQueue() throws JMSException { JmsPoolConnection connection = (JmsPoolConnection) cf.createQueueConnection(); QueueSession session = connection.createQueueSession(false, Session.AUTO_ACKNOWLEDGE); Queue queue = s...
// Path: pooled-jms/src/test/java/org/messaginghub/pooled/jms/mock/MockJMSQueueReceiver.java // public class MockJMSQueueReceiver extends MockJMSMessageConsumer implements AutoCloseable, QueueReceiver { // // protected MockJMSQueueReceiver(MockJMSSession session, String consumerId, MockJMSDestination destination, ...
assertTrue(receiver.getQueueReceiver() instanceof MockJMSQueueReceiver);
messaginghub/pooled-jms
pooled-jms-interop-tests/pooled-jms-activemq-tests/src/test/java/org/messaginghub/pooled/jms/PooledConnectionSessionCleanupTest.java
// Path: pooled-jms/src/test/java/org/messaginghub/pooled/jms/util/Wait.java // public class Wait { // // public static final long MAX_WAIT_MILLIS = 30 * 1000; // public static final long SLEEP_MILLIS = 200; // // public interface Condition { // boolean isSatisfied() throws Exception; // } // ...
import static org.junit.jupiter.api.Assertions.assertNotNull; import static org.junit.jupiter.api.Assertions.assertNull; import static org.junit.jupiter.api.Assertions.assertTrue; import java.util.concurrent.TimeUnit; import javax.jms.Connection; import javax.jms.JMSException; import javax.jms.MessageConsumer; import j...
directConn2.close(); } } catch (JMSException jms_exc) { } try { pooledConnFact.stop(); } catch (Throwable error) {} super.tearDown(); } private void produceMessages() throws Exception { Session session = directConn1.creat...
// Path: pooled-jms/src/test/java/org/messaginghub/pooled/jms/util/Wait.java // public class Wait { // // public static final long MAX_WAIT_MILLIS = 30 * 1000; // public static final long SLEEP_MILLIS = 200; // // public interface Condition { // boolean isSatisfied() throws Exception; // } // ...
assertTrue(Wait.waitFor(new Wait.Condition() {
messaginghub/pooled-jms
pooled-jms/src/test/java/org/messaginghub/pooled/jms/JmsPoolConnectionFactoryMaximumActiveTest.java
// Path: pooled-jms/src/test/java/org/messaginghub/pooled/jms/util/Wait.java // public class Wait { // // public static final long MAX_WAIT_MILLIS = 30 * 1000; // public static final long SLEEP_MILLIS = 200; // // public interface Condition { // boolean isSatisfied() throws Exception; // } // ...
import static org.junit.jupiter.api.Assertions.assertEquals; import static org.junit.jupiter.api.Assertions.assertFalse; import static org.junit.jupiter.api.Assertions.assertTrue; import java.util.concurrent.Callable; import java.util.concurrent.ConcurrentHashMap; import java.util.concurrent.ConcurrentMap; import java....
/* * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. * The ASF licenses this file to You under the Apache License, Version 2.0 * (the "License"); you may ...
// Path: pooled-jms/src/test/java/org/messaginghub/pooled/jms/util/Wait.java // public class Wait { // // public static final long MAX_WAIT_MILLIS = 30 * 1000; // public static final long SLEEP_MILLIS = 200; // // public interface Condition { // boolean isSatisfied() throws Exception; // } // ...
assertTrue(Wait.waitFor(new Wait.Condition() {
messaginghub/pooled-jms
pooled-jms-interop-tests/pooled-jms-activemq-tests/src/test/java/org/messaginghub/pooled/jms/PooledConnectionTest.java
// Path: pooled-jms/src/test/java/org/messaginghub/pooled/jms/util/Wait.java // public class Wait { // // public static final long MAX_WAIT_MILLIS = 30 * 1000; // public static final long SLEEP_MILLIS = 200; // // public interface Condition { // boolean isSatisfied() throws Exception; // } // ...
import javax.jms.Session; import org.junit.jupiter.api.Test; import org.junit.jupiter.api.Timeout; import org.messaginghub.pooled.jms.util.Wait; import org.slf4j.Logger; import org.slf4j.LoggerFactory; import static org.junit.jupiter.api.Assertions.assertEquals; import static org.junit.jupiter.api.Assertions.fail; impo...
// test: try to call setClientID() after start() // should result in an exception try { conn.start(); conn.setClientID("newID3"); fail("Calling setClientID() after start() mut raise a JMSException."); } catch (IllegalStateException ise) { L...
// Path: pooled-jms/src/test/java/org/messaginghub/pooled/jms/util/Wait.java // public class Wait { // // public static final long MAX_WAIT_MILLIS = 30 * 1000; // public static final long SLEEP_MILLIS = 200; // // public interface Condition { // boolean isSatisfied() throws Exception; // } // ...
boolean testPassed = Wait.waitFor(new Wait.Condition() {
messaginghub/pooled-jms
pooled-jms-interop-tests/pooled-jms-activemq-tests/src/test/java/org/messaginghub/pooled/jms/PooledConnectionFactoryMaximumActiveTest.java
// Path: pooled-jms/src/test/java/org/messaginghub/pooled/jms/util/Wait.java // public class Wait { // // public static final long MAX_WAIT_MILLIS = 30 * 1000; // public static final long SLEEP_MILLIS = 200; // // public interface Condition { // boolean isSatisfied() throws Exception; // } // ...
import static org.junit.jupiter.api.Assertions.assertEquals; import static org.junit.jupiter.api.Assertions.assertFalse; import static org.junit.jupiter.api.Assertions.assertTrue; import java.util.concurrent.Callable; import java.util.concurrent.ConcurrentHashMap; import java.util.concurrent.ConcurrentMap; import java....
/* * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. * The ASF licenses this file to You under the Apache License, Version 2.0 * (the "License"); you may ...
// Path: pooled-jms/src/test/java/org/messaginghub/pooled/jms/util/Wait.java // public class Wait { // // public static final long MAX_WAIT_MILLIS = 30 * 1000; // public static final long SLEEP_MILLIS = 200; // // public interface Condition { // boolean isSatisfied() throws Exception; // } // ...
assertTrue(Wait.waitFor(new Wait.Condition() {
messaginghub/pooled-jms
pooled-jms/src/test/java/org/messaginghub/pooled/jms/JmsPoolTopicSubscriberTest.java
// Path: pooled-jms/src/test/java/org/messaginghub/pooled/jms/mock/MockJMSTopicSubscriber.java // public class MockJMSTopicSubscriber extends MockJMSMessageConsumer implements TopicSubscriber { // // public MockJMSTopicSubscriber(MockJMSSession session, String consumerId, MockJMSDestination destination, String mes...
import org.messaginghub.pooled.jms.mock.MockJMSTopicSubscriber; import static org.junit.jupiter.api.Assertions.assertNotNull; import static org.junit.jupiter.api.Assertions.assertSame; import static org.junit.jupiter.api.Assertions.assertTrue; import static org.junit.jupiter.api.Assertions.fail; import javax.jms.Illega...
subscriber.getTopic(); fail("Cannot read topic on closed subscriber"); } catch (IllegalStateException ise) {} } @Test public void testGetNoLocal() throws JMSException { JmsPoolConnection connection = (JmsPoolConnection) cf.createTopicConnection(); TopicSessio...
// Path: pooled-jms/src/test/java/org/messaginghub/pooled/jms/mock/MockJMSTopicSubscriber.java // public class MockJMSTopicSubscriber extends MockJMSMessageConsumer implements TopicSubscriber { // // public MockJMSTopicSubscriber(MockJMSSession session, String consumerId, MockJMSDestination destination, String mes...
assertTrue(subscriber.getTopicSubscriber() instanceof MockJMSTopicSubscriber);
messaginghub/pooled-jms
pooled-jms-interop-tests/pooled-jms-activemq-tests/src/test/java/org/messaginghub/pooled/jms/PooledConnectionFactoryTest.java
// Path: pooled-jms/src/test/java/org/messaginghub/pooled/jms/util/Wait.java // public class Wait { // // public static final long MAX_WAIT_MILLIS = 30 * 1000; // public static final long SLEEP_MILLIS = 200; // // public interface Condition { // boolean isSatisfied() throws Exception; // } // ...
import static org.junit.jupiter.api.Assertions.assertEquals; import static org.junit.jupiter.api.Assertions.assertNotSame; import static org.junit.jupiter.api.Assertions.assertNull; import static org.junit.jupiter.api.Assertions.assertSame; import static org.junit.jupiter.api.Assertions.assertTrue; import static org.ju...
} finally { cf.stop(); } } @Test public void testConnectionsArePooledAsyncCreate() throws Exception { final JmsPoolConnectionFactory cf = createPooledConnectionFactory(); cf.setMaxConnections(1); final ConcurrentLinkedQueue<JmsPoolConnection> connections...
// Path: pooled-jms/src/test/java/org/messaginghub/pooled/jms/util/Wait.java // public class Wait { // // public static final long MAX_WAIT_MILLIS = 30 * 1000; // public static final long SLEEP_MILLIS = 200; // // public interface Condition { // boolean isSatisfied() throws Exception; // } // ...
assertTrue(Wait.waitFor(new Wait.Condition() {
fcpauldiaz/Compilador
src/compiler/SymbolTable.java
// Path: src/gui/ANTGui.java // public static javax.swing.JTextPane jTextArea3;
import static gui.ANTGui.jTextArea3; import java.awt.Color; import java.util.HashMap; import java.util.Map; import javax.swing.text.BadLocationException; import javax.swing.text.Style; import javax.swing.text.StyleConstants; import javax.swing.text.StyledDocument;
return null; } public Symbol findAllScopes(String nombreVar){ try{ for (Map.Entry<Integer, Symbol> entry : tabla.entrySet()) { int key = entry.getKey(); Symbol value = entry.getValue(); ...
// Path: src/gui/ANTGui.java // public static javax.swing.JTextPane jTextArea3; // Path: src/compiler/SymbolTable.java import static gui.ANTGui.jTextArea3; import java.awt.Color; import java.util.HashMap; import java.util.Map; import javax.swing.text.BadLocationException; import javax.swing.text.Style; import javax.s...
StyledDocument doc = jTextArea3.getStyledDocument();
fcpauldiaz/Compilador
src/compiler/DescriptiveErrorListener.java
// Path: src/gui/ANTGui.java // public static javax.swing.JTextPane jTextArea3;
import static gui.ANTGui.jTextArea3; import java.awt.Color; import java.util.Collections; import java.util.List; import javax.swing.text.BadLocationException; import javax.swing.text.Style; import javax.swing.text.StyleConstants; import javax.swing.text.StyledDocument; import org.antlr.v4.runtime.BaseErrorListener; imp...
/** * Universidad Del Valle de Guatemala * 25-ene-2016 * Pablo Díaz 13203 */ package compiler; /** * * @author Pablo */ public class DescriptiveErrorListener extends BaseErrorListener { public static DescriptiveErrorListener INSTANCE = new DescriptiveErrorListener(); @Override public void ...
// Path: src/gui/ANTGui.java // public static javax.swing.JTextPane jTextArea3; // Path: src/compiler/DescriptiveErrorListener.java import static gui.ANTGui.jTextArea3; import java.awt.Color; import java.util.Collections; import java.util.List; import javax.swing.text.BadLocationException; import javax.swing.text.Sty...
StyledDocument doc = jTextArea3.getStyledDocument();
fcpauldiaz/Compilador
src/compiler/InterCodeTable.java
// Path: src/compiler/Visitor.java // public static SymbolTable tablaSimbolos;
import static compiler.Visitor.tablaSimbolos; import java.util.ArrayList; import java.util.Map;
if (sp != null){ if (i != (j+1)){ IntermediateCode c = copyArray.get(i); copyArray.remove(i); copyArray.add(j+1, c); j = j +1 ; }else{ j = i ; } } ...
// Path: src/compiler/Visitor.java // public static SymbolTable tablaSimbolos; // Path: src/compiler/InterCodeTable.java import static compiler.Visitor.tablaSimbolos; import java.util.ArrayList; import java.util.Map; if (sp != null){ if (i != (j+1)){ IntermediateCode c...
for (Map.Entry<Integer, Symbol> entry : tablaSimbolos.getTabla().entrySet()) {
cdecker/BitDroid-Network
src/main/java/net/bitdroid/network/Event.java
// Path: src/main/java/net/bitdroid/network/messages/Message.java // public abstract class Message extends Event { // public abstract EventType getType(); // // /** // * @return the command // */ // public abstract String getCommand(); // private int payloadSize; // // public int getPayloadSize() { // retu...
import net.bitdroid.network.messages.Message;
/** * Copyright 2011 Christian Decker * * 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...
// Path: src/main/java/net/bitdroid/network/messages/Message.java // public abstract class Message extends Event { // public abstract EventType getType(); // // /** // * @return the command // */ // public abstract String getCommand(); // private int payloadSize; // // public int getPayloadSize() { // retu...
public Event(PeerInfo o, EventType type, Message m){
cdecker/BitDroid-Network
src/test/java/net/bitdroid/network/wire/TestLittleEndianInputStream.java
// Path: src/main/java/net/bitdroid/utils/StringUtils.java // public class StringUtils { // // static final byte[] HEX_CHAR_TABLE = { // (byte)'0', (byte)'1', (byte)'2', (byte)'3', // (byte)'4', (byte)'5', (byte)'6', (byte)'7', // (byte)'8', (byte)'9', (byte)'a', (byte)'b', // (byte)'c', (byte)'d', (byte)'e',...
import static org.junit.Assert.assertEquals; import java.io.IOException; import java.math.BigInteger; import java.util.Arrays; import net.bitdroid.utils.StringUtils; import org.junit.After; import org.junit.Before; import org.junit.Test;
/** * Copyright 2011 Christian Decker * * 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...
// Path: src/main/java/net/bitdroid/utils/StringUtils.java // public class StringUtils { // // static final byte[] HEX_CHAR_TABLE = { // (byte)'0', (byte)'1', (byte)'2', (byte)'3', // (byte)'4', (byte)'5', (byte)'6', (byte)'7', // (byte)'8', (byte)'9', (byte)'a', (byte)'b', // (byte)'c', (byte)'d', (byte)'e',...
StringUtils.reverse(b);
nisovin/Shopkeepers
src/main/java/com/nisovin/shopkeepers/LivingEntityShopListener.java
// Path: src/main/java/com/nisovin/shopkeepers/compat/NMSManager.java // public final class NMSManager { // // private static NMSCallProvider provider; // // public static NMSCallProvider getProvider() { // return NMSManager.provider; // } // // public static void load(Plugin plugin) { // final String packag...
import org.bukkit.Location; import org.bukkit.entity.Entity; import org.bukkit.entity.EntityType; import org.bukkit.entity.LivingEntity; import org.bukkit.entity.Monster; import org.bukkit.entity.Player; import org.bukkit.event.EventHandler; import org.bukkit.event.EventPriority; import org.bukkit.event.Listener; impor...
package com.nisovin.shopkeepers; class LivingEntityShopListener implements Listener { // the radius around lightning strikes in which villagers turn into witches private static final int VILLAGER_ZAP_RADIUS = 7; // minecraft wiki says 3-4, we use 7 to be safe private final ShopkeepersPlugin plugin; LivingEnti...
// Path: src/main/java/com/nisovin/shopkeepers/compat/NMSManager.java // public final class NMSManager { // // private static NMSCallProvider provider; // // public static NMSCallProvider getProvider() { // return NMSManager.provider; // } // // public static void load(Plugin plugin) { // final String packag...
if (NMSManager.getProvider().isMainHandInteraction(event)) {
nisovin/Shopkeepers
src/main/java/com/nisovin/shopkeepers/LivingEntityShopListener.java
// Path: src/main/java/com/nisovin/shopkeepers/compat/NMSManager.java // public final class NMSManager { // // private static NMSCallProvider provider; // // public static NMSCallProvider getProvider() { // return NMSManager.provider; // } // // public static void load(Plugin plugin) { // final String packag...
import org.bukkit.Location; import org.bukkit.entity.Entity; import org.bukkit.entity.EntityType; import org.bukkit.entity.LivingEntity; import org.bukkit.entity.Monster; import org.bukkit.entity.Player; import org.bukkit.event.EventHandler; import org.bukkit.event.EventPriority; import org.bukkit.event.Listener; impor...
package com.nisovin.shopkeepers; class LivingEntityShopListener implements Listener { // the radius around lightning strikes in which villagers turn into witches private static final int VILLAGER_ZAP_RADIUS = 7; // minecraft wiki says 3-4, we use 7 to be safe private final ShopkeepersPlugin plugin; LivingEnti...
// Path: src/main/java/com/nisovin/shopkeepers/compat/NMSManager.java // public final class NMSManager { // // private static NMSCallProvider provider; // // public static NMSCallProvider getProvider() { // return NMSManager.provider; // } // // public static void load(Plugin plugin) { // final String packag...
if (shopkeeper.getShopObject().getObjectType() != DefaultShopObjectTypes.CITIZEN()) {
nisovin/Shopkeepers
src/main/java/com/nisovin/shopkeepers/Utils.java
// Path: src/main/java/com/nisovin/shopkeepers/compat/NMSManager.java // public final class NMSManager { // // private static NMSCallProvider provider; // // public static NMSCallProvider getProvider() { // return NMSManager.provider; // } // // public static void load(Plugin plugin) { // final String packag...
import java.text.DecimalFormat; import java.text.DecimalFormatSymbols; import java.util.ArrayList; import java.util.List; import java.util.Locale; import org.apache.commons.lang.Validate; import org.bukkit.Bukkit; import org.bukkit.ChatColor; import org.bukkit.Chunk; import org.bukkit.Location; import org.bukkit.Materi...
if (!item.hasItemMeta()) return false; itemMeta = item.getItemMeta(); if (itemMeta == null) return false; } if (!itemMeta.hasLore() || !lore.equals(itemMeta.getLore())) { return false; } } return true; } // save and load itemstacks from config, including attributes: /** * Saves the...
// Path: src/main/java/com/nisovin/shopkeepers/compat/NMSManager.java // public final class NMSManager { // // private static NMSCallProvider provider; // // public static NMSCallProvider getProvider() { // return NMSManager.provider; // } // // public static void load(Plugin plugin) { // final String packag...
String attributes = NMSManager.getProvider().saveItemAttributesToString(item);
nisovin/Shopkeepers
src/main/java/com/nisovin/shopkeepers/Settings.java
// Path: src/main/java/com/nisovin/shopkeepers/compat/NMSManager.java // public final class NMSManager { // // private static NMSCallProvider provider; // // public static NMSCallProvider getProvider() { // return NMSManager.provider; // } // // public static void load(Plugin plugin) { // final String packag...
import java.lang.reflect.Field; import java.lang.reflect.ParameterizedType; import java.util.ArrayList; import java.util.Arrays; import java.util.List; import org.bukkit.Material; import org.bukkit.configuration.Configuration; import org.bukkit.entity.EntityType; import org.bukkit.inventory.ItemStack; import com.google...
if (highCurrencyValue <= 0) highCurrencyItem = Material.AIR; // certain items cannot be of type AIR: if (shopCreationItem == Material.AIR) shopCreationItem = Material.MONSTER_EGG; if (hireItem == Material.AIR) hireItem = Material.EMERALD; if (currencyItem == Material.AIR) currencyItem = Material.EMERALD; r...
// Path: src/main/java/com/nisovin/shopkeepers/compat/NMSManager.java // public final class NMSManager { // // private static NMSCallProvider provider; // // public static NMSCallProvider getProvider() { // return NMSManager.provider; // } // // public static void load(Plugin plugin) { // final String packag...
if (shopCreationItem == Material.MONSTER_EGG && !Utils.isEmpty(shopCreationItemSpawnEggEntityType) && NMSManager.getProvider().supportsSpawnEggEntityType()) {
nisovin/Shopkeepers
src/main/java/com/nisovin/shopkeepers/CreateListener.java
// Path: src/main/java/com/nisovin/shopkeepers/compat/NMSManager.java // public final class NMSManager { // // private static NMSCallProvider provider; // // public static NMSCallProvider getProvider() { // return NMSManager.provider; // } // // public static void load(Plugin plugin) { // final String packag...
import org.bukkit.Bukkit; import org.bukkit.GameMode; import org.bukkit.Material; import org.bukkit.block.Block; import org.bukkit.block.BlockFace; import org.bukkit.entity.Player; import org.bukkit.event.Event.Result; import org.bukkit.event.EventHandler; import org.bukkit.event.EventPriority; import org.bukkit.event....
void onPlayerInteract(PlayerInteractEvent event) { // ignore our own fake interact event: if (event instanceof TestPlayerInteractEvent) return; // ignore if the player isn't right-clicking: Action action = event.getAction(); if (action != Action.RIGHT_CLICK_AIR && action != Action.RIGHT_CLICK_BLOCK) return;...
// Path: src/main/java/com/nisovin/shopkeepers/compat/NMSManager.java // public final class NMSManager { // // private static NMSCallProvider provider; // // public static NMSCallProvider getProvider() { // return NMSManager.provider; // } // // public static void load(Plugin plugin) { // final String packag...
if (!NMSManager.getProvider().isMainHandInteraction(event)) {
nisovin/Shopkeepers
src/main/java/com/nisovin/shopkeepers/CreateListener.java
// Path: src/main/java/com/nisovin/shopkeepers/compat/NMSManager.java // public final class NMSManager { // // private static NMSCallProvider provider; // // public static NMSCallProvider getProvider() { // return NMSManager.provider; // } // // public static void load(Plugin plugin) { // final String packag...
import org.bukkit.Bukkit; import org.bukkit.GameMode; import org.bukkit.Material; import org.bukkit.block.Block; import org.bukkit.block.BlockFace; import org.bukkit.entity.Player; import org.bukkit.event.Event.Result; import org.bukkit.event.EventHandler; import org.bukkit.event.EventPriority; import org.bukkit.event....
} // TODO maybe always prevent normal usage, also for cases in which shop creation failed because of some // reason, and instead optionally allow normal usage when crouching? Or, if normal usage is not denied, // allow shop creation only when crouching? // Or handle chest selection and/or shop crea...
// Path: src/main/java/com/nisovin/shopkeepers/compat/NMSManager.java // public final class NMSManager { // // private static NMSCallProvider provider; // // public static NMSCallProvider getProvider() { // return NMSManager.provider; // } // // public static void load(Plugin plugin) { // final String packag...
if (shopObjType == DefaultShopObjectTypes.SIGN() && !Utils.isWallSignFace(clickedBlockFace)) {
nisovin/Shopkeepers
src/main/java/com/nisovin/shopkeepers/events/CreatePlayerShopkeeperEvent.java
// Path: src/main/java/com/nisovin/shopkeepers/ShopType.java // public abstract class ShopType<T extends Shopkeeper> extends SelectableType { // // protected ShopType(String identifier, String permission) { // super(identifier, permission); // } // // /** // * Whether or not this shop type is a player shop typ...
import org.apache.commons.lang.Validate; import org.bukkit.Location; import org.bukkit.block.Block; import org.bukkit.entity.Player; import org.bukkit.event.Cancellable; import org.bukkit.event.Event; import org.bukkit.event.HandlerList; import com.nisovin.shopkeepers.ShopCreationData; import com.nisovin.shopkeepers.Sh...
package com.nisovin.shopkeepers.events; /** * This event is called whenever a player attempts to create a player shopkeeper. * * <p> * It is called before the max shops limits is checked for the player.<br> * The location, shopkeeper type, and player's max shops can be modified.<br> * If this event is cancell...
// Path: src/main/java/com/nisovin/shopkeepers/ShopType.java // public abstract class ShopType<T extends Shopkeeper> extends SelectableType { // // protected ShopType(String identifier, String permission) { // super(identifier, permission); // } // // /** // * Whether or not this shop type is a player shop typ...
public ShopType<?> getType() {
nisovin/Shopkeepers
src/main/java/com/nisovin/shopkeepers/compat/NMSManager.java
// Path: src/main/java/com/nisovin/shopkeepers/Log.java // public class Log { // // public static Logger getLogger() { // return ShopkeepersPlugin.getInstance().getLogger(); // } // // public static void info(String message) { // if (message == null || message.isEmpty()) return; // getLogger().info(message);...
import org.bukkit.plugin.Plugin; import com.nisovin.shopkeepers.Log; import com.nisovin.shopkeepers.compat.api.NMSCallProvider;
package com.nisovin.shopkeepers.compat; public final class NMSManager { private static NMSCallProvider provider; public static NMSCallProvider getProvider() { return NMSManager.provider; } public static void load(Plugin plugin) { final String packageName = plugin.getServer().getClass().getPackage().getNam...
// Path: src/main/java/com/nisovin/shopkeepers/Log.java // public class Log { // // public static Logger getLogger() { // return ShopkeepersPlugin.getInstance().getLogger(); // } // // public static void info(String message) { // if (message == null || message.isEmpty()) return; // getLogger().info(message);...
Log.severe("Potentially incompatible server version: " + cbversion);
nisovin/Shopkeepers
src/main/java/com/nisovin/shopkeepers/SignShopListener.java
// Path: src/main/java/com/nisovin/shopkeepers/compat/NMSManager.java // public final class NMSManager { // // private static NMSCallProvider provider; // // public static NMSCallProvider getProvider() { // return NMSManager.provider; // } // // public static void load(Plugin plugin) { // final String packag...
import java.util.Iterator; import org.bukkit.Location; import org.bukkit.block.Block; import org.bukkit.entity.Player; import org.bukkit.event.Event.Result; import org.bukkit.event.EventHandler; import org.bukkit.event.EventPriority; import org.bukkit.event.Listener; import org.bukkit.event.block.Action; import org.buk...
package com.nisovin.shopkeepers; class SignShopListener implements Listener { private final ShopkeepersPlugin plugin; private Location cancelNextBlockPhysicsLoc = null; SignShopListener(ShopkeepersPlugin plugin) { this.plugin = plugin; } void cancelNextBlockPhysics(Location location) { cancelNextBlockP...
// Path: src/main/java/com/nisovin/shopkeepers/compat/NMSManager.java // public final class NMSManager { // // private static NMSCallProvider provider; // // public static NMSCallProvider getProvider() { // return NMSManager.provider; // } // // public static void load(Plugin plugin) { // final String packag...
if (NMSManager.getProvider().isMainHandInteraction(event)) {
nisovin/Shopkeepers
src/main/java/com/nisovin/shopkeepers/VillagerInteractionListener.java
// Path: src/main/java/com/nisovin/shopkeepers/compat/NMSManager.java // public final class NMSManager { // // private static NMSCallProvider provider; // // public static NMSCallProvider getProvider() { // return NMSManager.provider; // } // // public static void load(Plugin plugin) { // final String packag...
import java.util.Map; import org.bukkit.entity.Player; import org.bukkit.entity.Villager; import org.bukkit.event.EventHandler; import org.bukkit.event.EventPriority; import org.bukkit.event.Listener; import org.bukkit.event.player.PlayerInteractEntityEvent; import org.bukkit.inventory.Inventory; import org.bukkit.inve...
package com.nisovin.shopkeepers; class VillagerInteractionListener implements Listener { private final ShopkeepersPlugin plugin; VillagerInteractionListener(ShopkeepersPlugin plugin) { this.plugin = plugin; } @EventHandler(priority = EventPriority.HIGH, ignoreCancelled = true) void onEntityInteract(Player...
// Path: src/main/java/com/nisovin/shopkeepers/compat/NMSManager.java // public final class NMSManager { // // private static NMSCallProvider provider; // // public static NMSCallProvider getProvider() { // return NMSManager.provider; // } // // public static void load(Plugin plugin) { // final String packag...
if (!NMSManager.getProvider().isMainHandInteraction(event)) return;
VanTamNguyen/Nand2Tetris
nand2tetris/projects/11/Compiler/src/com/tamco/hack/compiler/CompilationEngine.java
// Path: nand2tetris/projects/11/Compiler/src/com/tamco/hack/compiler/lexical/Lexical.java // public class Lexical { // // public static final List<String> keywords = Arrays.asList("class", "constructor", "function", // "method", "field", "static", "var", // "int", "char", "boolean",...
import com.tamco.hack.compiler.lexical.Lexical; import com.tamco.hack.compiler.symbol.Symbol; import java.util.HashMap; import java.util.List; import java.util.Map;
package com.tamco.hack.compiler; /** * Created by tam-co on 12/07/2017. */ public class CompilationEngine { private String clazzName;
// Path: nand2tetris/projects/11/Compiler/src/com/tamco/hack/compiler/lexical/Lexical.java // public class Lexical { // // public static final List<String> keywords = Arrays.asList("class", "constructor", "function", // "method", "field", "static", "var", // "int", "char", "boolean",...
private List<Lexical> tokens;
VanTamNguyen/Nand2Tetris
nand2tetris/projects/11/Compiler/src/com/tamco/hack/compiler/CompilationEngine.java
// Path: nand2tetris/projects/11/Compiler/src/com/tamco/hack/compiler/lexical/Lexical.java // public class Lexical { // // public static final List<String> keywords = Arrays.asList("class", "constructor", "function", // "method", "field", "static", "var", // "int", "char", "boolean",...
import com.tamco.hack.compiler.lexical.Lexical; import com.tamco.hack.compiler.symbol.Symbol; import java.util.HashMap; import java.util.List; import java.util.Map;
package com.tamco.hack.compiler; /** * Created by tam-co on 12/07/2017. */ public class CompilationEngine { private String clazzName; private List<Lexical> tokens; private List<String> vmCommands; private int count = -1; private Lexical currentToken;
// Path: nand2tetris/projects/11/Compiler/src/com/tamco/hack/compiler/lexical/Lexical.java // public class Lexical { // // public static final List<String> keywords = Arrays.asList("class", "constructor", "function", // "method", "field", "static", "var", // "int", "char", "boolean",...
private Map<String, Symbol> clazzSymbolTable;
VanTamNguyen/Nand2Tetris
nand2tetris/projects/10/Compiler/src/com/tamco/hack/compiler/JackAnalyzer.java
// Path: nand2tetris/projects/11/Compiler/src/com/tamco/hack/compiler/lexical/Lexical.java // public class Lexical { // // public static final List<String> keywords = Arrays.asList("class", "constructor", "function", // "method", "field", "static", "var", // "int", "char", "boolean",...
import com.tamco.hack.compiler.lexical.Lexical; import java.io.BufferedWriter; import java.io.File; import java.io.FileWriter; import java.io.IOException; import java.util.ArrayList; import java.util.List;
package com.tamco.hack.compiler; /** * Created by tam-co on 12/07/2017. */ public class JackAnalyzer { public static void main(String[] args) { File src1 = new File("../ArrayTest"); File src2 = new File("../Square"); File src3 = new File("../ExpressionLessSquare"); try { parseSource(src1); parseSo...
// Path: nand2tetris/projects/11/Compiler/src/com/tamco/hack/compiler/lexical/Lexical.java // public class Lexical { // // public static final List<String> keywords = Arrays.asList("class", "constructor", "function", // "method", "field", "static", "var", // "int", "char", "boolean",...
List<Lexical> tokens = tokenizer.tokenize();
VanTamNguyen/Nand2Tetris
nand2tetris/projects/11/Compiler/src/com/tamco/hack/compiler/JackCompiler.java
// Path: nand2tetris/projects/11/Compiler/src/com/tamco/hack/compiler/lexical/Lexical.java // public class Lexical { // // public static final List<String> keywords = Arrays.asList("class", "constructor", "function", // "method", "field", "static", "var", // "int", "char", "boolean",...
import com.tamco.hack.compiler.lexical.Lexical; import java.io.BufferedWriter; import java.io.File; import java.io.FileWriter; import java.io.IOException; import java.util.ArrayList; import java.util.List;
package com.tamco.hack.compiler; /** * Created by tam-co on 12/07/2017. */ public class JackCompiler { public static void main(String[] args) { File src1 = new File("../ArrayTest"); File src2 = new File("../Square"); File src3 = new File("../ExpressionLessSquare"); try { parseSource(src1); parseSo...
// Path: nand2tetris/projects/11/Compiler/src/com/tamco/hack/compiler/lexical/Lexical.java // public class Lexical { // // public static final List<String> keywords = Arrays.asList("class", "constructor", "function", // "method", "field", "static", "var", // "int", "char", "boolean",...
List<Lexical> tokens = tokenizer.tokenize();
VanTamNguyen/Nand2Tetris
nand2tetris/projects/11/Compiler/src/com/tamco/hack/compiler/JackTokenizer.java
// Path: nand2tetris/projects/11/Compiler/src/com/tamco/hack/compiler/lexical/Lexical.java // public class Lexical { // // public static final List<String> keywords = Arrays.asList("class", "constructor", "function", // "method", "field", "static", "var", // "int", "char", "boolean",...
import com.tamco.hack.compiler.lexical.Lexical; import java.io.BufferedReader; import java.io.File; import java.io.FileReader; import java.io.IOException; import java.util.ArrayList; import java.util.List;
package com.tamco.hack.compiler; /** * Created by tam-co on 12/07/2017. */ public class JackTokenizer { private File sourceCode; public JackTokenizer(File sourceCode) { this.sourceCode = sourceCode; }
// Path: nand2tetris/projects/11/Compiler/src/com/tamco/hack/compiler/lexical/Lexical.java // public class Lexical { // // public static final List<String> keywords = Arrays.asList("class", "constructor", "function", // "method", "field", "static", "var", // "int", "char", "boolean",...
public List<Lexical> tokenize() throws IOException {
tudoNoob/poseidon
src/main/java/com/poseidon/advices/ControllerThrowsAdvice.java
// Path: src/main/java/com/poseidon/exception/MethodDeclarationException.java // public class MethodDeclarationException extends PoseidonException { // // // public MethodDeclarationException(String message) { // super(message); // // } // // }
import com.poseidon.exception.MethodDeclarationException; import org.aspectj.lang.JoinPoint; import org.aspectj.lang.annotation.Aspect; import org.aspectj.lang.annotation.Before; import org.aspectj.lang.reflect.MethodSignature; import org.springframework.stereotype.Component; import org.springframework.stereotype.Contr...
package com.poseidon.advices; @Component @Aspect public class ControllerThrowsAdvice { @Before("execution(* com.poseidon.*.*Controller..*(..))") public void validateThrowsonController(JoinPoint joinPoint) { final MethodSignature methodSignature = (MethodSignature) joinPoint.getSignature(); Method method = met...
// Path: src/main/java/com/poseidon/exception/MethodDeclarationException.java // public class MethodDeclarationException extends PoseidonException { // // // public MethodDeclarationException(String message) { // super(message); // // } // // } // Path: src/main/java/com/poseidon/advices/ControllerThrowsAdvic...
throw new MethodDeclarationException("Nao pode declarar throws em um com.poseidon.controller.Controller: "+method.getName());
tudoNoob/poseidon
src/test/java/com/poseidon/model/UserViewTest.java
// Path: src/main/java/com/poseidon/builder/UsersBuilder.java // public class UsersBuilder { // // private Users myObject; // private List<Users> usersList; // // public UsersBuilder(){ // myObject= new Users(); // usersList= new ArrayList<>(); // } // // public Users build(){ // ...
import com.poseidon.builder.UsersBuilder; import org.testng.annotations.BeforeTest; import org.testng.annotations.Test; import static org.testng.AssertJUnit.assertEquals;
package com.poseidon.model; @Test public class UserViewTest { ContaView contaView; Users user; @BeforeTest public void setUp() throws Exception {
// Path: src/main/java/com/poseidon/builder/UsersBuilder.java // public class UsersBuilder { // // private Users myObject; // private List<Users> usersList; // // public UsersBuilder(){ // myObject= new Users(); // usersList= new ArrayList<>(); // } // // public Users build(){ // ...
user = new UsersBuilder().withUsername("name").withPassword("123").build();
tudoNoob/poseidon
src/main/java/com/poseidon/WebSecurityConfig.java
// Path: src/main/java/com/poseidon/logout/CustomLogoutHandler.java // public class CustomLogoutHandler implements LogoutHandler { // // private Logger logger = Logger.getLogger(CustomLogoutHandler.class); // // @Override // public void logout(HttpServletRequest request, HttpServletResponse response, Authenticati...
import com.poseidon.logout.CustomLogoutHandler; import com.poseidon.logout.LogoutRequestMatcher; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.context.annotation.Configuration; import org.springframework.security.config.annotation.authentication.builders.AuthenticationManager...
package com.poseidon; @Configuration @EnableWebSecurity public class WebSecurityConfig extends WebSecurityConfigurerAdapter { @Autowired private DataSource dataSource; @Override protected void configure(HttpSecurity http) throws Exception { http.authorizeRequests().antMatchers("/createSimpleUser","/createUser...
// Path: src/main/java/com/poseidon/logout/CustomLogoutHandler.java // public class CustomLogoutHandler implements LogoutHandler { // // private Logger logger = Logger.getLogger(CustomLogoutHandler.class); // // @Override // public void logout(HttpServletRequest request, HttpServletResponse response, Authenticati...
.addLogoutHandler(new CustomLogoutHandler())
tudoNoob/poseidon
src/main/java/com/poseidon/WebSecurityConfig.java
// Path: src/main/java/com/poseidon/logout/CustomLogoutHandler.java // public class CustomLogoutHandler implements LogoutHandler { // // private Logger logger = Logger.getLogger(CustomLogoutHandler.class); // // @Override // public void logout(HttpServletRequest request, HttpServletResponse response, Authenticati...
import com.poseidon.logout.CustomLogoutHandler; import com.poseidon.logout.LogoutRequestMatcher; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.context.annotation.Configuration; import org.springframework.security.config.annotation.authentication.builders.AuthenticationManager...
package com.poseidon; @Configuration @EnableWebSecurity public class WebSecurityConfig extends WebSecurityConfigurerAdapter { @Autowired private DataSource dataSource; @Override protected void configure(HttpSecurity http) throws Exception { http.authorizeRequests().antMatchers("/createSimpleUser","/createUser...
// Path: src/main/java/com/poseidon/logout/CustomLogoutHandler.java // public class CustomLogoutHandler implements LogoutHandler { // // private Logger logger = Logger.getLogger(CustomLogoutHandler.class); // // @Override // public void logout(HttpServletRequest request, HttpServletResponse response, Authenticati...
.logoutRequestMatcher(new LogoutRequestMatcher()).invalidateHttpSession(true);
tudoNoob/poseidon
src/main/java/com/poseidon/dao/QuiropraxistaDao.java
// Path: src/main/java/com/poseidon/model/Quiropraxista.java // @Entity // public class Quiropraxista { // // @Id // @GeneratedValue(strategy = GenerationType.AUTO) // private Integer id; // private String nome; // // public Quiropraxista() { // // } // // public Quiropraxista(Integer id, String nome) { // ...
import com.poseidon.model.Quiropraxista; import org.springframework.beans.factory.annotation.Qualifier; import org.springframework.data.repository.CrudRepository; import org.springframework.stereotype.Repository;
package com.poseidon.dao; @Repository @Qualifier()
// Path: src/main/java/com/poseidon/model/Quiropraxista.java // @Entity // public class Quiropraxista { // // @Id // @GeneratedValue(strategy = GenerationType.AUTO) // private Integer id; // private String nome; // // public Quiropraxista() { // // } // // public Quiropraxista(Integer id, String nome) { // ...
public interface QuiropraxistaDao extends CrudRepository<Quiropraxista, Integer>{
tudoNoob/poseidon
src/main/java/com/poseidon/advices/LogAspects.java
// Path: src/main/java/com/poseidon/model/AtributosClasse.java // public class AtributosClasse { // // private String metodoNome; // // private String argumentos; // // private String returnType; // // public static AtributosClasse builderAtributosClasse(JoinPoint joinPoint) { // AtributosClasse atributosClas...
import com.poseidon.model.AtributosClasse; import org.aspectj.lang.JoinPoint; import org.aspectj.lang.annotation.AfterReturning; import org.aspectj.lang.annotation.AfterThrowing; import org.aspectj.lang.annotation.Aspect; import org.aspectj.lang.annotation.Before; import org.slf4j.Logger; import org.slf4j.LoggerFactory...
package com.poseidon.advices; @Aspect @Component public class LogAspects { @Before("execution(* com.poseidon.*..*(..))") public void logServiceAccess(JoinPoint joinPoint) { Logger LOGGER = createLog(joinPoint);
// Path: src/main/java/com/poseidon/model/AtributosClasse.java // public class AtributosClasse { // // private String metodoNome; // // private String argumentos; // // private String returnType; // // public static AtributosClasse builderAtributosClasse(JoinPoint joinPoint) { // AtributosClasse atributosClas...
AtributosClasse atributosClasse = criaAtributosClasse(joinPoint);
tudoNoob/poseidon
src/main/java/com/poseidon/utils/PoseidonUtils.java
// Path: src/main/java/com/poseidon/exception/DateSqlParseException.java // public class DateSqlParseException extends PoseidonException { // // private static final long serialVersionUID = 2205794616246894466L; // // // public DateSqlParseException(Throwable cause) { // super(cause); // // } // // // // ...
import com.fasterxml.jackson.core.JsonProcessingException; import com.fasterxml.jackson.databind.ObjectMapper; import com.poseidon.exception.DateSqlParseException; import org.slf4j.Logger; import org.slf4j.LoggerFactory; import java.text.ParseException; import java.text.SimpleDateFormat; import java.util.Date;
package com.poseidon.utils; public class PoseidonUtils { private static final Logger LOGGER = LoggerFactory.getLogger(PoseidonUtils.class); public static java.sql.Date convertToDate(String toDate) { SimpleDateFormat format = new SimpleDateFormat("dd/mm/yyyy"); Date parsed; java.sql...
// Path: src/main/java/com/poseidon/exception/DateSqlParseException.java // public class DateSqlParseException extends PoseidonException { // // private static final long serialVersionUID = 2205794616246894466L; // // // public DateSqlParseException(Throwable cause) { // super(cause); // // } // // // // ...
throw new DateSqlParseException(e);
tudoNoob/poseidon
src/main/java/com/poseidon/controller/ContaController.java
// Path: src/main/java/com/poseidon/builder/ContaViewBuilder.java // public class ContaViewBuilder { // // private ContaView myObject; // // public ContaViewBuilder(){ // myObject= new ContaView(); // } // // public ContaView build(){ // return myObject; // } // // public Con...
import com.google.common.collect.Lists; import com.poseidon.annotation.NotNullArgs; import com.poseidon.annotation.ViewName; import com.poseidon.builder.ContaViewBuilder; import com.poseidon.dao.AuthoritiesRepository; import com.poseidon.dao.UserRepository; import com.poseidon.enums.CRUDViewEnum; import com.poseidon.mo...
package com.poseidon.controller; @Controller @RequestMapping("/admin") public class ContaController extends ControllerBase { public static final String ROLE_PREFIX = "ROLE_"; public static final String CONTAS_CLASS_NAME = "contas"; public static final String CONTA_VIEW_NAME = "Conta"; public static...
// Path: src/main/java/com/poseidon/builder/ContaViewBuilder.java // public class ContaViewBuilder { // // private ContaView myObject; // // public ContaViewBuilder(){ // myObject= new ContaView(); // } // // public ContaView build(){ // return myObject; // } // // public Con...
AuthoritiesRepository authoritiesRepository;
tudoNoob/poseidon
src/main/java/com/poseidon/controller/ContaController.java
// Path: src/main/java/com/poseidon/builder/ContaViewBuilder.java // public class ContaViewBuilder { // // private ContaView myObject; // // public ContaViewBuilder(){ // myObject= new ContaView(); // } // // public ContaView build(){ // return myObject; // } // // public Con...
import com.google.common.collect.Lists; import com.poseidon.annotation.NotNullArgs; import com.poseidon.annotation.ViewName; import com.poseidon.builder.ContaViewBuilder; import com.poseidon.dao.AuthoritiesRepository; import com.poseidon.dao.UserRepository; import com.poseidon.enums.CRUDViewEnum; import com.poseidon.mo...
package com.poseidon.controller; @Controller @RequestMapping("/admin") public class ContaController extends ControllerBase { public static final String ROLE_PREFIX = "ROLE_"; public static final String CONTAS_CLASS_NAME = "contas"; public static final String CONTA_VIEW_NAME = "Conta"; public static...
// Path: src/main/java/com/poseidon/builder/ContaViewBuilder.java // public class ContaViewBuilder { // // private ContaView myObject; // // public ContaViewBuilder(){ // myObject= new ContaView(); // } // // public ContaView build(){ // return myObject; // } // // public Con...
UserRepository userRepository;
tudoNoob/poseidon
src/main/java/com/poseidon/controller/ContaController.java
// Path: src/main/java/com/poseidon/builder/ContaViewBuilder.java // public class ContaViewBuilder { // // private ContaView myObject; // // public ContaViewBuilder(){ // myObject= new ContaView(); // } // // public ContaView build(){ // return myObject; // } // // public Con...
import com.google.common.collect.Lists; import com.poseidon.annotation.NotNullArgs; import com.poseidon.annotation.ViewName; import com.poseidon.builder.ContaViewBuilder; import com.poseidon.dao.AuthoritiesRepository; import com.poseidon.dao.UserRepository; import com.poseidon.enums.CRUDViewEnum; import com.poseidon.mo...
package com.poseidon.controller; @Controller @RequestMapping("/admin") public class ContaController extends ControllerBase { public static final String ROLE_PREFIX = "ROLE_"; public static final String CONTAS_CLASS_NAME = "contas"; public static final String CONTA_VIEW_NAME = "Conta"; public static...
// Path: src/main/java/com/poseidon/builder/ContaViewBuilder.java // public class ContaViewBuilder { // // private ContaView myObject; // // public ContaViewBuilder(){ // myObject= new ContaView(); // } // // public ContaView build(){ // return myObject; // } // // public Con...
this.buildRedirectFlashAttributes(redirectAttributes, CRUDViewEnum.IS_SAVE);
tudoNoob/poseidon
src/main/java/com/poseidon/controller/ContaController.java
// Path: src/main/java/com/poseidon/builder/ContaViewBuilder.java // public class ContaViewBuilder { // // private ContaView myObject; // // public ContaViewBuilder(){ // myObject= new ContaView(); // } // // public ContaView build(){ // return myObject; // } // // public Con...
import com.google.common.collect.Lists; import com.poseidon.annotation.NotNullArgs; import com.poseidon.annotation.ViewName; import com.poseidon.builder.ContaViewBuilder; import com.poseidon.dao.AuthoritiesRepository; import com.poseidon.dao.UserRepository; import com.poseidon.enums.CRUDViewEnum; import com.poseidon.mo...
@RequestMapping(value = "/cadastrarConta") @ViewName(name = REDIRECT_ADMIN_CONTA) @NotNullArgs public ModelAndView cadastrarConta(@ModelAttribute ContaView contaView, @ModelAttribute String role, ModelAndView modelAndView, ...
// Path: src/main/java/com/poseidon/builder/ContaViewBuilder.java // public class ContaViewBuilder { // // private ContaView myObject; // // public ContaViewBuilder(){ // myObject= new ContaView(); // } // // public ContaView build(){ // return myObject; // } // // public Con...
contasView.add(new ContaViewBuilder()
tudoNoob/poseidon
src/main/java/com/poseidon/model/Consulta.java
// Path: src/main/java/com/poseidon/utils/PoseidonUtils.java // public class PoseidonUtils { // // private static final Logger LOGGER = LoggerFactory.getLogger(PoseidonUtils.class); // // public static java.sql.Date convertToDate(String toDate) { // // SimpleDateFormat format = new SimpleDateFormat("...
import com.poseidon.utils.PoseidonUtils; import javax.persistence.Entity; import javax.persistence.GeneratedValue; import javax.persistence.GenerationType; import javax.persistence.Id; import java.util.Date;
public void setId_paciente(Integer id_paciente) { this.id_paciente = id_paciente; } public Double getValor() { return valor; } public void setValor(Double valor) { this.valor = valor; } public Date getHorario_consulta() { return horario_consulta; } public Date getData_consulta() { return data_co...
// Path: src/main/java/com/poseidon/utils/PoseidonUtils.java // public class PoseidonUtils { // // private static final Logger LOGGER = LoggerFactory.getLogger(PoseidonUtils.class); // // public static java.sql.Date convertToDate(String toDate) { // // SimpleDateFormat format = new SimpleDateFormat("...
return PoseidonUtils.convertToDate(data_consulta);
tudoNoob/poseidon
src/main/java/com/poseidon/controller/ControllerBase.java
// Path: src/main/java/com/poseidon/enums/CRUDViewEnum.java // public enum CRUDViewEnum { // // IS_SAVE("isSave"), // IS_DELETE("isDelete"), // IS_UPDATE("isUpdate"), // IS_SEARCH("isSearch"); // // // // private String operation; // // CRUDViewEnum(String operation) { // this.operation...
import com.poseidon.enums.CRUDViewEnum; import com.poseidon.model.CRUDView; import org.springframework.web.servlet.mvc.support.RedirectAttributes; import java.lang.reflect.Field;
package com.poseidon.controller; public class ControllerBase { public static final String CRUDVIEW_CLASS_NAME = "crudview";
// Path: src/main/java/com/poseidon/enums/CRUDViewEnum.java // public enum CRUDViewEnum { // // IS_SAVE("isSave"), // IS_DELETE("isDelete"), // IS_UPDATE("isUpdate"), // IS_SEARCH("isSearch"); // // // // private String operation; // // CRUDViewEnum(String operation) { // this.operation...
protected RedirectAttributes buildRedirectFlashAttributes(RedirectAttributes redirectAttributes, CRUDViewEnum crudViewEnum) {
tudoNoob/poseidon
src/main/java/com/poseidon/controller/ControllerBase.java
// Path: src/main/java/com/poseidon/enums/CRUDViewEnum.java // public enum CRUDViewEnum { // // IS_SAVE("isSave"), // IS_DELETE("isDelete"), // IS_UPDATE("isUpdate"), // IS_SEARCH("isSearch"); // // // // private String operation; // // CRUDViewEnum(String operation) { // this.operation...
import com.poseidon.enums.CRUDViewEnum; import com.poseidon.model.CRUDView; import org.springframework.web.servlet.mvc.support.RedirectAttributes; import java.lang.reflect.Field;
package com.poseidon.controller; public class ControllerBase { public static final String CRUDVIEW_CLASS_NAME = "crudview"; protected RedirectAttributes buildRedirectFlashAttributes(RedirectAttributes redirectAttributes, CRUDViewEnum crudViewEnum) {
// Path: src/main/java/com/poseidon/enums/CRUDViewEnum.java // public enum CRUDViewEnum { // // IS_SAVE("isSave"), // IS_DELETE("isDelete"), // IS_UPDATE("isUpdate"), // IS_SEARCH("isSearch"); // // // // private String operation; // // CRUDViewEnum(String operation) { // this.operation...
Field[] fields = CRUDView.class.getDeclaredFields();
tudoNoob/poseidon
src/test/java/com/poseidon/controller/ControllerBaseTest.java
// Path: src/main/java/com/poseidon/enums/CRUDViewEnum.java // public enum CRUDViewEnum { // // IS_SAVE("isSave"), // IS_DELETE("isDelete"), // IS_UPDATE("isUpdate"), // IS_SEARCH("isSearch"); // // // // private String operation; // // CRUDViewEnum(String operation) { // this.operation...
import com.poseidon.enums.CRUDViewEnum; import com.poseidon.utils.RedirectAttributesMock; import org.springframework.web.servlet.mvc.support.RedirectAttributes; import org.testng.annotations.BeforeMethod; import org.testng.annotations.Test; import java.util.Map; import static org.testng.AssertJUnit.assertEquals; import...
package com.poseidon.controller; @Test public class ControllerBaseTest { private ControllerBase controllerBase; @BeforeMethod public void setUp(){ controllerBase= new ControllerBase(); } @Test public void shouldPutAllFalseExceptIsSave() {
// Path: src/main/java/com/poseidon/enums/CRUDViewEnum.java // public enum CRUDViewEnum { // // IS_SAVE("isSave"), // IS_DELETE("isDelete"), // IS_UPDATE("isUpdate"), // IS_SEARCH("isSearch"); // // // // private String operation; // // CRUDViewEnum(String operation) { // this.operation...
RedirectAttributes attributeRedirected = controllerBase.buildRedirectFlashAttributes(new RedirectAttributesMock(), CRUDViewEnum.IS_SAVE);
tudoNoob/poseidon
src/test/java/com/poseidon/controller/ControllerBaseTest.java
// Path: src/main/java/com/poseidon/enums/CRUDViewEnum.java // public enum CRUDViewEnum { // // IS_SAVE("isSave"), // IS_DELETE("isDelete"), // IS_UPDATE("isUpdate"), // IS_SEARCH("isSearch"); // // // // private String operation; // // CRUDViewEnum(String operation) { // this.operation...
import com.poseidon.enums.CRUDViewEnum; import com.poseidon.utils.RedirectAttributesMock; import org.springframework.web.servlet.mvc.support.RedirectAttributes; import org.testng.annotations.BeforeMethod; import org.testng.annotations.Test; import java.util.Map; import static org.testng.AssertJUnit.assertEquals; import...
package com.poseidon.controller; @Test public class ControllerBaseTest { private ControllerBase controllerBase; @BeforeMethod public void setUp(){ controllerBase= new ControllerBase(); } @Test public void shouldPutAllFalseExceptIsSave() {
// Path: src/main/java/com/poseidon/enums/CRUDViewEnum.java // public enum CRUDViewEnum { // // IS_SAVE("isSave"), // IS_DELETE("isDelete"), // IS_UPDATE("isUpdate"), // IS_SEARCH("isSearch"); // // // // private String operation; // // CRUDViewEnum(String operation) { // this.operation...
RedirectAttributes attributeRedirected = controllerBase.buildRedirectFlashAttributes(new RedirectAttributesMock(), CRUDViewEnum.IS_SAVE);
tudoNoob/poseidon
src/main/java/com/poseidon/advices/MetricAdvice.java
// Path: src/main/java/com/poseidon/model/AtributosClasse.java // public class AtributosClasse { // // private String metodoNome; // // private String argumentos; // // private String returnType; // // public static AtributosClasse builderAtributosClasse(JoinPoint joinPoint) { // AtributosClasse atributosClas...
import com.poseidon.model.AtributosClasse; import org.aspectj.lang.JoinPoint; import org.aspectj.lang.annotation.After; import org.aspectj.lang.annotation.Aspect; import org.aspectj.lang.annotation.Before; import org.joda.time.DateTime; import org.slf4j.Logger; import org.springframework.beans.factory.annotation.Autowi...
package com.poseidon.advices; @Component @Aspect public class MetricAdvice { private DateTime beforeMethodExecution=null; private DateTime afterMethodExecution=null; @Autowired private LogAspects logAspects; @Before("execution(* com.poseidon.*..*(..))") public void createTimeBeforeMethodExecution(JoinPo...
// Path: src/main/java/com/poseidon/model/AtributosClasse.java // public class AtributosClasse { // // private String metodoNome; // // private String argumentos; // // private String returnType; // // public static AtributosClasse builderAtributosClasse(JoinPoint joinPoint) { // AtributosClasse atributosClas...
AtributosClasse atributosClasse = AtributosClasse.builderAtributosClasse(joinPoint);
tudoNoob/poseidon
src/main/java/com/poseidon/controller/LoginController.java
// Path: src/main/java/com/poseidon/model/ContaView.java // public class ContaView { // private String username; // // private String password; // // private String role; // // public ContaView() { // } // // public static ContaView buildContaView(Users user){ // ContaView view = new ContaView(); // vie...
import com.poseidon.annotation.ViewName; import com.poseidon.model.ContaView; import org.springframework.stereotype.Controller; import org.springframework.web.bind.annotation.RequestMapping; import org.springframework.web.servlet.ModelAndView;
package com.poseidon.controller; @Controller public class LoginController { @RequestMapping("/loginPage") @ViewName(name="login") public ModelAndView buildLoginPage(ModelAndView modelAndView){
// Path: src/main/java/com/poseidon/model/ContaView.java // public class ContaView { // private String username; // // private String password; // // private String role; // // public ContaView() { // } // // public static ContaView buildContaView(Users user){ // ContaView view = new ContaView(); // vie...
modelAndView.getModelMap().addAttribute("user", new ContaView());
tudoNoob/poseidon
src/main/java/com/poseidon/builder/ContaViewBuilder.java
// Path: src/main/java/com/poseidon/model/ContaView.java // public class ContaView { // private String username; // // private String password; // // private String role; // // public ContaView() { // } // // public static ContaView buildContaView(Users user){ // ContaView view = new ContaView(); // vie...
import com.poseidon.model.ContaView; import com.poseidon.model.Users;
package com.poseidon.builder; /** * Created by wahrons on 2/5/16. */ public class ContaViewBuilder { private ContaView myObject; public ContaViewBuilder(){ myObject= new ContaView(); } public ContaView build(){ return myObject; }
// Path: src/main/java/com/poseidon/model/ContaView.java // public class ContaView { // private String username; // // private String password; // // private String role; // // public ContaView() { // } // // public static ContaView buildContaView(Users user){ // ContaView view = new ContaView(); // vie...
public ContaViewBuilder convertUsersThroughContaView(Users users){
tudoNoob/poseidon
src/main/java/com/poseidon/controller/ConsultaController.java
// Path: src/main/java/com/poseidon/dao/ConsultaDao.java // @Repository // @Qualifier() // public interface ConsultaDao extends CrudRepository<Consulta, Integer> { // // } // // Path: src/main/java/com/poseidon/model/Consulta.java // @Entity // public class Consulta { // // @Id // @GeneratedValue(strategy = Ge...
import com.poseidon.annotation.NotNullArgs; import com.poseidon.annotation.ViewName; import com.poseidon.dao.ConsultaDao; import com.poseidon.model.Consulta; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Controller; import org.springframework.web.bind.annotation.Mo...
package com.poseidon.controller; @Controller public class ConsultaController { @Autowired
// Path: src/main/java/com/poseidon/dao/ConsultaDao.java // @Repository // @Qualifier() // public interface ConsultaDao extends CrudRepository<Consulta, Integer> { // // } // // Path: src/main/java/com/poseidon/model/Consulta.java // @Entity // public class Consulta { // // @Id // @GeneratedValue(strategy = Ge...
private ConsultaDao consultaRepository;
tudoNoob/poseidon
src/main/java/com/poseidon/controller/ConsultaController.java
// Path: src/main/java/com/poseidon/dao/ConsultaDao.java // @Repository // @Qualifier() // public interface ConsultaDao extends CrudRepository<Consulta, Integer> { // // } // // Path: src/main/java/com/poseidon/model/Consulta.java // @Entity // public class Consulta { // // @Id // @GeneratedValue(strategy = Ge...
import com.poseidon.annotation.NotNullArgs; import com.poseidon.annotation.ViewName; import com.poseidon.dao.ConsultaDao; import com.poseidon.model.Consulta; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Controller; import org.springframework.web.bind.annotation.Mo...
package com.poseidon.controller; @Controller public class ConsultaController { @Autowired private ConsultaDao consultaRepository; private static Logger logger = Logger.getLogger("ConsultaController"); @RequestMapping("/consulta")
// Path: src/main/java/com/poseidon/dao/ConsultaDao.java // @Repository // @Qualifier() // public interface ConsultaDao extends CrudRepository<Consulta, Integer> { // // } // // Path: src/main/java/com/poseidon/model/Consulta.java // @Entity // public class Consulta { // // @Id // @GeneratedValue(strategy = Ge...
@ViewName(name = "Consulta")
tudoNoob/poseidon
src/main/java/com/poseidon/advices/ViewNameProcessAdvice.java
// Path: src/main/java/com/poseidon/exception/ViewNameException.java // public class ViewNameException extends PoseidonException { // // public ViewNameException(String message) { // super(message); // // } // // // }
import com.poseidon.annotation.ViewName; import com.poseidon.exception.ViewNameException; import org.aspectj.lang.JoinPoint; import org.aspectj.lang.annotation.AfterReturning; import org.aspectj.lang.annotation.Aspect; import org.aspectj.lang.reflect.MethodSignature; import org.springframework.stereotype.Component; imp...
package com.poseidon.advices; /** * Esta classe ira processar a annotation ViewName. * @author ahrons * */ @Component @Aspect public class ViewNameProcessAdvice { @AfterReturning(pointcut = "execution(* com.poseidon.*.*Controller..*(..)))", returning = "result") public void processViewName(JoinPoint joinPoint,...
// Path: src/main/java/com/poseidon/exception/ViewNameException.java // public class ViewNameException extends PoseidonException { // // public ViewNameException(String message) { // super(message); // // } // // // } // Path: src/main/java/com/poseidon/advices/ViewNameProcessAdvice.java import com.poseidon....
throw new ViewNameException("Para usar a annotation @ViewName é preciso que o metodo retorne ModelAndView.");
tudoNoob/poseidon
src/main/java/com/poseidon/controller/QuiropraxistaController.java
// Path: src/main/java/com/poseidon/dao/QuiropraxistaDao.java // @Repository // @Qualifier() // public interface QuiropraxistaDao extends CrudRepository<Quiropraxista, Integer>{ // public Quiropraxista findByNome(String nome); // public Quiropraxista findById(Integer id); // } // // Path: src/main/java/com/poseidon/...
import com.poseidon.annotation.NotNullArgs; import com.poseidon.annotation.ViewName; import com.poseidon.dao.QuiropraxistaDao; import com.poseidon.enums.CRUDViewEnum; import com.poseidon.model.CRUDView; import com.poseidon.model.Quiropraxista; import org.springframework.beans.factory.annotation.Autowired; import org.sp...
package com.poseidon.controller; @Controller @RequestMapping("/admin") public class QuiropraxistaController extends ControllerBase { public static final String REDIRECT_ADMIN_QUIROPRAXISTA = "redirect:/admin/quiropraxista";
// Path: src/main/java/com/poseidon/dao/QuiropraxistaDao.java // @Repository // @Qualifier() // public interface QuiropraxistaDao extends CrudRepository<Quiropraxista, Integer>{ // public Quiropraxista findByNome(String nome); // public Quiropraxista findById(Integer id); // } // // Path: src/main/java/com/poseidon/...
public static final String QUIROPRAXISTA_VIEW_NAME = "Quiropraxista";
tudoNoob/poseidon
src/main/java/com/poseidon/controller/QuiropraxistaController.java
// Path: src/main/java/com/poseidon/dao/QuiropraxistaDao.java // @Repository // @Qualifier() // public interface QuiropraxistaDao extends CrudRepository<Quiropraxista, Integer>{ // public Quiropraxista findByNome(String nome); // public Quiropraxista findById(Integer id); // } // // Path: src/main/java/com/poseidon/...
import com.poseidon.annotation.NotNullArgs; import com.poseidon.annotation.ViewName; import com.poseidon.dao.QuiropraxistaDao; import com.poseidon.enums.CRUDViewEnum; import com.poseidon.model.CRUDView; import com.poseidon.model.Quiropraxista; import org.springframework.beans.factory.annotation.Autowired; import org.sp...
package com.poseidon.controller; @Controller @RequestMapping("/admin") public class QuiropraxistaController extends ControllerBase { public static final String REDIRECT_ADMIN_QUIROPRAXISTA = "redirect:/admin/quiropraxista"; public static final String QUIROPRAXISTA_VIEW_NAME = "Quiropraxista"; @Autowired
// Path: src/main/java/com/poseidon/dao/QuiropraxistaDao.java // @Repository // @Qualifier() // public interface QuiropraxistaDao extends CrudRepository<Quiropraxista, Integer>{ // public Quiropraxista findByNome(String nome); // public Quiropraxista findById(Integer id); // } // // Path: src/main/java/com/poseidon/...
QuiropraxistaDao quiropraxistaRepository;