Move code to right package (#8285)
* Move code to rigth package * Move code to correct module
This commit is contained in:
@@ -1,4 +0,0 @@
|
||||
package com.baeldung.componentscan.filter.aspectj;
|
||||
|
||||
public class Cat {
|
||||
}
|
||||
@@ -1,15 +0,0 @@
|
||||
package com.baeldung.componentscan.filter.aspectj;
|
||||
|
||||
import org.springframework.context.annotation.ComponentScan;
|
||||
import org.springframework.context.annotation.Configuration;
|
||||
import org.springframework.context.annotation.FilterType;
|
||||
|
||||
@Configuration
|
||||
@ComponentScan(includeFilters = @ComponentScan.Filter(type = FilterType.ASPECTJ,
|
||||
pattern = "com.baeldung.componentscan.filter.aspectj.* "
|
||||
+ "&& !(com.baeldung.componentscan.filter.aspectj.L* "
|
||||
+ "|| com.baeldung.componentscan.filter.aspectj.C*)"))
|
||||
public class ComponentScanAspectJFilterApp {
|
||||
public static void main(String[] args) {
|
||||
}
|
||||
}
|
||||
@@ -1,4 +0,0 @@
|
||||
package com.baeldung.componentscan.filter.aspectj;
|
||||
|
||||
public class Elephant {
|
||||
}
|
||||
@@ -1,4 +0,0 @@
|
||||
package com.baeldung.componentscan.filter.aspectj;
|
||||
|
||||
public class Loin {
|
||||
}
|
||||
@@ -1,4 +0,0 @@
|
||||
package com.baeldung.componentscan.filter.assignable;
|
||||
|
||||
public interface Animal {
|
||||
}
|
||||
@@ -1,4 +0,0 @@
|
||||
package com.baeldung.componentscan.filter.assignable;
|
||||
|
||||
public class Cat implements Animal {
|
||||
}
|
||||
@@ -1,13 +0,0 @@
|
||||
package com.baeldung.componentscan.filter.assignable;
|
||||
|
||||
import org.springframework.context.annotation.ComponentScan;
|
||||
import org.springframework.context.annotation.Configuration;
|
||||
import org.springframework.context.annotation.FilterType;
|
||||
|
||||
@Configuration
|
||||
@ComponentScan(includeFilters = @ComponentScan.Filter(type = FilterType.ASSIGNABLE_TYPE, classes = Animal.class))
|
||||
public class ComponentScanAssignableTypeFilterApp {
|
||||
|
||||
public static void main(String[] args) {
|
||||
}
|
||||
}
|
||||
@@ -1,4 +0,0 @@
|
||||
package com.baeldung.componentscan.filter.assignable;
|
||||
|
||||
public class Elephant implements Animal {
|
||||
}
|
||||
@@ -1,4 +0,0 @@
|
||||
package com.baeldung.componentscan.filter.custom;
|
||||
|
||||
public class Cat {
|
||||
}
|
||||
@@ -1,19 +0,0 @@
|
||||
package com.baeldung.componentscan.filter.custom;
|
||||
|
||||
import org.springframework.core.type.ClassMetadata;
|
||||
import org.springframework.core.type.classreading.MetadataReader;
|
||||
import org.springframework.core.type.classreading.MetadataReaderFactory;
|
||||
import org.springframework.core.type.filter.TypeFilter;
|
||||
|
||||
import java.io.IOException;
|
||||
|
||||
public class ComponentScanCustomFilter implements TypeFilter {
|
||||
|
||||
@Override
|
||||
public boolean match(MetadataReader metadataReader, MetadataReaderFactory metadataReaderFactory) throws IOException {
|
||||
ClassMetadata classMetadata = metadataReader.getClassMetadata();
|
||||
String fullyQualifiedName = classMetadata.getClassName();
|
||||
String className = fullyQualifiedName.substring(fullyQualifiedName.lastIndexOf(".") + 1);
|
||||
return className.length() > 5 ? true : false;
|
||||
}
|
||||
}
|
||||
@@ -1,13 +0,0 @@
|
||||
package com.baeldung.componentscan.filter.custom;
|
||||
|
||||
import org.springframework.context.annotation.ComponentScan;
|
||||
import org.springframework.context.annotation.Configuration;
|
||||
import org.springframework.context.annotation.FilterType;
|
||||
|
||||
@Configuration
|
||||
@ComponentScan(includeFilters = @ComponentScan.Filter(type = FilterType.CUSTOM, classes = ComponentScanCustomFilter.class))
|
||||
public class ComponentScanCustomFilterApp {
|
||||
|
||||
public static void main(String[] args) {
|
||||
}
|
||||
}
|
||||
@@ -1,4 +0,0 @@
|
||||
package com.baeldung.componentscan.filter.custom;
|
||||
|
||||
public class Elephant {
|
||||
}
|
||||
@@ -1,4 +0,0 @@
|
||||
package com.baeldung.componentscan.filter.custom;
|
||||
|
||||
public class Loin {
|
||||
}
|
||||
@@ -1,4 +0,0 @@
|
||||
package com.baeldung.componentscan.filter.regex;
|
||||
|
||||
public class Cat {
|
||||
}
|
||||
@@ -1,13 +0,0 @@
|
||||
package com.baeldung.componentscan.filter.regex;
|
||||
|
||||
import org.springframework.context.annotation.ComponentScan;
|
||||
import org.springframework.context.annotation.Configuration;
|
||||
import org.springframework.context.annotation.FilterType;
|
||||
|
||||
@Configuration
|
||||
@ComponentScan(includeFilters = @ComponentScan.Filter(type = FilterType.REGEX, pattern = ".*(nt)"))
|
||||
public class ComponentScanRegexFilterApp {
|
||||
|
||||
public static void main(String[] args) {
|
||||
}
|
||||
}
|
||||
@@ -1,4 +0,0 @@
|
||||
package com.baeldung.componentscan.filter.regex;
|
||||
|
||||
public class Elephant {
|
||||
}
|
||||
@@ -1,4 +0,0 @@
|
||||
package com.baeldung.componentscan.filter.regex;
|
||||
|
||||
public class Loin {
|
||||
}
|
||||
Reference in New Issue
Block a user