|
@@ -17,32 +17,39 @@ |
17 |
17 |
|
public static final SubSystemFactory SSF = new SubSystemFactoryImpl( DEFINITIONS, IdentifierValidatorStrictCamel.INSTANCE, // |
18 |
18 |
|
new ObjectFactoryImpl( DEFINITIONS, IdentifierValidatorStrictCamel.INSTANCE, // |
19 |
19 |
|
new AttributeFactoryImpl( DEFINITIONS, // |
20 |
|
- |
IdentifierValidatorStrictCamel.INSTANCE ) ) ); |
|
20 |
+ |
IdentifierValidatorStrictCamel |
|
21 |
+ |
.INSTANCE ) ) ); |
21 |
22 |
|
|
22 |
|
- |
protected AbstractMementoBeanSwingMain( String[] pDirectoryPackagePairs, boolean pReadOnly ) |
|
23 |
+ |
protected AbstractMementoBeanSwingMain( String[] pNameDirectoryPackageTriples, boolean pReadOnly ) |
23 |
24 |
|
throws IOException |
24 |
25 |
|
{ |
25 |
|
- |
super( SSF, new SwingEditViewPanelFactory(), pReadOnly, createPersistables( pDirectoryPackagePairs ) ); |
|
26 |
+ |
super( SSF, new SwingEditViewPanelFactory(), pReadOnly, createPersistables( pNameDirectoryPackageTriples ) ); |
26 |
27 |
|
} |
27 |
28 |
|
|
28 |
|
- |
private static SubSystemPersister[] createPersistables( String[] pDirectoryPackagePairs ) |
|
29 |
+ |
private static SubSystemPersister[] createPersistables( String[] pNameDirectoryPackageTriples ) |
29 |
30 |
|
throws IOException |
30 |
31 |
|
{ |
31 |
|
- |
if ( pDirectoryPackagePairs.length == 0 ) |
|
32 |
+ |
if ( pNameDirectoryPackageTriples.length == 0 ) |
32 |
33 |
|
{ |
33 |
|
- |
throw new IllegalArgumentException( "No directory package pair(s) provided on the command line!" ); |
34 |
|
- |
} |
35 |
|
- |
if ( (pDirectoryPackagePairs.length & 1) == 1 ) // Odd? == ! Pairs |
36 |
|
- |
{ |
37 |
|
- |
throw new IllegalArgumentException( "Directory package pair(s) not paired on the command line!" ); |
|
34 |
+ |
throw new IllegalArgumentException( "No named directory package triple(s) provided on the command line!" ); |
38 |
35 |
|
} |
39 |
36 |
|
List<SubSystemPersister> rv = new ArrayList<SubSystemPersister>(); |
40 |
|
- |
for ( int i = 0; i < pDirectoryPackagePairs.length; ) |
|
37 |
+ |
for ( int i = 0; i < pNameDirectoryPackageTriples.length; ) |
41 |
38 |
|
{ |
42 |
|
- |
String zDirectory = pDirectoryPackagePairs[i++]; |
43 |
|
- |
String zPackage = pDirectoryPackagePairs[i++]; |
44 |
|
- |
rv.add( new DirectoryPackageSubSystemPersister( zDirectory, zPackage ) ); |
|
39 |
+ |
String zName = get( pNameDirectoryPackageTriples, i++ ); |
|
40 |
+ |
String zDirectory = get( pNameDirectoryPackageTriples, i++ ); |
|
41 |
+ |
String zPackage = get( pNameDirectoryPackageTriples, i++ ); |
|
42 |
+ |
rv.add( new DirectoryPackageSubSystemPersister( zName, zDirectory, zPackage ) ); |
45 |
43 |
|
} |
46 |
44 |
|
return rv.toArray( new SubSystemPersister[rv.size()] ); |
47 |
45 |
|
} |
|
46 |
+ |
|
|
47 |
+ |
private static String get( String[] pNameDirectoryPackageTriples, int pIndex ) |
|
48 |
+ |
{ |
|
49 |
+ |
if ( pIndex < pNameDirectoryPackageTriples.length ) |
|
50 |
+ |
{ |
|
51 |
+ |
return pNameDirectoryPackageTriples[pIndex]; |
|
52 |
+ |
} |
|
53 |
+ |
throw new IllegalArgumentException( "Name directory package triple(s) not tripled on the command line!" ); |
|
54 |
+ |
} |
48 |
55 |
|
} |