diff --git a/Elk-ioc b/Elk-ioc
deleted file mode 160000
index 32d3cbf..0000000
--- a/Elk-ioc
+++ /dev/null
@@ -1 +0,0 @@
-Subproject commit 32d3cbf057c7c05133e1533497e24b22aaa29927
diff --git a/Elk-ioc/.gitignore b/Elk-ioc/.gitignore
new file mode 100644
index 0000000..4a6573f
--- /dev/null
+++ b/Elk-ioc/.gitignore
@@ -0,0 +1,3 @@
+.idea
+Elk-ioc.iml
+target/
diff --git a/Elk-ioc/README.md b/Elk-ioc/README.md
new file mode 100644
index 0000000..d9785a9
--- /dev/null
+++ b/Elk-ioc/README.md
@@ -0,0 +1,16 @@
+Elk
+===
+
+TODO List
+- [X] implement constructor injection
+- [ ] more tests for container
+- [ ] refactor code (Xiaolong)
+- [ ] add some exception handlers (Junv)
+- [X] implement setter injection
+- [ ] implement scoped container
+- [ ] Option:implement factory injection
+- [ ] Option:implement annotation
+
+License
+====
+MIT License
diff --git a/Elk-ioc/pom.xml b/Elk-ioc/pom.xml
new file mode 100644
index 0000000..f5e8614
--- /dev/null
+++ b/Elk-ioc/pom.xml
@@ -0,0 +1,126 @@
+
+
+ 4.0.0
+
+ com.toozhao
+ Elk-ioc
+ 0.0.1-SNAPSHOT
+ Elk IOC container
+ jar
+ Yet another Ioc container
+ https://github.com/szpyxlwoni/Elk
+
+ com.toozhao
+ Elk
+ 0.0.1-SNAPSHOT
+
+
+
+ MIT Licence
+ MIT Licence
+ repo
+
+
+
+ https://github.com/szpyxlwoni/Elk.git
+ git@github.com:szpyxlwoni/Elk.git
+
+
+
+ junv
+ Junv
+ wahyd4@gmail.com
+
+
+ szpyxlwoni
+ szpyxlwoni
+ szpyxlwoni@gmail.com
+
+
+
+
+ com.google.guava
+ guava
+ 14.0
+
+
+ com.google.code.findbugs
+ jsr305
+ 2.0.1
+ provided
+
+
+ junit
+ junit
+ 4.11
+
+
+
+
+
+
+ org.apache.maven.plugins
+ maven-source-plugin
+ 2.2.1
+
+
+ attach-sources
+ verify
+
+ jar-no-fork
+
+
+
+
+
+ org.apache.maven.plugins
+ maven-gpg-plugin
+ 1.4
+
+
+ sign-artifacts
+ verify
+
+ sign
+
+
+
+
+
+ org.apache.maven.plugins
+ maven-compiler-plugin
+ 3.1
+
+ 1.7
+ 1.7
+
+
+
+ org.apache.maven.plugins
+ maven-javadoc-plugin
+ 2.9
+
+ private
+ true
+
+
+
+ attach-javadocs
+
+ jar
+
+
+
+
+
+
+
+
+ nexus-oss
+ https://oss.sonatype.org/content/repositories/snapshots
+
+
+
+
\ No newline at end of file
diff --git a/Elk-ioc/src/main/java/com/thoughtworks/elk/container/ConfigFileParser.java b/Elk-ioc/src/main/java/com/thoughtworks/elk/container/ConfigFileParser.java
new file mode 100644
index 0000000..b8ace45
--- /dev/null
+++ b/Elk-ioc/src/main/java/com/thoughtworks/elk/container/ConfigFileParser.java
@@ -0,0 +1,43 @@
+package com.thoughtworks.elk.container;
+
+import com.thoughtworks.elk.container.exception.ElkParseException;
+import com.thoughtworks.elk.injection.ConstructorInjection;
+import com.thoughtworks.elk.injection.Injection;
+import com.thoughtworks.elk.injection.SetterInjection;
+
+import java.util.HashSet;
+import java.util.Scanner;
+
+import static com.google.common.collect.Sets.newHashSet;
+
+public class ConfigFileParser {
+ private String injection;
+ private final Scanner scanner;
+
+ public ConfigFileParser(String configFilePath) {
+ scanner = new Scanner(this.getClass().getClassLoader().getResourceAsStream(configFilePath));
+ if (scanner.hasNext()) {
+ injection = scanner.next();
+ }
+ }
+
+
+ public Injection getInjection() {
+ if (injection.equals("constructor")) {
+ return new ConstructorInjection();
+ }
+ return new SetterInjection();
+ }
+
+ public HashSet getClassList() {
+ HashSet classes = newHashSet();
+ while (scanner.hasNext()) {
+ try {
+ classes.add(Class.forName(scanner.next()));
+ } catch (ClassNotFoundException e) {
+ e.printStackTrace();
+ }
+ }
+ return classes;
+ }
+}
diff --git a/Elk-ioc/src/main/java/com/thoughtworks/elk/container/ConfigXmlParser.java b/Elk-ioc/src/main/java/com/thoughtworks/elk/container/ConfigXmlParser.java
new file mode 100644
index 0000000..9c74f21
--- /dev/null
+++ b/Elk-ioc/src/main/java/com/thoughtworks/elk/container/ConfigXmlParser.java
@@ -0,0 +1,108 @@
+package com.thoughtworks.elk.container;
+
+import com.google.common.base.Function;
+import javax.annotation.Nullable;
+import com.thoughtworks.elk.container.exception.ElkContainerException;
+import com.thoughtworks.elk.container.exception.ElkParseException;
+import org.w3c.dom.Document;
+import org.w3c.dom.Node;
+import org.w3c.dom.NodeList;
+
+import javax.xml.parsers.DocumentBuilder;
+import javax.xml.parsers.DocumentBuilderFactory;
+import java.io.InputStream;
+import java.util.ArrayList;
+import java.util.List;
+
+import static com.google.common.collect.Lists.newArrayList;
+import static com.google.common.collect.Lists.transform;
+
+public class ConfigXmlParser {
+
+ private Document doc;
+
+ public ConfigXmlParser(String configFilePath) throws ElkParseException {
+ InputStream resourceAsStream = this.getClass().getClassLoader().getResourceAsStream(configFilePath);
+ DocumentBuilderFactory dbFactory = DocumentBuilderFactory.newInstance();
+ try {
+ DocumentBuilder dBuilder = dbFactory.newDocumentBuilder();
+ doc = dBuilder.parse(resourceAsStream);
+ } catch (Exception e) {
+ throw new ElkParseException(e.getMessage());
+ }
+ }
+
+ public Node getNode(String beanId) {
+ NodeList nodeList = doc.getElementsByTagName("bean");
+ for (int i = 0; i < nodeList.getLength(); i++) {
+ Node node = nodeList.item(i);
+ if (node.getAttributes().getNamedItem("id").getNodeValue().equals(beanId)) {
+ return node;
+ }
+ }
+ return null;
+ }
+
+ public ArrayList getChildNodes(String parentId, String childName) {
+ NodeList nodeList = getNode(parentId).getChildNodes();
+ ArrayList nodeArrayList = newArrayList();
+ for (int i = 0; i < nodeList.getLength(); i++) {
+ Node node = nodeList.item(i);
+ if (node.getNodeName().equals(childName)) {
+ nodeArrayList.add(node);
+ }
+ }
+ return nodeArrayList;
+ }
+
+ private String getAttribute(String beanId, String attributeName) {
+ return getNode(beanId).getAttributes().getNamedItem(attributeName).getNodeValue();
+ }
+
+ public String getBeanClass(String beanId) {
+ return getAttribute(beanId, "class");
+ }
+
+ public List getConstructorDependenciesClass(String beanId) {
+ return getChildNodeAttribute(beanId, "constructor-arg", "type");
+ }
+
+ public List getConstructorDependenciesName(String beanId) {
+ return getChildNodeAttribute(beanId, "constructor-arg", "ref");
+ }
+
+ private List getChildNodeAttribute(String beanId, String childName, final String attribute) {
+ ArrayList childNodes = getChildNodes(beanId, childName);
+ return transform(childNodes, new Function() {
+ @Override
+ public Object apply(@Nullable Node node) {
+ return node.getAttributes().getNamedItem(attribute).getNodeValue();
+ }
+ });
+ }
+
+ public List getProperties(String beanId) {
+ List propertyName = getChildNodeAttribute(beanId, "property", "name");
+ List propertyRef = getChildNodeAttribute(beanId, "property", "ref");
+ List propertyType = getChildNodeAttribute(beanId, "property", "type");
+ List properties = newArrayList();
+ for (int i = 0; i < propertyName.size(); i++) {
+ properties.add(new Property(propertyName.get(i), propertyRef.get(i), propertyType.get(i)));
+ }
+ return properties;
+ }
+
+ Class[] getDependenciesClass(List dependencies) {
+ return (Class[]) transform(dependencies, new Function