Skip to content

Commit

Permalink
Merge pull request #242 from ecurtin/seriousDocumentation
Browse files Browse the repository at this point in the history
Serious Documentation
  • Loading branch information
Mikkeren authored Dec 18, 2019
2 parents cdfac75 + c615ac6 commit 4922c07
Show file tree
Hide file tree
Showing 89 changed files with 745 additions and 16 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -5,17 +5,26 @@
import org.springframework.context.ApplicationContextAware;
import org.springframework.stereotype.Service;

/**
* Holder for Application Context
*/
@Service
public class ApplicationContextHolder implements ApplicationContextAware {

private static ApplicationContext applicationContext;

/**
* Updater for ApplicationContextReference
*/
private static class ApplicationContextReferenceUpdater {
void updateApplicationContextReference(final ApplicationContext applicationContext) {
ApplicationContextHolder.applicationContext = applicationContext;
}
}

/**
* Holder for ApplicationContextReferenceUpdater
*/
private static class ApplicationContextReferenceUpdaterHolder {
static ApplicationContextReferenceUpdater INSTANCE = new ApplicationContextReferenceUpdater();
}
Expand All @@ -24,11 +33,18 @@ private ApplicationContextHolder() {
super();
}

/**
* @param applicationContext
* @throws BeansException
*/
@Override
public void setApplicationContext(final ApplicationContext applicationContext) throws BeansException {
ApplicationContextReferenceUpdaterHolder.INSTANCE.updateApplicationContextReference(applicationContext);
}

/**
* @return
*/
public static ApplicationContext getApplicationContext() {
return ApplicationContextHolder.applicationContext;
}
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,8 @@
package com.seriouscompany.business.java.fizzbuzz.packagenamingpackage.impl;

/**
* Constants
*/
public class Constants {

public static final String AN_ATTEMPT_WAS_MADE_TO_DIVIDE_BY_ZERO = "An attempt was made to divide by zero.";
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,14 @@
import com.seriouscompany.business.java.fizzbuzz.packagenamingpackage.interfaces.FizzBuzz;
import com.seriouscompany.business.java.fizzbuzz.packagenamingpackage.interfaces.parameters.FizzBuzzUpperLimitParameter;

/**
* Main
*/
public final class Main {

/**
* @param args
*/
public static void main(final String[] args) {
final ApplicationContext context = new ClassPathXmlApplicationContext(Constants.SPRING_XML);
final FizzBuzz myFizzBuzz = (FizzBuzz) context.getBean(Constants.STANDARD_FIZZ_BUZZ);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,17 +7,26 @@
import com.seriouscompany.business.java.fizzbuzz.packagenamingpackage.interfaces.factories.FizzBuzzSolutionStrategyFactory;
import com.seriouscompany.business.java.fizzbuzz.packagenamingpackage.interfaces.strategies.FizzBuzzSolutionStrategy;

/**
* Standard FizzBuzz
*/
@Service
public class StandardFizzBuzz implements FizzBuzz {

private final FizzBuzzSolutionStrategyFactory _fizzBuzzSolutionStrategyFactory;

/**
* @param _fizzBuzzSolutionStrategyFactory
*/
@Autowired
public StandardFizzBuzz(final FizzBuzzSolutionStrategyFactory _fizzBuzzSolutionStrategyFactory) {
super();
this._fizzBuzzSolutionStrategyFactory = _fizzBuzzSolutionStrategyFactory;
}

/**
* @param nFizzBuzzUpperLimit
*/
public void fizzBuzz(final int nFizzBuzzUpperLimit) {
final FizzBuzzSolutionStrategy mySolutionStrategy =
this._fizzBuzzSolutionStrategyFactory.createFizzBuzzSolutionStrategy();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,17 +7,26 @@
import com.seriouscompany.business.java.fizzbuzz.packagenamingpackage.interfaces.factories.IsEvenlyDivisibleStrategyFactory;
import com.seriouscompany.business.java.fizzbuzz.packagenamingpackage.interfaces.strategies.IsEvenlyDivisibleStrategy;

/**
* Factory for BuzzStrategy
*/
@Service
public class BuzzStrategyFactory implements IsEvenlyDivisibleStrategyFactory {

private final BuzzStrategy _buzzStrategy;

/**
* @param _buzzStrategy BuzzStrategy
*/
@Autowired
public BuzzStrategyFactory(final BuzzStrategy _buzzStrategy) {
super();
this._buzzStrategy = _buzzStrategy;
}

/**
* @return void
*/
@Override
public IsEvenlyDivisibleStrategy createIsEvenlyDivisibleStrategy() {
return this._buzzStrategy;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,17 +7,26 @@
import com.seriouscompany.business.java.fizzbuzz.packagenamingpackage.interfaces.factories.StringPrinterFactory;
import com.seriouscompany.business.java.fizzbuzz.packagenamingpackage.interfaces.printers.StringPrinter;

/**
* Factory for BuzzStringPrinter
*/
@Service
public class BuzzStringPrinterFactory implements StringPrinterFactory {

private final BuzzStringPrinter _buzzStringPrinter;

/**
* @param _buzzStringPrinter BuzzStringPrinter
*/
@Autowired
public BuzzStringPrinterFactory(final BuzzStringPrinter _buzzStringPrinter) {
super();
this._buzzStringPrinter = _buzzStringPrinter;
}

/**
* @return StringPrinter
*/
@Override
public StringPrinter createStringPrinter() {
return this._buzzStringPrinter;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,17 +7,26 @@
import com.seriouscompany.business.java.fizzbuzz.packagenamingpackage.interfaces.factories.StringStringReturnerFactory;
import com.seriouscompany.business.java.fizzbuzz.packagenamingpackage.interfaces.stringreturners.StringStringReturner;

/**
* Factory for BuzzStringReturner
*/
@Service
public class BuzzStringReturnerFactory implements StringStringReturnerFactory {

private final BuzzStringReturner _myBuzzStringReturner;

/**
* @param _myBuzzStringReturner BuzzStringReturner
*/
@Autowired
public BuzzStringReturnerFactory(final BuzzStringReturner _myBuzzStringReturner) {
super();
this._myBuzzStringReturner = _myBuzzStringReturner;
}

/**
* @return StringStringReturner
*/
@Override
public StringStringReturner createStringStringReturner() {
return this._myBuzzStringReturner;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,17 +6,26 @@
import com.seriouscompany.business.java.fizzbuzz.packagenamingpackage.interfaces.factories.FizzBuzzSolutionStrategyFactory;
import com.seriouscompany.business.java.fizzbuzz.packagenamingpackage.interfaces.strategies.FizzBuzzSolutionStrategy;

/**
* Factory for EnterpriseGradeFizzBuzzSolutionStrategy
*/
@Service
public class EnterpriseGradeFizzBuzzSolutionStrategyFactory implements FizzBuzzSolutionStrategyFactory {

private final FizzBuzzSolutionStrategy _fizzBuzzSolutionStrategy;

/**
* @param _fizzBuzzSolutionStrategy FizzBuzzSolutionStrategy
*/
@Autowired
public EnterpriseGradeFizzBuzzSolutionStrategyFactory(final FizzBuzzSolutionStrategy _fizzBuzzSolutionStrategy) {
super();
this._fizzBuzzSolutionStrategy = _fizzBuzzSolutionStrategy;
}

/**
* @return FizzBuzzSolutionStrategy
*/
@Override
public FizzBuzzSolutionStrategy createFizzBuzzSolutionStrategy() {
return this._fizzBuzzSolutionStrategy;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,19 +7,28 @@
import com.seriouscompany.business.java.fizzbuzz.packagenamingpackage.interfaces.factories.OutputGenerationContextVisitorFactory;
import com.seriouscompany.business.java.fizzbuzz.packagenamingpackage.interfaces.visitors.OutputGenerationContextVisitor;

/**
* Factory for FizzBuzzOutputGenerationContextVisitor
*/
@Service
public class FizzBuzzOutputGenerationContextVisitorFactory implements
OutputGenerationContextVisitorFactory {

private final FizzBuzzOutputGenerationContextVisitor _fizzBuzzOutputGenerationContextVisitor;

/**
* @param _fizzBuzzOutputGenerationContextVisitor FizzBuzzOutputGenerationContextVisitor
*/
@Autowired
public FizzBuzzOutputGenerationContextVisitorFactory(
final FizzBuzzOutputGenerationContextVisitor _fizzBuzzOutputGenerationContextVisitor) {
super();
this._fizzBuzzOutputGenerationContextVisitor = _fizzBuzzOutputGenerationContextVisitor;
}

/**
* @return OutputGenerationContextVisitor
*/
@Override
public OutputGenerationContextVisitor createVisitor() {
return this._fizzBuzzOutputGenerationContextVisitor;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,18 +7,27 @@
import com.seriouscompany.business.java.fizzbuzz.packagenamingpackage.interfaces.factories.IsEvenlyDivisibleStrategyFactory;
import com.seriouscompany.business.java.fizzbuzz.packagenamingpackage.interfaces.strategies.IsEvenlyDivisibleStrategy;

/**
* Factory for FizzStrategy
*/
@Service
public class FizzStrategyFactory implements IsEvenlyDivisibleStrategyFactory {

private final FizzStrategy _fizzStrategy;

@Autowired
public FizzStrategyFactory(final FizzStrategy _fizzStrategy) {
/**
* @param _fizzStrategy FizzStrategy
*/
@Autowired
public FizzStrategyFactory(final FizzStrategy _fizzStrategy) {
super();
this._fizzStrategy = _fizzStrategy;
}

@Override
/**
* @return IsEvenlyDivisibleStrategy
*/
@Override
public IsEvenlyDivisibleStrategy createIsEvenlyDivisibleStrategy() {
return this._fizzStrategy;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,17 +7,26 @@
import com.seriouscompany.business.java.fizzbuzz.packagenamingpackage.interfaces.factories.StringPrinterFactory;
import com.seriouscompany.business.java.fizzbuzz.packagenamingpackage.interfaces.printers.StringPrinter;

/**
* Factory for FizzStringPrinter
*/
@Service
public class FizzStringPrinterFactory implements StringPrinterFactory {

private final FizzStringPrinter _fizzStringPrinter;

/**
* @param _fizzStringPrinter FizzStringPrinter
*/
@Autowired
public FizzStringPrinterFactory(final FizzStringPrinter _fizzStringPrinter) {
super();
this._fizzStringPrinter = _fizzStringPrinter;
}

/**
* @return StringPrinter
*/
@Override
public StringPrinter createStringPrinter() {
return this._fizzStringPrinter;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,17 +7,26 @@
import com.seriouscompany.business.java.fizzbuzz.packagenamingpackage.interfaces.factories.StringStringReturnerFactory;
import com.seriouscompany.business.java.fizzbuzz.packagenamingpackage.interfaces.stringreturners.StringStringReturner;

/**
* Factory for FizzStringReturner
*/
@Service
public class FizzStringReturnerFactory implements StringStringReturnerFactory {

private final FizzStringReturner _fizzStringReturner;

/**
* @param _fizzStringReturner FizzStringReturner
*/
@Autowired
public FizzStringReturnerFactory(final FizzStringReturner _fizzStringReturner) {
super();
this._fizzStringReturner = _fizzStringReturner;
}

/**
* @return StringStringReturner
*/
@Override
public StringStringReturner createStringStringReturner() {
return this._fizzStringReturner;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,17 +7,26 @@
import com.seriouscompany.business.java.fizzbuzz.packagenamingpackage.interfaces.factories.IntegerPrinterFactory;
import com.seriouscompany.business.java.fizzbuzz.packagenamingpackage.interfaces.printers.IntegerPrinter;

/**
* Factory for IntegerIntegerPrinterFactory
*/
@Service
public class IntegerIntegerPrinterFactory implements IntegerPrinterFactory {

private final IntegerIntegerPrinter _integerIntegerPrinter;

/**
* @param _integerIntegerPrinter IntegerIntegerPrinter
*/
@Autowired
public IntegerIntegerPrinterFactory(final IntegerIntegerPrinter _integerIntegerPrinter) {
super();
this._integerIntegerPrinter = _integerIntegerPrinter;
}

/**
* @return IntegerPrinter
*/
@Override
public IntegerPrinter createPrinter() {
return this._integerIntegerPrinter;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,18 +7,27 @@
import com.seriouscompany.business.java.fizzbuzz.packagenamingpackage.interfaces.factories.IntegerStringReturnerFactory;
import com.seriouscompany.business.java.fizzbuzz.packagenamingpackage.interfaces.stringreturners.IntegerStringReturner;

/**
* Factory for IntegerIntegerStringReturner
*/
@Service
public class IntegerIntegerStringReturnerFactory implements
IntegerStringReturnerFactory {

private final IntegerIntegerStringReturner _integerIntegerStringReturner;

/**
* @param _integerIntegerStringReturner IntegerIntegerStringReturner
*/
@Autowired
public IntegerIntegerStringReturnerFactory(final IntegerIntegerStringReturner _integerIntegerStringReturner) {
super();
this._integerIntegerStringReturner = _integerIntegerStringReturner;
}

/**
* @return IntegerStringReturner
*/
@Override
public IntegerStringReturner createIntegerStringReturner() {
return this._integerIntegerStringReturner;
Expand Down
Loading

0 comments on commit 4922c07

Please sign in to comment.