Skip to content

Commit 39aedfa

Browse files
committed
base files
1 parent 8b8977d commit 39aedfa

File tree

1,486 files changed

+66262
-2
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

1,486 files changed

+66262
-2
lines changed

.gitignore

Lines changed: 241 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,241 @@
1+
2+
# Created by https://www.gitignore.io/api/java,macos,maven,eclipse,netbeans,intellij,visualstudiocode
3+
# Edit at https://www.gitignore.io/?templates=java,macos,maven,eclipse,netbeans,intellij,visualstudiocode
4+
5+
### Eclipse ###
6+
.metadata
7+
bin/
8+
tmp/
9+
*.tmp
10+
*.bak
11+
*.swp
12+
*~.nib
13+
local.properties
14+
.settings/
15+
.loadpath
16+
.recommenders
17+
18+
# External tool builders
19+
.externalToolBuilders/
20+
21+
# Locally stored "Eclipse launch configurations"
22+
*.launch
23+
24+
# PyDev specific (Python IDE for Eclipse)
25+
*.pydevproject
26+
27+
# CDT-specific (C/C++ Development Tooling)
28+
.cproject
29+
30+
# CDT- autotools
31+
.autotools
32+
33+
# Java annotation processor (APT)
34+
.factorypath
35+
36+
# PDT-specific (PHP Development Tools)
37+
.buildpath
38+
39+
# sbteclipse plugin
40+
.target
41+
42+
# Tern plugin
43+
.tern-project
44+
45+
# TeXlipse plugin
46+
.texlipse
47+
48+
# STS (Spring Tool Suite)
49+
.springBeans
50+
51+
# Code Recommenders
52+
.recommenders/
53+
54+
# Annotation Processing
55+
.apt_generated/
56+
57+
# Scala IDE specific (Scala & Java development for Eclipse)
58+
.cache-main
59+
.scala_dependencies
60+
.worksheet
61+
62+
### Eclipse Patch ###
63+
# Eclipse Core
64+
.project
65+
66+
# JDT-specific (Eclipse Java Development Tools)
67+
.classpath
68+
69+
# Annotation Processing
70+
.apt_generated
71+
72+
.sts4-cache/
73+
74+
### Intellij ###
75+
# Covers JetBrains IDEs: IntelliJ, RubyMine, PhpStorm, AppCode, PyCharm, CLion, Android Studio and WebStorm
76+
# Reference: https://intellij-support.jetbrains.com/hc/en-us/articles/206544839
77+
78+
# User-specific stuff
79+
.idea/**/workspace.xml
80+
.idea/**/tasks.xml
81+
.idea/**/usage.statistics.xml
82+
.idea/**/dictionaries
83+
.idea/**/shelf
84+
85+
# Generated files
86+
.idea/**/contentModel.xml
87+
88+
# Sensitive or high-churn files
89+
.idea/**/dataSources/
90+
.idea/**/dataSources.ids
91+
.idea/**/dataSources.local.xml
92+
.idea/**/sqlDataSources.xml
93+
.idea/**/dynamic.xml
94+
.idea/**/uiDesigner.xml
95+
.idea/**/dbnavigator.xml
96+
97+
# Gradle
98+
.idea/**/gradle.xml
99+
.idea/**/libraries
100+
101+
# Gradle and Maven with auto-import
102+
# When using Gradle or Maven with auto-import, you should exclude module files,
103+
# since they will be recreated, and may cause churn. Uncomment if using
104+
# auto-import.
105+
# .idea/modules.xml
106+
# .idea/*.iml
107+
# .idea/modules
108+
# *.iml
109+
# *.ipr
110+
111+
# CMake
112+
cmake-build-*/
113+
114+
# Mongo Explorer plugin
115+
.idea/**/mongoSettings.xml
116+
117+
# File-based project format
118+
*.iws
119+
120+
# IntelliJ
121+
out/
122+
123+
# mpeltonen/sbt-idea plugin
124+
.idea_modules/
125+
126+
# JIRA plugin
127+
atlassian-ide-plugin.xml
128+
129+
# Cursive Clojure plugin
130+
.idea/replstate.xml
131+
132+
# Crashlytics plugin (for Android Studio and IntelliJ)
133+
com_crashlytics_export_strings.xml
134+
crashlytics.properties
135+
crashlytics-build.properties
136+
fabric.properties
137+
138+
# Editor-based Rest Client
139+
.idea/httpRequests
140+
141+
# Android studio 3.1+ serialized cache file
142+
.idea/caches/build_file_checksums.ser
143+
144+
### Intellij Patch ###
145+
# Comment Reason: https://github.com/joeblau/gitignore.io/issues/186#issuecomment-215987721
146+
147+
# *.iml
148+
# modules.xml
149+
# .idea/misc.xml
150+
# *.ipr
151+
152+
# Sonarlint plugin
153+
.idea/sonarlint
154+
155+
### Java ###
156+
# Compiled class file
157+
*.class
158+
159+
# Log file
160+
*.log
161+
162+
# BlueJ files
163+
*.ctxt
164+
165+
# Mobile Tools for Java (J2ME)
166+
.mtj.tmp/
167+
168+
# Package Files #
169+
*.jar
170+
*.war
171+
*.nar
172+
*.ear
173+
*.zip
174+
*.tar.gz
175+
*.rar
176+
177+
# virtual machine crash logs, see http://www.java.com/en/download/help/error_hotspot.xml
178+
hs_err_pid*
179+
180+
### macOS ###
181+
# General
182+
.DS_Store
183+
.AppleDouble
184+
.LSOverride
185+
186+
# Icon must end with two \r
187+
Icon
188+
189+
# Thumbnails
190+
._*
191+
192+
# Files that might appear in the root of a volume
193+
.DocumentRevisions-V100
194+
.fseventsd
195+
.Spotlight-V100
196+
.TemporaryItems
197+
.Trashes
198+
.VolumeIcon.icns
199+
.com.apple.timemachine.donotpresent
200+
201+
# Directories potentially created on remote AFP share
202+
.AppleDB
203+
.AppleDesktop
204+
Network Trash Folder
205+
Temporary Items
206+
.apdisk
207+
208+
### Maven ###
209+
target/
210+
pom.xml.tag
211+
pom.xml.releaseBackup
212+
pom.xml.versionsBackup
213+
pom.xml.next
214+
release.properties
215+
dependency-reduced-pom.xml
216+
buildNumber.properties
217+
.mvn/timing.properties
218+
.mvn/wrapper/maven-wrapper.jar
219+
220+
### NetBeans ###
221+
**/nbproject/private/
222+
**/nbproject/Makefile-*.mk
223+
**/nbproject/Package-*.bash
224+
build/
225+
nbbuild/
226+
dist/
227+
nbdist/
228+
.nb-gradle/
229+
230+
### VisualStudioCode ###
231+
.vscode/*
232+
!.vscode/settings.json
233+
!.vscode/tasks.json
234+
!.vscode/launch.json
235+
!.vscode/extensions.json
236+
237+
### VisualStudioCode Patch ###
238+
# Ignore all local history of files
239+
.history
240+
241+
# End of https://www.gitignore.io/api/java,macos,maven,eclipse,netbeans,intellij,visualstudiocode
Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
package com.luv2code.springdemo;
2+
3+
public class BaseballCoach implements Coach {
4+
5+
@Override
6+
public String getDailyWorkout() {
7+
return "Spend 30 minutes on batting practice";
8+
}
9+
10+
}
11+
12+
13+
14+
15+
16+
17+
18+
Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
package com.luv2code.springdemo;
2+
3+
public interface Coach {
4+
5+
public String getDailyWorkout();
6+
7+
}
Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
package com.luv2code.springdemo;
2+
3+
public class MyApp {
4+
5+
public static void main(String[] args) {
6+
7+
// create the object
8+
// Coach theCoach = new BaseballCoach();
9+
Coach theCoach = new TrackCoach();
10+
11+
// use the object
12+
System.out.println(theCoach.getDailyWorkout());
13+
}
14+
15+
}
Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
package com.luv2code.springdemo;
2+
3+
public class TrackCoach implements Coach {
4+
5+
@Override
6+
public String getDailyWorkout() {
7+
return "Run a hard 5k";
8+
}
9+
10+
}
11+
12+
13+
14+
15+
16+
17+
18+
19+
20+
Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
<?xml version="1.0" encoding="UTF-8"?>
2+
<beans xmlns="http://www.springframework.org/schema/beans"
3+
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
4+
xmlns:context="http://www.springframework.org/schema/context"
5+
xsi:schemaLocation="http://www.springframework.org/schema/beans
6+
http://www.springframework.org/schema/beans/spring-beans.xsd
7+
http://www.springframework.org/schema/context
8+
http://www.springframework.org/schema/context/spring-context.xsd">
9+
10+
<!-- add entry to enable component scanning -->
11+
12+
<context:component-scan base-package="com.luv2code.springdemo" />
13+
14+
</beans>
15+
16+
17+
18+
19+
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,40 @@
1+
package com.luv2code.springdemo;
2+
3+
import org.springframework.context.support.ClassPathXmlApplicationContext;
4+
5+
public class AnnotationBeanScopeDemoApp {
6+
7+
public static void main(String[] args) {
8+
9+
// load spring config file
10+
ClassPathXmlApplicationContext context = new
11+
ClassPathXmlApplicationContext("applicationContext.xml");
12+
13+
// retrieve bean from spring container
14+
Coach theCoach = context.getBean("tennisCoach", Coach.class);
15+
16+
Coach alphaCoach = context.getBean("tennisCoach", Coach.class);
17+
18+
// check if they are the same
19+
boolean result = (theCoach == alphaCoach);
20+
21+
// print out the results
22+
System.out.println("\nPointing to the same object: " + result);
23+
24+
System.out.println("\nMemory location for theCoach: " + theCoach);
25+
26+
System.out.println("\nMemory location for alphaCoach: " + alphaCoach + "\n");
27+
28+
// close the context
29+
context.close();
30+
}
31+
32+
}
33+
34+
35+
36+
37+
38+
39+
40+
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
package com.luv2code.springdemo;
2+
3+
import org.springframework.context.support.ClassPathXmlApplicationContext;
4+
5+
public class AnnotationDemoApp {
6+
7+
public static void main(String[] args) {
8+
9+
// read spring config file
10+
ClassPathXmlApplicationContext context =
11+
new ClassPathXmlApplicationContext("applicationContext.xml");
12+
13+
// get the bean from spring container
14+
Coach theCoach = context.getBean("tennisCoach", Coach.class);
15+
16+
// call a method on the bean
17+
System.out.println(theCoach.getDailyWorkout());
18+
19+
// call method to get daily fortune
20+
System.out.println(theCoach.getDailyFortune());
21+
22+
// close the context
23+
context.close();
24+
}
25+
26+
}
27+
28+

0 commit comments

Comments
 (0)