This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package com.morgan.design.demo; | |
import org.springframework.stereotype.Component; | |
import com.morgan.design.demo.annotation.LogMe; | |
import com.morgan.design.demo.annotation.LoggingLevel; | |
@Component | |
public class LoggingExample { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@Aspect | |
public class LoggingAspect { | |
private ILoggerFactory iLoggerFactory = LoggerFactory.getILoggerFactory(); | |
@Before("execution(@com.morgan.design.demo.annotation.LogMe(com.morgan.design.demo.annotation.LoggingLevel.WARN) * *(..))") | |
public void loggerWarn(final JoinPoint jp) throws Throwable { | |
final Logger logger = getLoggerForClass(jp); | |
logger.warn(buildLogging(jp)); | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
PushbuttonField barcodeButton = acroFields.getNewPushbuttonFromField("barcode_button"); | |
if(barcodeButton){ | |
// These settings are optional, null can be passed in as the four argument to BarcodeQRCode | |
Map<EncodeHintType, Object> hints = Maps.newHashMap(); | |
hints.put(EncodeHintType.ERROR_CORRECTION, ErrorCorrectionLevel.L); | |
hints.put(EncodeHintType.CHARACTER_SET, "ISO-8859-1"); | |
BarcodeQRCode qrcode = new BarcodeQRCode("SomeBarcodeData_123456789", 0, 0, hints); | |
barcodeButton.setLayout(PushbuttonField.LAYOUT_ICON_ONLY); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
* An expected call to my matcher | |
*/ | |
this.context.checking(new Expectations() { | |
{ | |
one(someMockedService).save(with(args), with(def), with(thisObjectArray(batch))); | |
} | |
}); | |
this.seviceUnderTest.source(args); | |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import org.apache.activemq.camel.component.ActiveMQComponent | |
import org.apache.camel.CamelContext | |
import org.apache.camel.builder.RouteBuilder | |
import org.apache.camel.impl.DefaultCamelContext | |
class CopyFromOneServerToAnother extends RouteBuilder{ | |
public static void main(String[] args) { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
String rawSql = new AlterTableBuild() | |
.alterTable(Person.class) | |
.addColumn(Person.FOO_ID) | |
.after(Person.NAME) | |
.migrate() | |
.from("old_column") | |
.to(Person.FOO_ID) | |
.build(); | |
this.db.executeRaw(rawSql); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
* This is called when your application is upgraded and it has a higher version number. This allows you to adjust the various data to | |
* match the new version number. | |
*/ | |
@Override | |
public void onUpgrade(final SQLiteDatabase db, final ConnectionSource connectionSource, int oldVersion, final int newVersion) { | |
Logger.i(LOG_TAG, "onUpgrade, oldVersion=[%s], newVersion=[%s]", oldVersion, newVersion); | |
try { | |
// Simply loop round until newest version has been reached and add the appropriate migration | |
while (++oldVersion <= newVersion) { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
* Used as a aid in the migration process for, loading required SQL files as specified by a given version | |
* | |
* @author James Edward Morgan | |
*/ | |
public class UpgradeHelper { | |
private static final String LOG_TAG = "UpgradeHelper"; | |
protected static final Set<Integer> VERSION; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package com.morgan.design; | |
public class TODO { | |
private TODO() { | |
} | |
//@formatter:off | |
// //////////////////////// | |
// Build / Configuration // |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public class DynamicAssetsLoader { | |
public static function loadImage(image:Image, assetUri:String):void | |
{ | |
// if not | |
if(!assetUri){ | |
image.includeInLayout = false; | |
image.visible = false; | |
image.source = null; | |
return; |
OlderNewer