jinx 2.1.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- data/.gitignore +14 -0
- data/.rspec +3 -0
- data/.yardopts +1 -0
- data/Gemfile +6 -0
- data/Gemfile.lock +27 -0
- data/History.md +6 -0
- data/LEGAL +5 -0
- data/LICENSE +22 -0
- data/README.md +44 -0
- data/Rakefile +41 -0
- data/examples/family/README.md +10 -0
- data/examples/family/ext/build.xml +35 -0
- data/examples/family/ext/src/family/Address.java +68 -0
- data/examples/family/ext/src/family/Child.java +24 -0
- data/examples/family/ext/src/family/DomainObject.java +26 -0
- data/examples/family/ext/src/family/Household.java +36 -0
- data/examples/family/ext/src/family/Parent.java +48 -0
- data/examples/family/ext/src/family/Person.java +42 -0
- data/examples/family/lib/family.rb +15 -0
- data/examples/family/lib/family/address.rb +6 -0
- data/examples/family/lib/family/domain_object.rb +6 -0
- data/examples/family/lib/family/household.rb +6 -0
- data/examples/family/lib/family/parent.rb +16 -0
- data/examples/family/lib/family/person.rb +6 -0
- data/examples/model/README.md +25 -0
- data/examples/model/ext/build.xml +35 -0
- data/examples/model/ext/src/domain/Child.java +192 -0
- data/examples/model/ext/src/domain/Dependent.java +29 -0
- data/examples/model/ext/src/domain/DomainObject.java +26 -0
- data/examples/model/ext/src/domain/Independent.java +83 -0
- data/examples/model/ext/src/domain/Parent.java +129 -0
- data/examples/model/ext/src/domain/Person.java +14 -0
- data/examples/model/lib/model.rb +13 -0
- data/examples/model/lib/model/child.rb +13 -0
- data/examples/model/lib/model/domain_object.rb +6 -0
- data/examples/model/lib/model/independent.rb +11 -0
- data/examples/model/lib/model/parent.rb +17 -0
- data/jinx.gemspec +22 -0
- data/lib/jinx.rb +3 -0
- data/lib/jinx/active_support/README.txt +2 -0
- data/lib/jinx/active_support/core_ext/string.rb +7 -0
- data/lib/jinx/active_support/core_ext/string/inflections.rb +167 -0
- data/lib/jinx/active_support/inflections.rb +55 -0
- data/lib/jinx/active_support/inflector.rb +398 -0
- data/lib/jinx/cli/application.rb +36 -0
- data/lib/jinx/cli/command.rb +214 -0
- data/lib/jinx/helpers/array.rb +108 -0
- data/lib/jinx/helpers/boolean.rb +42 -0
- data/lib/jinx/helpers/case_insensitive_hash.rb +39 -0
- data/lib/jinx/helpers/class.rb +149 -0
- data/lib/jinx/helpers/collection.rb +33 -0
- data/lib/jinx/helpers/collections.rb +11 -0
- data/lib/jinx/helpers/collector.rb +20 -0
- data/lib/jinx/helpers/conditional_enumerator.rb +21 -0
- data/lib/jinx/helpers/enumerable.rb +242 -0
- data/lib/jinx/helpers/enumerate.rb +35 -0
- data/lib/jinx/helpers/error.rb +15 -0
- data/lib/jinx/helpers/file_separator.rb +65 -0
- data/lib/jinx/helpers/filter.rb +52 -0
- data/lib/jinx/helpers/flattener.rb +38 -0
- data/lib/jinx/helpers/hash.rb +12 -0
- data/lib/jinx/helpers/hashable.rb +502 -0
- data/lib/jinx/helpers/inflector.rb +36 -0
- data/lib/jinx/helpers/key_transformer_hash.rb +43 -0
- data/lib/jinx/helpers/lazy_hash.rb +44 -0
- data/lib/jinx/helpers/log.rb +106 -0
- data/lib/jinx/helpers/math.rb +12 -0
- data/lib/jinx/helpers/merge.rb +60 -0
- data/lib/jinx/helpers/module.rb +18 -0
- data/lib/jinx/helpers/multi_enumerator.rb +31 -0
- data/lib/jinx/helpers/options.rb +92 -0
- data/lib/jinx/helpers/os.rb +19 -0
- data/lib/jinx/helpers/partial_order.rb +37 -0
- data/lib/jinx/helpers/pretty_print.rb +207 -0
- data/lib/jinx/helpers/set.rb +8 -0
- data/lib/jinx/helpers/stopwatch.rb +76 -0
- data/lib/jinx/helpers/transformer.rb +24 -0
- data/lib/jinx/helpers/transitive_closure.rb +55 -0
- data/lib/jinx/helpers/uniquifier.rb +50 -0
- data/lib/jinx/helpers/validation.rb +33 -0
- data/lib/jinx/helpers/visitor.rb +370 -0
- data/lib/jinx/import/class_path_modifier.rb +77 -0
- data/lib/jinx/import/java.rb +337 -0
- data/lib/jinx/importer.rb +240 -0
- data/lib/jinx/metadata.rb +155 -0
- data/lib/jinx/metadata/attribute_enumerator.rb +73 -0
- data/lib/jinx/metadata/dependency.rb +244 -0
- data/lib/jinx/metadata/id_alias.rb +23 -0
- data/lib/jinx/metadata/introspector.rb +179 -0
- data/lib/jinx/metadata/inverse.rb +170 -0
- data/lib/jinx/metadata/java_property.rb +169 -0
- data/lib/jinx/metadata/propertied.rb +500 -0
- data/lib/jinx/metadata/property.rb +401 -0
- data/lib/jinx/metadata/property_characteristics.rb +114 -0
- data/lib/jinx/resource.rb +862 -0
- data/lib/jinx/resource/copy_visitor.rb +36 -0
- data/lib/jinx/resource/inversible.rb +90 -0
- data/lib/jinx/resource/match_visitor.rb +180 -0
- data/lib/jinx/resource/matcher.rb +20 -0
- data/lib/jinx/resource/merge_visitor.rb +73 -0
- data/lib/jinx/resource/mergeable.rb +185 -0
- data/lib/jinx/resource/reference_enumerator.rb +49 -0
- data/lib/jinx/resource/reference_path_visitor.rb +38 -0
- data/lib/jinx/resource/reference_visitor.rb +55 -0
- data/lib/jinx/resource/unique.rb +35 -0
- data/lib/jinx/version.rb +3 -0
- data/spec/defaults_spec.rb +30 -0
- data/spec/definitions/model/alias/child.rb +5 -0
- data/spec/definitions/model/base/child.rb +5 -0
- data/spec/definitions/model/base/domain_object.rb +5 -0
- data/spec/definitions/model/base/independent.rb +5 -0
- data/spec/definitions/model/defaults/child.rb +5 -0
- data/spec/definitions/model/dependency/child.rb +5 -0
- data/spec/definitions/model/dependency/parent.rb +6 -0
- data/spec/definitions/model/inverse/child.rb +5 -0
- data/spec/definitions/model/inverse/independent.rb +5 -0
- data/spec/definitions/model/inverse/parent.rb +5 -0
- data/spec/definitions/model/mandatory/child.rb +6 -0
- data/spec/dependency_spec.rb +47 -0
- data/spec/family_spec.rb +64 -0
- data/spec/inverse_spec.rb +53 -0
- data/spec/mandatory_spec.rb +43 -0
- data/spec/metadata_spec.rb +68 -0
- data/spec/resource_spec.rb +30 -0
- data/spec/spec_helper.rb +3 -0
- data/spec/support/model.rb +19 -0
- data/test/fixtures/line_separator/cr_line_sep.txt +1 -0
- data/test/fixtures/line_separator/crlf_line_sep.txt +3 -0
- data/test/fixtures/line_separator/lf_line_sep.txt +3 -0
- data/test/fixtures/mixed/ext/build.xml +35 -0
- data/test/fixtures/mixed/ext/src/mixed/Case/Example.java +5 -0
- data/test/helper.rb +7 -0
- data/test/lib/jinx/command_test.rb +41 -0
- data/test/lib/jinx/helpers/boolean_test.rb +27 -0
- data/test/lib/jinx/helpers/class_test.rb +60 -0
- data/test/lib/jinx/helpers/collections_test.rb +402 -0
- data/test/lib/jinx/helpers/file_separator_test.rb +29 -0
- data/test/lib/jinx/helpers/inflector_test.rb +11 -0
- data/test/lib/jinx/helpers/lazy_hash_test.rb +32 -0
- data/test/lib/jinx/helpers/module_test.rb +24 -0
- data/test/lib/jinx/helpers/options_test.rb +66 -0
- data/test/lib/jinx/helpers/partial_order_test.rb +41 -0
- data/test/lib/jinx/helpers/pretty_print_test.rb +83 -0
- data/test/lib/jinx/helpers/stopwatch_test.rb +16 -0
- data/test/lib/jinx/helpers/transitive_closure_test.rb +80 -0
- data/test/lib/jinx/helpers/visitor_test.rb +288 -0
- data/test/lib/jinx/import/java_test.rb +78 -0
- data/test/lib/jinx/import/mixed_case_test.rb +16 -0
- metadata +272 -0
data/.gitignore
ADDED
data/.rspec
ADDED
data/.yardopts
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
-o doc/api --private --protected --name-tag 'quirk:Technology idiosyncracy' - History.md LEGAL LICENSE
|
data/Gemfile
ADDED
data/Gemfile.lock
ADDED
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
PATH
|
|
2
|
+
remote: .
|
|
3
|
+
specs:
|
|
4
|
+
jinx (2.1.1)
|
|
5
|
+
bundler
|
|
6
|
+
|
|
7
|
+
GEM
|
|
8
|
+
remote: http://rubygems.org/
|
|
9
|
+
specs:
|
|
10
|
+
diff-lcs (1.1.3)
|
|
11
|
+
rake (0.9.2.2)
|
|
12
|
+
rspec (2.9.0)
|
|
13
|
+
rspec-core (~> 2.9.0)
|
|
14
|
+
rspec-expectations (~> 2.9.0)
|
|
15
|
+
rspec-mocks (~> 2.9.0)
|
|
16
|
+
rspec-core (2.9.0)
|
|
17
|
+
rspec-expectations (2.9.1)
|
|
18
|
+
diff-lcs (~> 1.1.3)
|
|
19
|
+
rspec-mocks (2.9.0)
|
|
20
|
+
|
|
21
|
+
PLATFORMS
|
|
22
|
+
java
|
|
23
|
+
|
|
24
|
+
DEPENDENCIES
|
|
25
|
+
jinx!
|
|
26
|
+
rake
|
|
27
|
+
rspec (>= 2.6)
|
data/History.md
ADDED
data/LEGAL
ADDED
data/LICENSE
ADDED
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
Copyright (c) 2012 Oregon Health & Science University
|
|
2
|
+
|
|
3
|
+
Permission is hereby granted, free of charge, to any person
|
|
4
|
+
obtaining a copy of this software and associated documentation
|
|
5
|
+
files (the "Software"), to deal in the Software without
|
|
6
|
+
restriction, including without limitation the rights to use,
|
|
7
|
+
copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
8
|
+
copies of the Software, and to permit persons to whom the
|
|
9
|
+
Software is furnished to do so, subject to the following
|
|
10
|
+
conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be
|
|
13
|
+
included in all copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
|
|
16
|
+
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES
|
|
17
|
+
OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
|
|
18
|
+
NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
|
|
19
|
+
HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
|
|
20
|
+
WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
|
|
21
|
+
FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
|
|
22
|
+
OTHER DEALINGS IN THE SOFTWARE.
|
data/README.md
ADDED
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
JINX: JRuby Java introspector
|
|
2
|
+
=============================
|
|
3
|
+
|
|
4
|
+
**Home**: [http://github.com/jinx/core](http://github.com/jinx/core)
|
|
5
|
+
**Git**: [http://github.com/jinx/core](http://github.com/jinx/core)
|
|
6
|
+
**Author**: OHSU Knight Cancer Institute
|
|
7
|
+
**Copyright**: 2012
|
|
8
|
+
**License**: MIT License
|
|
9
|
+
|
|
10
|
+
Synopsis
|
|
11
|
+
--------
|
|
12
|
+
|
|
13
|
+
Jinx introspects a Java application domain package.
|
|
14
|
+
|
|
15
|
+
Feature List
|
|
16
|
+
------------
|
|
17
|
+
|
|
18
|
+
1. Introspects Java properties.
|
|
19
|
+
|
|
20
|
+
2. Annotates the introspected object model with additional meta-data.
|
|
21
|
+
|
|
22
|
+
2. Manages object dependencies.
|
|
23
|
+
|
|
24
|
+
3. Enforces inverse association integrity.
|
|
25
|
+
|
|
26
|
+
4. Adds property defaults.
|
|
27
|
+
|
|
28
|
+
5. Validates object completeness.
|
|
29
|
+
|
|
30
|
+
Installing
|
|
31
|
+
----------
|
|
32
|
+
Jinx is installed as a JRuby gem:
|
|
33
|
+
|
|
34
|
+
[sudo] jgem install jinx
|
|
35
|
+
|
|
36
|
+
Usage
|
|
37
|
+
-----
|
|
38
|
+
See the [example](http://github.com/jinx/core/tree/master/examples/family) for a sample usage pattern.
|
|
39
|
+
|
|
40
|
+
Copyright
|
|
41
|
+
---------
|
|
42
|
+
|
|
43
|
+
Jinx © 2012 by [Oregon Health & Science University](http://www.ohsu.edu/xd/health/services/cancer/index.cfm).
|
|
44
|
+
Jinx is licensed under the MIT license. Please see the LICENSE and LEGAL files for more information.
|
data/Rakefile
ADDED
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
require 'fileutils'
|
|
2
|
+
require File.dirname(__FILE__) + '/lib/jinx/version'
|
|
3
|
+
|
|
4
|
+
# the gem name
|
|
5
|
+
GEM = 'jinx'
|
|
6
|
+
GEM_VERSION = Jinx::VERSION
|
|
7
|
+
|
|
8
|
+
WINDOWS = (Config::CONFIG['host_os'] =~ /mingw|win32|cygwin/ ? true : false) rescue false
|
|
9
|
+
SUDO = WINDOWS ? '' : 'sudo'
|
|
10
|
+
|
|
11
|
+
desc 'Default: run the tests'
|
|
12
|
+
task :default => :test
|
|
13
|
+
|
|
14
|
+
desc 'Builds the gem'
|
|
15
|
+
task :gem do
|
|
16
|
+
sh "jgem build #{GEM}.gemspec"
|
|
17
|
+
end
|
|
18
|
+
|
|
19
|
+
desc 'Installs the gem'
|
|
20
|
+
task :install => :gem do
|
|
21
|
+
sh "#{SUDO} jgem install #{GEM}-#{GEM_VERSION}.gem"
|
|
22
|
+
end
|
|
23
|
+
|
|
24
|
+
desc 'Documents the API'
|
|
25
|
+
task :doc do
|
|
26
|
+
FileUtils.rm_rf 'doc/api'
|
|
27
|
+
sh 'yardoc'
|
|
28
|
+
end
|
|
29
|
+
|
|
30
|
+
desc 'Runs the spec tests'
|
|
31
|
+
task :spec do
|
|
32
|
+
Dir['spec/**/*_spec.rb'].each { |f| sh "rspec #{f}" rescue nil }
|
|
33
|
+
end
|
|
34
|
+
|
|
35
|
+
desc 'Runs the unit tests'
|
|
36
|
+
task :unit do
|
|
37
|
+
Dir['test/**/*_test.rb'].each { |f| sh "jruby #{f}" rescue nil }
|
|
38
|
+
end
|
|
39
|
+
|
|
40
|
+
desc 'Runs all tests'
|
|
41
|
+
task :test => [:spec, :unit]
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
Jinx Family Example
|
|
2
|
+
===================
|
|
3
|
+
|
|
4
|
+
This directory contains a simple Jinx usage example. The associations are as follows:
|
|
5
|
+
|
|
6
|
+
* 1 Household : N Persons (bidirectonal independent)
|
|
7
|
+
|
|
8
|
+
* 1 Household : 1 Address (unidirectional dependent)
|
|
9
|
+
|
|
10
|
+
* 1-2 Parents : N Children (bidirectonal dependent)
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
<?xml version ="1.0"?>
|
|
2
|
+
|
|
3
|
+
<project name="import Jinx test fixture" default="jar">
|
|
4
|
+
|
|
5
|
+
<!--build locations -->
|
|
6
|
+
<property name="base.dir" value="." />
|
|
7
|
+
<property name="source.dir" value="src" />
|
|
8
|
+
<property name="target.dir" value="classes" />
|
|
9
|
+
<property name="bin.dir" value="bin" />
|
|
10
|
+
|
|
11
|
+
<target name="init">
|
|
12
|
+
<tstamp />
|
|
13
|
+
<mkdir dir="${target.dir}" />
|
|
14
|
+
<mkdir dir="${bin.dir}" />
|
|
15
|
+
</target>
|
|
16
|
+
|
|
17
|
+
<!-- Compile all files in the source directory -->
|
|
18
|
+
<target name="compile" depends="init">
|
|
19
|
+
<javac destdir="${target.dir}" includes="**/*.*" includeAntRuntime="false">
|
|
20
|
+
<src path="${source.dir}" />
|
|
21
|
+
<compilerarg value="-Xlint:unchecked"/>
|
|
22
|
+
</javac>
|
|
23
|
+
</target>
|
|
24
|
+
|
|
25
|
+
<target name="jar" depends="compile">
|
|
26
|
+
<jar destfile="${bin.dir}/family.jar" basedir="${target.dir}" includes="**/*.*" />
|
|
27
|
+
</target>
|
|
28
|
+
|
|
29
|
+
<!-- Remove build directories -->
|
|
30
|
+
<target name="clean">
|
|
31
|
+
<delete dir="${bin.dir}" />
|
|
32
|
+
<delete dir="${target.dir}" />
|
|
33
|
+
</target>
|
|
34
|
+
|
|
35
|
+
</project>
|
|
@@ -0,0 +1,68 @@
|
|
|
1
|
+
package family;
|
|
2
|
+
|
|
3
|
+
public class Address
|
|
4
|
+
{
|
|
5
|
+
private String street1;
|
|
6
|
+
|
|
7
|
+
private String street2;
|
|
8
|
+
|
|
9
|
+
private String city;
|
|
10
|
+
|
|
11
|
+
private String state;
|
|
12
|
+
|
|
13
|
+
private String postalCode;
|
|
14
|
+
|
|
15
|
+
public Address()
|
|
16
|
+
{
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
public String getStreet1()
|
|
20
|
+
{
|
|
21
|
+
return street1;
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
public void setStreet1(String value)
|
|
25
|
+
{
|
|
26
|
+
this.street1 = value;
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
public String getStreet2()
|
|
30
|
+
{
|
|
31
|
+
return street2;
|
|
32
|
+
}
|
|
33
|
+
|
|
34
|
+
public void setStreet2(String value)
|
|
35
|
+
{
|
|
36
|
+
this.street2 = value;
|
|
37
|
+
}
|
|
38
|
+
|
|
39
|
+
public String getCity()
|
|
40
|
+
{
|
|
41
|
+
return city;
|
|
42
|
+
}
|
|
43
|
+
|
|
44
|
+
public void setCity(String value)
|
|
45
|
+
{
|
|
46
|
+
this.city = value;
|
|
47
|
+
}
|
|
48
|
+
|
|
49
|
+
public String getState()
|
|
50
|
+
{
|
|
51
|
+
return state;
|
|
52
|
+
}
|
|
53
|
+
|
|
54
|
+
public void setState(String value)
|
|
55
|
+
{
|
|
56
|
+
this.state = value;
|
|
57
|
+
}
|
|
58
|
+
|
|
59
|
+
public String getPostalCode()
|
|
60
|
+
{
|
|
61
|
+
return postalCode;
|
|
62
|
+
}
|
|
63
|
+
|
|
64
|
+
public void setPostalCode(String value)
|
|
65
|
+
{
|
|
66
|
+
this.postalCode = value;
|
|
67
|
+
}
|
|
68
|
+
}
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
package family;
|
|
2
|
+
|
|
3
|
+
import java.util.Collection;
|
|
4
|
+
import java.util.ArrayList;
|
|
5
|
+
|
|
6
|
+
public class Child extends Person
|
|
7
|
+
{
|
|
8
|
+
private Collection<Parent> parents;
|
|
9
|
+
|
|
10
|
+
public Child()
|
|
11
|
+
{
|
|
12
|
+
parents = new ArrayList<Parent>();
|
|
13
|
+
}
|
|
14
|
+
|
|
15
|
+
public Collection<Parent> getParents()
|
|
16
|
+
{
|
|
17
|
+
return parents;
|
|
18
|
+
}
|
|
19
|
+
|
|
20
|
+
public void setParents(Collection<Parent> parents)
|
|
21
|
+
{
|
|
22
|
+
this.parents = parents;
|
|
23
|
+
}
|
|
24
|
+
}
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
package family;
|
|
2
|
+
|
|
3
|
+
public abstract class DomainObject
|
|
4
|
+
{
|
|
5
|
+
private Long identifier;
|
|
6
|
+
|
|
7
|
+
public DomainObject()
|
|
8
|
+
{
|
|
9
|
+
}
|
|
10
|
+
|
|
11
|
+
/**
|
|
12
|
+
* @return the database identifier
|
|
13
|
+
*/
|
|
14
|
+
public Long getIdentifier()
|
|
15
|
+
{
|
|
16
|
+
return identifier;
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
/**
|
|
20
|
+
* @param id the id to set
|
|
21
|
+
*/
|
|
22
|
+
public void setIdentifier(Long id)
|
|
23
|
+
{
|
|
24
|
+
this.identifier = id;
|
|
25
|
+
}
|
|
26
|
+
}
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
package family;
|
|
2
|
+
|
|
3
|
+
import java.util.Collection;
|
|
4
|
+
import java.util.HashSet;
|
|
5
|
+
|
|
6
|
+
public class Household extends DomainObject
|
|
7
|
+
{
|
|
8
|
+
private Address address;
|
|
9
|
+
|
|
10
|
+
private Collection<Person> members;
|
|
11
|
+
|
|
12
|
+
public Household()
|
|
13
|
+
{
|
|
14
|
+
members = new HashSet<Person>();
|
|
15
|
+
}
|
|
16
|
+
|
|
17
|
+
public Address getAddress()
|
|
18
|
+
{
|
|
19
|
+
return address;
|
|
20
|
+
}
|
|
21
|
+
|
|
22
|
+
public void setAddress(Address address)
|
|
23
|
+
{
|
|
24
|
+
this.address = address;
|
|
25
|
+
}
|
|
26
|
+
|
|
27
|
+
public Collection<Person> getMembers()
|
|
28
|
+
{
|
|
29
|
+
return members;
|
|
30
|
+
}
|
|
31
|
+
|
|
32
|
+
public void setMembers(Collection<Person> members)
|
|
33
|
+
{
|
|
34
|
+
this.members = members;
|
|
35
|
+
}
|
|
36
|
+
}
|
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
package family;
|
|
2
|
+
|
|
3
|
+
import java.util.Collection;
|
|
4
|
+
import java.util.ArrayList;
|
|
5
|
+
|
|
6
|
+
public class Parent extends Person
|
|
7
|
+
{
|
|
8
|
+
private Parent spouse;
|
|
9
|
+
|
|
10
|
+
private String ssn;
|
|
11
|
+
|
|
12
|
+
private Collection<Child> children;
|
|
13
|
+
|
|
14
|
+
public Parent()
|
|
15
|
+
{
|
|
16
|
+
children = new ArrayList<Child>();
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
public String getSSN()
|
|
20
|
+
{
|
|
21
|
+
return ssn;
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
public void setSSN(String value)
|
|
25
|
+
{
|
|
26
|
+
this.ssn = value;
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
public Parent getSpouse()
|
|
30
|
+
{
|
|
31
|
+
return spouse;
|
|
32
|
+
}
|
|
33
|
+
|
|
34
|
+
public void setSpouse(Parent spouse)
|
|
35
|
+
{
|
|
36
|
+
this.spouse = spouse;
|
|
37
|
+
}
|
|
38
|
+
|
|
39
|
+
public Collection<Child> getChildren()
|
|
40
|
+
{
|
|
41
|
+
return children;
|
|
42
|
+
}
|
|
43
|
+
|
|
44
|
+
public void setChildren(Collection<Child> children)
|
|
45
|
+
{
|
|
46
|
+
this.children = children;
|
|
47
|
+
}
|
|
48
|
+
}
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
package family;
|
|
2
|
+
|
|
3
|
+
import java.util.Date;
|
|
4
|
+
|
|
5
|
+
public class Person extends DomainObject
|
|
6
|
+
{
|
|
7
|
+
private String name;
|
|
8
|
+
|
|
9
|
+
private Date birthDate;
|
|
10
|
+
|
|
11
|
+
private Household household;
|
|
12
|
+
|
|
13
|
+
public String getName()
|
|
14
|
+
{
|
|
15
|
+
return name;
|
|
16
|
+
}
|
|
17
|
+
|
|
18
|
+
public void setName(String value)
|
|
19
|
+
{
|
|
20
|
+
this.name = value;
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
public Date getBirthDate()
|
|
24
|
+
{
|
|
25
|
+
return birthDate;
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
public void setBirthDate(Date date)
|
|
29
|
+
{
|
|
30
|
+
this.birthDate = date;
|
|
31
|
+
}
|
|
32
|
+
|
|
33
|
+
public Household getHousehold()
|
|
34
|
+
{
|
|
35
|
+
return household;
|
|
36
|
+
}
|
|
37
|
+
|
|
38
|
+
public void setHousehold(Household household)
|
|
39
|
+
{
|
|
40
|
+
this.household = household;
|
|
41
|
+
}
|
|
42
|
+
}
|