dev
This commit is contained in:
@@ -0,0 +1,42 @@
|
||||
package com.mogo.module.common;
|
||||
|
||||
/**
|
||||
* @author congtaowang
|
||||
* @since 2019-12-31
|
||||
* <p>
|
||||
* 模块描述信息
|
||||
*/
|
||||
public class MogoModule {
|
||||
|
||||
/**
|
||||
* 模块加载路径
|
||||
*/
|
||||
private String mPath;
|
||||
|
||||
/**
|
||||
* 模块名称
|
||||
*/
|
||||
private String mName;
|
||||
|
||||
public MogoModule( String path, String name ) {
|
||||
this.mPath = path;
|
||||
this.mName = name;
|
||||
}
|
||||
|
||||
|
||||
public String getPath() {
|
||||
return mPath;
|
||||
}
|
||||
|
||||
public void setPath( String path ) {
|
||||
this.mPath = path;
|
||||
}
|
||||
|
||||
public String getName() {
|
||||
return mName;
|
||||
}
|
||||
|
||||
public void setName( String name ) {
|
||||
this.mName = name;
|
||||
}
|
||||
}
|
||||
@@ -16,7 +16,7 @@ import java.util.Vector;
|
||||
*/
|
||||
public class MogoModulePaths {
|
||||
|
||||
private static List< String > mModulesPath = new ArrayList<>();
|
||||
private static List< MogoModule > mMogoModules = new ArrayList<>();
|
||||
|
||||
/**
|
||||
* 地图模块 fragment 路径
|
||||
@@ -33,10 +33,17 @@ public class MogoModulePaths {
|
||||
if ( TextUtils.isEmpty( path.replace( " ", "" ) ) ) {
|
||||
throw new IllegalArgumentException( "module path can't be empty or null or blank" );
|
||||
}
|
||||
mModulesPath.add( path );
|
||||
mMogoModules.add( new MogoModule( path, "" ) );
|
||||
}
|
||||
|
||||
public static List< String > getModulesPath() {
|
||||
return mModulesPath;
|
||||
public static void addModule( MogoModule module ) {
|
||||
if ( module == null || TextUtils.isEmpty( module.getPath().replace( " ", "" ) ) ) {
|
||||
throw new IllegalArgumentException( "module path can't be empty or null or blank" );
|
||||
}
|
||||
mMogoModules.add( module );
|
||||
}
|
||||
|
||||
public static List< MogoModule > getModules() {
|
||||
return mMogoModules;
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user