Updated classes to use JDOM 2

Fixed tests
Formatted code
This commit is contained in:
Patrick Gotthard 2013-10-07 21:11:47 +02:00
parent 1749a5447f
commit 7b8c9259d0
232 changed files with 18694 additions and 18428 deletions

56
cleanup.xml Normal file
View file

@ -0,0 +1,56 @@
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<profiles version="2">
<profile kind="CleanUpProfile" name="ROME" version="2">
<setting id="cleanup.remove_unused_private_fields" value="true"/>
<setting id="cleanup.always_use_parentheses_in_expressions" value="false"/>
<setting id="cleanup.never_use_blocks" value="false"/>
<setting id="cleanup.remove_unused_private_methods" value="true"/>
<setting id="cleanup.add_missing_deprecated_annotations" value="true"/>
<setting id="cleanup.convert_to_enhanced_for_loop" value="true"/>
<setting id="cleanup.remove_unnecessary_nls_tags" value="true"/>
<setting id="cleanup.sort_members" value="false"/>
<setting id="cleanup.remove_unused_local_variables" value="false"/>
<setting id="cleanup.never_use_parentheses_in_expressions" value="true"/>
<setting id="cleanup.remove_unused_private_members" value="false"/>
<setting id="cleanup.remove_unnecessary_casts" value="true"/>
<setting id="cleanup.make_parameters_final" value="true"/>
<setting id="cleanup.use_this_for_non_static_field_access" value="true"/>
<setting id="cleanup.remove_private_constructors" value="true"/>
<setting id="cleanup.use_blocks" value="true"/>
<setting id="cleanup.always_use_this_for_non_static_method_access" value="false"/>
<setting id="cleanup.remove_trailing_whitespaces_all" value="true"/>
<setting id="cleanup.always_use_this_for_non_static_field_access" value="false"/>
<setting id="cleanup.use_this_for_non_static_field_access_only_if_necessary" value="true"/>
<setting id="cleanup.add_default_serial_version_id" value="true"/>
<setting id="cleanup.make_type_abstract_if_missing_method" value="false"/>
<setting id="cleanup.qualify_static_member_accesses_through_subtypes_with_declaring_class" value="true"/>
<setting id="cleanup.make_variable_declarations_final" value="true"/>
<setting id="cleanup.add_missing_nls_tags" value="false"/>
<setting id="cleanup.format_source_code" value="true"/>
<setting id="cleanup.qualify_static_method_accesses_with_declaring_class" value="false"/>
<setting id="cleanup.add_missing_override_annotations" value="true"/>
<setting id="cleanup.remove_unused_private_types" value="true"/>
<setting id="cleanup.add_missing_methods" value="false"/>
<setting id="cleanup.make_local_variable_final" value="true"/>
<setting id="cleanup.correct_indentation" value="true"/>
<setting id="cleanup.add_missing_override_annotations_interface_methods" value="true"/>
<setting id="cleanup.remove_unused_imports" value="true"/>
<setting id="cleanup.remove_trailing_whitespaces_ignore_empty" value="false"/>
<setting id="cleanup.make_private_fields_final" value="true"/>
<setting id="cleanup.add_generated_serial_version_id" value="false"/>
<setting id="cleanup.organize_imports" value="true"/>
<setting id="cleanup.remove_trailing_whitespaces" value="true"/>
<setting id="cleanup.sort_members_all" value="false"/>
<setting id="cleanup.use_blocks_only_for_return_and_throw" value="false"/>
<setting id="cleanup.add_missing_annotations" value="true"/>
<setting id="cleanup.use_parentheses_in_expressions" value="true"/>
<setting id="cleanup.qualify_static_field_accesses_with_declaring_class" value="false"/>
<setting id="cleanup.use_this_for_non_static_method_access_only_if_necessary" value="true"/>
<setting id="cleanup.use_this_for_non_static_method_access" value="true"/>
<setting id="cleanup.qualify_static_member_accesses_through_instances_with_declaring_class" value="true"/>
<setting id="cleanup.add_serial_version_id" value="false"/>
<setting id="cleanup.format_source_code_changes_only" value="false"/>
<setting id="cleanup.qualify_static_member_accesses_with_declaring_class" value="true"/>
<setting id="cleanup.always_use_blocks" value="true"/>
</profile>
</profiles>

291
formatter.xml Normal file
View file

@ -0,0 +1,291 @@
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<profiles version="12">
<profile kind="CodeFormatterProfile" name="ROME" version="12">
<setting id="org.eclipse.jdt.core.formatter.comment.insert_new_line_before_root_tags" value="insert"/>
<setting id="org.eclipse.jdt.core.formatter.disabling_tag" value="@formatter:off"/>
<setting id="org.eclipse.jdt.core.formatter.insert_space_after_comma_in_annotation" value="insert"/>
<setting id="org.eclipse.jdt.core.formatter.insert_space_before_comma_in_type_parameters" value="do not insert"/>
<setting id="org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_type_declaration" value="insert"/>
<setting id="org.eclipse.jdt.core.formatter.insert_space_after_comma_in_type_arguments" value="insert"/>
<setting id="org.eclipse.jdt.core.formatter.brace_position_for_anonymous_type_declaration" value="end_of_line"/>
<setting id="org.eclipse.jdt.core.formatter.insert_space_before_colon_in_case" value="do not insert"/>
<setting id="org.eclipse.jdt.core.formatter.insert_space_after_opening_brace_in_array_initializer" value="insert"/>
<setting id="org.eclipse.jdt.core.formatter.comment.new_lines_at_block_boundaries" value="true"/>
<setting id="org.eclipse.jdt.core.formatter.insert_new_line_in_empty_annotation_declaration" value="insert"/>
<setting id="org.eclipse.jdt.core.formatter.insert_new_line_before_closing_brace_in_array_initializer" value="do not insert"/>
<setting id="org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_annotation" value="do not insert"/>
<setting id="org.eclipse.jdt.core.formatter.blank_lines_before_field" value="0"/>
<setting id="org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_while" value="do not insert"/>
<setting id="org.eclipse.jdt.core.formatter.use_on_off_tags" value="false"/>
<setting id="org.eclipse.jdt.core.formatter.insert_space_between_empty_parens_in_annotation_type_member_declaration" value="do not insert"/>
<setting id="org.eclipse.jdt.core.formatter.insert_new_line_before_else_in_if_statement" value="do not insert"/>
<setting id="org.eclipse.jdt.core.formatter.insert_space_after_prefix_operator" value="do not insert"/>
<setting id="org.eclipse.jdt.core.formatter.keep_else_statement_on_same_line" value="false"/>
<setting id="org.eclipse.jdt.core.formatter.insert_space_after_ellipsis" value="insert"/>
<setting id="org.eclipse.jdt.core.formatter.comment.insert_new_line_for_parameter" value="do not insert"/>
<setting id="org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_annotation_type_declaration" value="insert"/>
<setting id="org.eclipse.jdt.core.formatter.indent_breaks_compare_to_cases" value="true"/>
<setting id="org.eclipse.jdt.core.formatter.insert_space_after_at_in_annotation" value="do not insert"/>
<setting id="org.eclipse.jdt.core.formatter.alignment_for_multiple_fields" value="16"/>
<setting id="org.eclipse.jdt.core.formatter.alignment_for_expressions_in_array_initializer" value="16"/>
<setting id="org.eclipse.jdt.core.formatter.alignment_for_conditional_expression" value="80"/>
<setting id="org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_for" value="insert"/>
<setting id="org.eclipse.jdt.core.formatter.insert_space_after_binary_operator" value="insert"/>
<setting id="org.eclipse.jdt.core.formatter.insert_space_before_question_in_wildcard" value="do not insert"/>
<setting id="org.eclipse.jdt.core.formatter.brace_position_for_array_initializer" value="end_of_line"/>
<setting id="org.eclipse.jdt.core.formatter.insert_space_between_empty_parens_in_enum_constant" value="do not insert"/>
<setting id="org.eclipse.jdt.core.formatter.insert_new_line_before_finally_in_try_statement" value="do not insert"/>
<setting id="org.eclipse.jdt.core.formatter.insert_new_line_after_annotation_on_local_variable" value="insert"/>
<setting id="org.eclipse.jdt.core.formatter.insert_new_line_before_catch_in_try_statement" value="do not insert"/>
<setting id="org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_while" value="insert"/>
<setting id="org.eclipse.jdt.core.formatter.blank_lines_after_package" value="1"/>
<setting id="org.eclipse.jdt.core.formatter.insert_space_after_comma_in_type_parameters" value="insert"/>
<setting id="org.eclipse.jdt.core.formatter.continuation_indentation" value="2"/>
<setting id="org.eclipse.jdt.core.formatter.insert_space_after_postfix_operator" value="do not insert"/>
<setting id="org.eclipse.jdt.core.formatter.alignment_for_arguments_in_method_invocation" value="16"/>
<setting id="org.eclipse.jdt.core.formatter.insert_space_before_closing_angle_bracket_in_type_arguments" value="do not insert"/>
<setting id="org.eclipse.jdt.core.formatter.insert_space_before_comma_in_superinterfaces" value="do not insert"/>
<setting id="org.eclipse.jdt.core.formatter.blank_lines_before_new_chunk" value="1"/>
<setting id="org.eclipse.jdt.core.formatter.insert_space_before_binary_operator" value="insert"/>
<setting id="org.eclipse.jdt.core.formatter.blank_lines_before_package" value="0"/>
<setting id="org.eclipse.jdt.core.compiler.source" value="1.7"/>
<setting id="org.eclipse.jdt.core.formatter.insert_space_after_comma_in_enum_constant_arguments" value="insert"/>
<setting id="org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_constructor_declaration" value="do not insert"/>
<setting id="org.eclipse.jdt.core.formatter.comment.format_line_comments" value="true"/>
<setting id="org.eclipse.jdt.core.formatter.insert_space_after_closing_angle_bracket_in_type_arguments" value="insert"/>
<setting id="org.eclipse.jdt.core.formatter.insert_space_after_comma_in_enum_declarations" value="insert"/>
<setting id="org.eclipse.jdt.core.formatter.join_wrapped_lines" value="true"/>
<setting id="org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_block" value="insert"/>
<setting id="org.eclipse.jdt.core.formatter.alignment_for_arguments_in_explicit_constructor_call" value="16"/>
<setting id="org.eclipse.jdt.core.formatter.insert_space_before_comma_in_method_invocation_arguments" value="do not insert"/>
<setting id="org.eclipse.jdt.core.formatter.blank_lines_before_member_type" value="1"/>
<setting id="org.eclipse.jdt.core.formatter.align_type_members_on_columns" value="false"/>
<setting id="org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_enum_constant" value="do not insert"/>
<setting id="org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_for" value="do not insert"/>
<setting id="org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_method_declaration" value="insert"/>
<setting id="org.eclipse.jdt.core.formatter.alignment_for_selector_in_method_invocation" value="16"/>
<setting id="org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_switch" value="do not insert"/>
<setting id="org.eclipse.jdt.core.formatter.insert_space_after_unary_operator" value="do not insert"/>
<setting id="org.eclipse.jdt.core.formatter.insert_space_after_colon_in_case" value="insert"/>
<setting id="org.eclipse.jdt.core.formatter.comment.indent_parameter_description" value="true"/>
<setting id="org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_method_declaration" value="do not insert"/>
<setting id="org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_switch" value="do not insert"/>
<setting id="org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_enum_declaration" value="insert"/>
<setting id="org.eclipse.jdt.core.formatter.insert_space_before_opening_angle_bracket_in_type_parameters" value="do not insert"/>
<setting id="org.eclipse.jdt.core.formatter.comment.clear_blank_lines_in_block_comment" value="true"/>
<setting id="org.eclipse.jdt.core.formatter.insert_new_line_in_empty_type_declaration" value="insert"/>
<setting id="org.eclipse.jdt.core.formatter.lineSplit" value="160"/>
<setting id="org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_if" value="insert"/>
<setting id="org.eclipse.jdt.core.formatter.insert_space_between_brackets_in_array_type_reference" value="do not insert"/>
<setting id="org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_parenthesized_expression" value="do not insert"/>
<setting id="org.eclipse.jdt.core.formatter.insert_space_before_comma_in_explicitconstructorcall_arguments" value="do not insert"/>
<setting id="org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_constructor_declaration" value="insert"/>
<setting id="org.eclipse.jdt.core.formatter.blank_lines_before_first_class_body_declaration" value="0"/>
<setting id="org.eclipse.jdt.core.formatter.insert_new_line_after_annotation_on_method" value="insert"/>
<setting id="org.eclipse.jdt.core.formatter.indentation.size" value="4"/>
<setting id="org.eclipse.jdt.core.formatter.insert_space_between_empty_parens_in_method_declaration" value="do not insert"/>
<setting id="org.eclipse.jdt.core.formatter.enabling_tag" value="@formatter:on"/>
<setting id="org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_enum_constant" value="do not insert"/>
<setting id="org.eclipse.jdt.core.formatter.alignment_for_superclass_in_type_declaration" value="16"/>
<setting id="org.eclipse.jdt.core.formatter.alignment_for_assignment" value="0"/>
<setting id="org.eclipse.jdt.core.compiler.problem.assertIdentifier" value="error"/>
<setting id="org.eclipse.jdt.core.formatter.tabulation.char" value="space"/>
<setting id="org.eclipse.jdt.core.formatter.insert_space_after_comma_in_constructor_declaration_parameters" value="insert"/>
<setting id="org.eclipse.jdt.core.formatter.insert_space_after_semicolon_in_try_resources" value="insert"/>
<setting id="org.eclipse.jdt.core.formatter.insert_space_before_prefix_operator" value="do not insert"/>
<setting id="org.eclipse.jdt.core.formatter.indent_statements_compare_to_body" value="true"/>
<setting id="org.eclipse.jdt.core.formatter.blank_lines_before_method" value="1"/>
<setting id="org.eclipse.jdt.core.formatter.wrap_outer_expressions_when_nested" value="true"/>
<setting id="org.eclipse.jdt.core.formatter.format_guardian_clause_on_one_line" value="false"/>
<setting id="org.eclipse.jdt.core.formatter.insert_space_before_colon_in_for" value="insert"/>
<setting id="org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_cast" value="do not insert"/>
<setting id="org.eclipse.jdt.core.formatter.alignment_for_parameters_in_constructor_declaration" value="16"/>
<setting id="org.eclipse.jdt.core.formatter.insert_space_after_colon_in_labeled_statement" value="insert"/>
<setting id="org.eclipse.jdt.core.formatter.brace_position_for_annotation_type_declaration" value="end_of_line"/>
<setting id="org.eclipse.jdt.core.formatter.insert_new_line_in_empty_method_body" value="insert"/>
<setting id="org.eclipse.jdt.core.formatter.alignment_for_method_declaration" value="0"/>
<setting id="org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_method_invocation" value="do not insert"/>
<setting id="org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_try" value="do not insert"/>
<setting id="org.eclipse.jdt.core.formatter.insert_space_after_opening_bracket_in_array_allocation_expression" value="do not insert"/>
<setting id="org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_enum_constant" value="insert"/>
<setting id="org.eclipse.jdt.core.formatter.insert_space_before_comma_in_annotation" value="do not insert"/>
<setting id="org.eclipse.jdt.core.formatter.insert_space_after_at_in_annotation_type_declaration" value="do not insert"/>
<setting id="org.eclipse.jdt.core.formatter.insert_space_before_comma_in_method_declaration_throws" value="do not insert"/>
<setting id="org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_if" value="do not insert"/>
<setting id="org.eclipse.jdt.core.formatter.brace_position_for_switch" value="end_of_line"/>
<setting id="org.eclipse.jdt.core.formatter.insert_space_after_comma_in_method_declaration_throws" value="insert"/>
<setting id="org.eclipse.jdt.core.formatter.insert_space_before_parenthesized_expression_in_return" value="insert"/>
<setting id="org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_annotation" value="do not insert"/>
<setting id="org.eclipse.jdt.core.formatter.insert_space_after_question_in_conditional" value="insert"/>
<setting id="org.eclipse.jdt.core.formatter.insert_space_after_question_in_wildcard" value="do not insert"/>
<setting id="org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_try" value="do not insert"/>
<setting id="org.eclipse.jdt.core.formatter.insert_space_before_closing_bracket_in_array_allocation_expression" value="do not insert"/>
<setting id="org.eclipse.jdt.core.formatter.comment.preserve_white_space_between_code_and_line_comments" value="false"/>
<setting id="org.eclipse.jdt.core.formatter.insert_space_before_parenthesized_expression_in_throw" value="insert"/>
<setting id="org.eclipse.jdt.core.formatter.insert_space_before_comma_in_type_arguments" value="do not insert"/>
<setting id="org.eclipse.jdt.core.compiler.problem.enumIdentifier" value="error"/>
<setting id="org.eclipse.jdt.core.formatter.indent_switchstatements_compare_to_switch" value="true"/>
<setting id="org.eclipse.jdt.core.formatter.insert_space_before_ellipsis" value="do not insert"/>
<setting id="org.eclipse.jdt.core.formatter.brace_position_for_block" value="end_of_line"/>
<setting id="org.eclipse.jdt.core.formatter.insert_space_before_comma_in_for_inits" value="do not insert"/>
<setting id="org.eclipse.jdt.core.formatter.brace_position_for_method_declaration" value="end_of_line"/>
<setting id="org.eclipse.jdt.core.formatter.compact_else_if" value="true"/>
<setting id="org.eclipse.jdt.core.formatter.wrap_before_or_operator_multicatch" value="true"/>
<setting id="org.eclipse.jdt.core.formatter.insert_space_before_comma_in_array_initializer" value="do not insert"/>
<setting id="org.eclipse.jdt.core.formatter.insert_space_after_comma_in_for_increments" value="insert"/>
<setting id="org.eclipse.jdt.core.formatter.format_line_comment_starting_on_first_column" value="true"/>
<setting id="org.eclipse.jdt.core.formatter.insert_space_before_closing_bracket_in_array_reference" value="do not insert"/>
<setting id="org.eclipse.jdt.core.formatter.insert_new_line_after_annotation_on_field" value="insert"/>
<setting id="org.eclipse.jdt.core.formatter.comment.indent_root_tags" value="true"/>
<setting id="org.eclipse.jdt.core.formatter.brace_position_for_enum_constant" value="end_of_line"/>
<setting id="org.eclipse.jdt.core.formatter.insert_space_before_comma_in_enum_declarations" value="do not insert"/>
<setting id="org.eclipse.jdt.core.formatter.alignment_for_union_type_in_multicatch" value="16"/>
<setting id="org.eclipse.jdt.core.formatter.insert_space_after_comma_in_explicitconstructorcall_arguments" value="insert"/>
<setting id="org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_switch" value="insert"/>
<setting id="org.eclipse.jdt.core.formatter.insert_space_before_comma_in_method_declaration_parameters" value="do not insert"/>
<setting id="org.eclipse.jdt.core.formatter.insert_space_after_comma_in_superinterfaces" value="insert"/>
<setting id="org.eclipse.jdt.core.formatter.insert_space_before_comma_in_allocation_expression" value="do not insert"/>
<setting id="org.eclipse.jdt.core.formatter.tabulation.size" value="4"/>
<setting id="org.eclipse.jdt.core.formatter.insert_space_before_opening_bracket_in_array_type_reference" value="do not insert"/>
<setting id="org.eclipse.jdt.core.formatter.insert_new_line_after_opening_brace_in_array_initializer" value="do not insert"/>
<setting id="org.eclipse.jdt.core.formatter.insert_space_after_closing_brace_in_block" value="insert"/>
<setting id="org.eclipse.jdt.core.formatter.insert_space_before_opening_bracket_in_array_reference" value="do not insert"/>
<setting id="org.eclipse.jdt.core.formatter.insert_new_line_in_empty_enum_constant" value="insert"/>
<setting id="org.eclipse.jdt.core.formatter.insert_space_after_opening_angle_bracket_in_type_arguments" value="do not insert"/>
<setting id="org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_constructor_declaration" value="do not insert"/>
<setting id="org.eclipse.jdt.core.formatter.insert_space_before_comma_in_constructor_declaration_throws" value="do not insert"/>
<setting id="org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_if" value="do not insert"/>
<setting id="org.eclipse.jdt.core.formatter.comment.clear_blank_lines_in_javadoc_comment" value="false"/>
<setting id="org.eclipse.jdt.core.formatter.alignment_for_throws_clause_in_constructor_declaration" value="16"/>
<setting id="org.eclipse.jdt.core.formatter.insert_space_after_assignment_operator" value="insert"/>
<setting id="org.eclipse.jdt.core.formatter.insert_space_before_assignment_operator" value="insert"/>
<setting id="org.eclipse.jdt.core.formatter.indent_empty_lines" value="false"/>
<setting id="org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_synchronized" value="do not insert"/>
<setting id="org.eclipse.jdt.core.formatter.insert_space_after_closing_paren_in_cast" value="insert"/>
<setting id="org.eclipse.jdt.core.formatter.insert_space_after_comma_in_method_declaration_parameters" value="insert"/>
<setting id="org.eclipse.jdt.core.formatter.brace_position_for_block_in_case" value="end_of_line"/>
<setting id="org.eclipse.jdt.core.formatter.number_of_empty_lines_to_preserve" value="1"/>
<setting id="org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_method_declaration" value="do not insert"/>
<setting id="org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_catch" value="do not insert"/>
<setting id="org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_constructor_declaration" value="do not insert"/>
<setting id="org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_method_invocation" value="do not insert"/>
<setting id="org.eclipse.jdt.core.formatter.insert_space_after_opening_bracket_in_array_reference" value="do not insert"/>
<setting id="org.eclipse.jdt.core.formatter.alignment_for_arguments_in_qualified_allocation_expression" value="16"/>
<setting id="org.eclipse.jdt.core.formatter.insert_space_after_and_in_type_parameter" value="insert"/>
<setting id="org.eclipse.jdt.core.compiler.compliance" value="1.7"/>
<setting id="org.eclipse.jdt.core.formatter.continuation_indentation_for_array_initializer" value="2"/>
<setting id="org.eclipse.jdt.core.formatter.insert_space_between_empty_brackets_in_array_allocation_expression" value="do not insert"/>
<setting id="org.eclipse.jdt.core.formatter.insert_space_before_at_in_annotation_type_declaration" value="insert"/>
<setting id="org.eclipse.jdt.core.formatter.alignment_for_arguments_in_allocation_expression" value="16"/>
<setting id="org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_cast" value="do not insert"/>
<setting id="org.eclipse.jdt.core.formatter.insert_space_before_unary_operator" value="do not insert"/>
<setting id="org.eclipse.jdt.core.formatter.insert_space_before_closing_angle_bracket_in_parameterized_type_reference" value="do not insert"/>
<setting id="org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_anonymous_type_declaration" value="insert"/>
<setting id="org.eclipse.jdt.core.formatter.keep_empty_array_initializer_on_one_line" value="false"/>
<setting id="org.eclipse.jdt.core.formatter.insert_new_line_in_empty_enum_declaration" value="insert"/>
<setting id="org.eclipse.jdt.core.formatter.keep_imple_if_on_one_line" value="false"/>
<setting id="org.eclipse.jdt.core.formatter.insert_space_before_comma_in_constructor_declaration_parameters" value="do not insert"/>
<setting id="org.eclipse.jdt.core.formatter.insert_space_after_closing_angle_bracket_in_type_parameters" value="insert"/>
<setting id="org.eclipse.jdt.core.formatter.insert_new_line_at_end_of_file_if_missing" value="do not insert"/>
<setting id="org.eclipse.jdt.core.formatter.insert_space_after_colon_in_for" value="insert"/>
<setting id="org.eclipse.jdt.core.formatter.insert_space_before_colon_in_labeled_statement" value="do not insert"/>
<setting id="org.eclipse.jdt.core.formatter.insert_space_before_comma_in_parameterized_type_reference" value="do not insert"/>
<setting id="org.eclipse.jdt.core.formatter.alignment_for_superinterfaces_in_type_declaration" value="16"/>
<setting id="org.eclipse.jdt.core.formatter.alignment_for_binary_expression" value="16"/>
<setting id="org.eclipse.jdt.core.formatter.brace_position_for_enum_declaration" value="end_of_line"/>
<setting id="org.eclipse.jdt.core.formatter.insert_new_line_after_annotation_on_type" value="insert"/>
<setting id="org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_while" value="do not insert"/>
<setting id="org.eclipse.jdt.core.compiler.codegen.inlineJsrBytecode" value="enabled"/>
<setting id="org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_try" value="insert"/>
<setting id="org.eclipse.jdt.core.formatter.put_empty_statement_on_new_line" value="true"/>
<setting id="org.eclipse.jdt.core.formatter.insert_new_line_after_label" value="do not insert"/>
<setting id="org.eclipse.jdt.core.formatter.insert_new_line_after_annotation_on_parameter" value="do not insert"/>
<setting id="org.eclipse.jdt.core.formatter.insert_space_after_opening_angle_bracket_in_type_parameters" value="do not insert"/>
<setting id="org.eclipse.jdt.core.formatter.insert_space_between_empty_parens_in_method_invocation" value="do not insert"/>
<setting id="org.eclipse.jdt.core.formatter.insert_new_line_before_while_in_do_statement" value="do not insert"/>
<setting id="org.eclipse.jdt.core.formatter.alignment_for_arguments_in_enum_constant" value="16"/>
<setting id="org.eclipse.jdt.core.formatter.comment.format_javadoc_comments" value="true"/>
<setting id="org.eclipse.jdt.core.formatter.comment.line_length" value="80"/>
<setting id="org.eclipse.jdt.core.formatter.insert_new_line_after_annotation_on_package" value="insert"/>
<setting id="org.eclipse.jdt.core.formatter.blank_lines_between_import_groups" value="1"/>
<setting id="org.eclipse.jdt.core.formatter.insert_space_before_comma_in_enum_constant_arguments" value="do not insert"/>
<setting id="org.eclipse.jdt.core.formatter.insert_space_before_semicolon" value="do not insert"/>
<setting id="org.eclipse.jdt.core.formatter.brace_position_for_constructor_declaration" value="end_of_line"/>
<setting id="org.eclipse.jdt.core.formatter.number_of_blank_lines_at_beginning_of_method_body" value="0"/>
<setting id="org.eclipse.jdt.core.formatter.insert_space_before_colon_in_conditional" value="insert"/>
<setting id="org.eclipse.jdt.core.formatter.indent_body_declarations_compare_to_type_header" value="true"/>
<setting id="org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_annotation_type_member_declaration" value="do not insert"/>
<setting id="org.eclipse.jdt.core.formatter.wrap_before_binary_operator" value="true"/>
<setting id="org.eclipse.jdt.core.formatter.indent_body_declarations_compare_to_enum_declaration_header" value="true"/>
<setting id="org.eclipse.jdt.core.formatter.blank_lines_between_type_declarations" value="1"/>
<setting id="org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_synchronized" value="do not insert"/>
<setting id="org.eclipse.jdt.core.formatter.indent_statements_compare_to_block" value="true"/>
<setting id="org.eclipse.jdt.core.formatter.alignment_for_superinterfaces_in_enum_declaration" value="16"/>
<setting id="org.eclipse.jdt.core.formatter.join_lines_in_comments" value="true"/>
<setting id="org.eclipse.jdt.core.formatter.insert_space_before_question_in_conditional" value="insert"/>
<setting id="org.eclipse.jdt.core.formatter.insert_space_before_comma_in_multiple_field_declarations" value="do not insert"/>
<setting id="org.eclipse.jdt.core.formatter.alignment_for_compact_if" value="16"/>
<setting id="org.eclipse.jdt.core.formatter.insert_space_after_comma_in_for_inits" value="insert"/>
<setting id="org.eclipse.jdt.core.formatter.indent_switchstatements_compare_to_cases" value="true"/>
<setting id="org.eclipse.jdt.core.formatter.insert_space_after_comma_in_array_initializer" value="insert"/>
<setting id="org.eclipse.jdt.core.formatter.insert_space_before_colon_in_default" value="do not insert"/>
<setting id="org.eclipse.jdt.core.formatter.insert_space_before_and_in_type_parameter" value="insert"/>
<setting id="org.eclipse.jdt.core.formatter.insert_space_between_empty_parens_in_constructor_declaration" value="do not insert"/>
<setting id="org.eclipse.jdt.core.formatter.blank_lines_before_imports" value="1"/>
<setting id="org.eclipse.jdt.core.formatter.insert_space_after_colon_in_assert" value="insert"/>
<setting id="org.eclipse.jdt.core.formatter.comment.format_html" value="true"/>
<setting id="org.eclipse.jdt.core.formatter.alignment_for_throws_clause_in_method_declaration" value="16"/>
<setting id="org.eclipse.jdt.core.formatter.insert_space_before_closing_angle_bracket_in_type_parameters" value="do not insert"/>
<setting id="org.eclipse.jdt.core.formatter.insert_space_before_opening_bracket_in_array_allocation_expression" value="do not insert"/>
<setting id="org.eclipse.jdt.core.formatter.insert_new_line_in_empty_anonymous_type_declaration" value="insert"/>
<setting id="org.eclipse.jdt.core.formatter.insert_space_after_colon_in_conditional" value="insert"/>
<setting id="org.eclipse.jdt.core.formatter.insert_space_after_opening_angle_bracket_in_parameterized_type_reference" value="do not insert"/>
<setting id="org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_for" value="do not insert"/>
<setting id="org.eclipse.jdt.core.formatter.insert_space_before_postfix_operator" value="do not insert"/>
<setting id="org.eclipse.jdt.core.formatter.comment.format_source_code" value="true"/>
<setting id="org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_synchronized" value="insert"/>
<setting id="org.eclipse.jdt.core.formatter.insert_space_after_comma_in_allocation_expression" value="insert"/>
<setting id="org.eclipse.jdt.core.formatter.insert_space_after_comma_in_constructor_declaration_throws" value="insert"/>
<setting id="org.eclipse.jdt.core.formatter.alignment_for_parameters_in_method_declaration" value="16"/>
<setting id="org.eclipse.jdt.core.formatter.insert_space_before_closing_brace_in_array_initializer" value="insert"/>
<setting id="org.eclipse.jdt.core.compiler.codegen.targetPlatform" value="1.7"/>
<setting id="org.eclipse.jdt.core.formatter.alignment_for_resources_in_try" value="80"/>
<setting id="org.eclipse.jdt.core.formatter.use_tabs_only_for_leading_indentations" value="true"/>
<setting id="org.eclipse.jdt.core.formatter.alignment_for_arguments_in_annotation" value="0"/>
<setting id="org.eclipse.jdt.core.formatter.comment.format_header" value="false"/>
<setting id="org.eclipse.jdt.core.formatter.comment.format_block_comments" value="true"/>
<setting id="org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_enum_constant" value="do not insert"/>
<setting id="org.eclipse.jdt.core.formatter.alignment_for_enum_constants" value="0"/>
<setting id="org.eclipse.jdt.core.formatter.insert_new_line_in_empty_block" value="insert"/>
<setting id="org.eclipse.jdt.core.formatter.indent_body_declarations_compare_to_annotation_declaration_header" value="true"/>
<setting id="org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_parenthesized_expression" value="do not insert"/>
<setting id="org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_parenthesized_expression" value="do not insert"/>
<setting id="org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_catch" value="do not insert"/>
<setting id="org.eclipse.jdt.core.formatter.insert_space_before_comma_in_multiple_local_declarations" value="do not insert"/>
<setting id="org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_switch" value="insert"/>
<setting id="org.eclipse.jdt.core.formatter.insert_space_before_comma_in_for_increments" value="do not insert"/>
<setting id="org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_method_invocation" value="do not insert"/>
<setting id="org.eclipse.jdt.core.formatter.insert_space_before_colon_in_assert" value="insert"/>
<setting id="org.eclipse.jdt.core.formatter.brace_position_for_type_declaration" value="end_of_line"/>
<setting id="org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_array_initializer" value="insert"/>
<setting id="org.eclipse.jdt.core.formatter.insert_space_between_empty_braces_in_array_initializer" value="do not insert"/>
<setting id="org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_method_declaration" value="do not insert"/>
<setting id="org.eclipse.jdt.core.formatter.insert_space_before_semicolon_in_for" value="do not insert"/>
<setting id="org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_catch" value="insert"/>
<setting id="org.eclipse.jdt.core.formatter.insert_space_before_opening_angle_bracket_in_parameterized_type_reference" value="do not insert"/>
<setting id="org.eclipse.jdt.core.formatter.insert_space_after_comma_in_multiple_field_declarations" value="insert"/>
<setting id="org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_annotation" value="do not insert"/>
<setting id="org.eclipse.jdt.core.formatter.insert_space_after_comma_in_parameterized_type_reference" value="insert"/>
<setting id="org.eclipse.jdt.core.formatter.insert_space_after_comma_in_method_invocation_arguments" value="insert"/>
<setting id="org.eclipse.jdt.core.formatter.comment.new_lines_at_javadoc_boundaries" value="true"/>
<setting id="org.eclipse.jdt.core.formatter.blank_lines_after_imports" value="1"/>
<setting id="org.eclipse.jdt.core.formatter.insert_space_after_comma_in_multiple_local_declarations" value="insert"/>
<setting id="org.eclipse.jdt.core.formatter.indent_body_declarations_compare_to_enum_constant_header" value="true"/>
<setting id="org.eclipse.jdt.core.formatter.insert_space_after_semicolon_in_for" value="insert"/>
<setting id="org.eclipse.jdt.core.formatter.never_indent_line_comments_on_first_column" value="false"/>
<setting id="org.eclipse.jdt.core.formatter.insert_space_before_semicolon_in_try_resources" value="do not insert"/>
<setting id="org.eclipse.jdt.core.formatter.insert_space_before_opening_angle_bracket_in_type_arguments" value="do not insert"/>
<setting id="org.eclipse.jdt.core.formatter.never_indent_block_comments_on_first_column" value="false"/>
<setting id="org.eclipse.jdt.core.formatter.keep_then_statement_on_same_line" value="false"/>
</profile>
</profiles>

View file

@ -22,22 +22,25 @@ import org.rometools.feed.module.activitystreams.types.Mood;
import org.rometools.feed.module.activitystreams.types.Verb; import org.rometools.feed.module.activitystreams.types.Verb;
/** /**
* *
* @author robert.cooper * @author robert.cooper
*/ */
public interface ActivityStreamModule { public interface ActivityStreamModule {
public Verb getVerb(); public Verb getVerb();
public void setVerb(Verb verb); public void setVerb(Verb verb);
public ActivityObject getObject(); public ActivityObject getObject();
public void setObject(ActivityObject object); public void setObject(ActivityObject object);
public ActivityObject getTarget(); public ActivityObject getTarget();
public void setTarget(ActivityObject object); public void setTarget(ActivityObject object);
public Mood getMood(); public Mood getMood();
public void setMood(Mood mood); public void setMood(Mood mood);
} }

View file

@ -20,9 +20,8 @@ import org.rometools.feed.module.activitystreams.types.ActivityObject;
import org.rometools.feed.module.activitystreams.types.Mood; import org.rometools.feed.module.activitystreams.types.Mood;
import org.rometools.feed.module.activitystreams.types.Verb; import org.rometools.feed.module.activitystreams.types.Verb;
/** /**
* *
* @author robert.cooper * @author robert.cooper
*/ */
public class ActivityStreamModuleImpl implements ActivityStreamModule { public class ActivityStreamModuleImpl implements ActivityStreamModule {
@ -31,53 +30,53 @@ public class ActivityStreamModuleImpl implements ActivityStreamModule {
/** /**
* Set the value of object * Set the value of object
* *
* @param newobject new value of object * @param newobject new value of object
*/ */
public void setObject(ActivityObject newobject) { public void setObject(final ActivityObject newobject) {
this.object = newobject; object = newobject;
} }
/** /**
* Get the value of object * Get the value of object
* *
* @return the value of object * @return the value of object
*/ */
public ActivityObject getObject() { public ActivityObject getObject() {
return this.object; return object;
} }
/** /**
* Set the value of verb * Set the value of verb
* *
* @param newverb new value of verb * @param newverb new value of verb
*/ */
public void setVerb(Verb newverb) { public void setVerb(final Verb newverb) {
this.verb = newverb; verb = newverb;
} }
/** /**
* Get the value of verb * Get the value of verb
* *
* @return the value of verb * @return the value of verb
*/ */
public Verb getVerb() { public Verb getVerb() {
return this.verb; return verb;
} }
public ActivityObject getTarget() { public ActivityObject getTarget() {
throw new UnsupportedOperationException("Not supported yet."); throw new UnsupportedOperationException("Not supported yet.");
} }
public void setTarget(ActivityObject object) { public void setTarget(final ActivityObject object) {
throw new UnsupportedOperationException("Not supported yet."); throw new UnsupportedOperationException("Not supported yet.");
} }
public Mood getMood() { public Mood getMood() {
throw new UnsupportedOperationException("Not supported yet."); throw new UnsupportedOperationException("Not supported yet.");
} }
public void setMood(Mood mood) { public void setMood(final Mood mood) {
throw new UnsupportedOperationException("Not supported yet."); throw new UnsupportedOperationException("Not supported yet.");
} }
} }

View file

@ -17,32 +17,33 @@
package org.rometools.feed.module.activitystreams.types; package org.rometools.feed.module.activitystreams.types;
import com.sun.syndication.feed.atom.Entry;
import org.rometools.feed.module.georss.GeoRSSModule; import org.rometools.feed.module.georss.GeoRSSModule;
import org.rometools.feed.module.portablecontacts.ContactModule; import org.rometools.feed.module.portablecontacts.ContactModule;
import com.sun.syndication.feed.atom.Entry;
/** /**
* *
* @author robert.cooper * @author robert.cooper
*/ */
public abstract class ActivityObject extends Entry implements HasLocation { public abstract class ActivityObject extends Entry implements HasLocation {
public abstract String getTypeIRI(); public abstract String getTypeIRI();
public GeoRSSModule getLocation() { public GeoRSSModule getLocation() {
throw new UnsupportedOperationException("Not supported yet."); throw new UnsupportedOperationException("Not supported yet.");
} }
public void setLocation(GeoRSSModule location) { public void setLocation(final GeoRSSModule location) {
throw new UnsupportedOperationException("Not supported yet."); throw new UnsupportedOperationException("Not supported yet.");
} }
public ContactModule getAddress(){ public ContactModule getAddress() {
throw new UnsupportedOperationException("Not supported yet."); throw new UnsupportedOperationException("Not supported yet.");
} }
public void setAddress(ContactModule address){ public void setAddress(final ContactModule address) {
throw new UnsupportedOperationException("Not supported yet."); throw new UnsupportedOperationException("Not supported yet.");
} }
} }

View file

@ -16,33 +16,31 @@
*/ */
package org.rometools.feed.module.activitystreams.types; package org.rometools.feed.module.activitystreams.types;
/** /**
* <p>The "article" Object type indicates that the Object is an * <p>
* article, such as a news article, a knowledge base entry, or other * The "article" Object type indicates that the Object is an article, such as a news article, a knowledge base entry, or other similar construct.
* similar construct. * </p>
*</p> * <p>
*<p>Articles generally consist of paragraphs of text, in some cases * Articles generally consist of paragraphs of text, in some cases incorporating embedded media such as photos and inline hyperlinks to other resources.
* incorporating embedded media such as photos and inline hyperlinks to * </p>
* other resources. * <p>
*</p> * The "Article" Object type is identified by the URL <tt>http://activitystrea.ms/schema/1.0/article</tt>.
*<p>The "Article" Object type is identified by the URL <tt>http://activitystrea.ms/schema/1.0/article</tt>. * </p>
*</p> * <p>
*<p>An article has the following additional components: * An article has the following additional components:
*</p> * </p>
*<p></p> * <p>
*<blockquote class="text"><dl> * </p>
*<dt>Name</dt> * <blockquote class="text">
*<dd>The title of the article. Represented by the * <dl>
* Name component of the base Object Construct. * <dt>Name</dt>
*</dd> * <dd>The title of the article. Represented by the Name component of the base Object Construct.</dd>
*<dt>Content</dt> * <dt>Content</dt>
*<dd>The main body content of the article. * <dd>The main body content of the article. Represented in JSON as a property called <tt>content</tt> whose value is a JSON string containing a fragment of
* Represented in JSON as a property called <tt>content</tt> * HTML that represents the content.</dd>
* whose value is a JSON string containing a fragment of HTML that * </dl>
* represents the content. * </blockquote>
*</dd> *
*</dl></blockquote>
* @author robert.cooper * @author robert.cooper
*/ */
public class Article extends ActivityObject { public class Article extends ActivityObject {

View file

@ -16,30 +16,28 @@
*/ */
package org.rometools.feed.module.activitystreams.types; package org.rometools.feed.module.activitystreams.types;
/** /**
* <p>The "audio" Object type represents audio content. * <p>
*</p> * The "audio" Object type represents audio content.
*<p>The "audio" Object type is identified by the URI <tt>http://activitystrea.ms/schema/1.0/audio</tt>. * </p>
*</p> * <p>
*<p>An audio has the following additional components: * The "audio" Object type is identified by the URI <tt>http://activitystrea.ms/schema/1.0/audio</tt>.
*</p> * </p>
*<p></p> * <p>
*<blockquote class="text"><dl> * An audio has the following additional components:
*<dt>Audio Stream Link</dt> * </p>
*<dd>A Media Link Construct linking * <p>
* to the audio content itself. Represented in JSON as a property * </p>
* called <tt>stream</tt> whose value is a JSON * <blockquote class="text">
* object with properties as defined in [TODO: xref the JSON * <dl>
* serialization of a Media Link Construct] * <dt>Audio Stream Link</dt>
*</dd> * <dd>A Media Link Construct linking to the audio content itself. Represented in JSON as a property called <tt>stream</tt> whose value is a JSON object with
*<dt>Embed Code</dt> * properties as defined in [TODO: xref the JSON serialization of a Media Link Construct]</dd>
*<dd>An HTML fragment that, when embedded in * <dt>Embed Code</dt>
* an HTML page, will provide an interactive player UI for the * <dd>An HTML fragment that, when embedded in an HTML page, will provide an interactive player UI for the audio stream. Represented in JSON as a property
* audio stream. Represented in JSON as a property called <tt>embedCode</tt> whose value is a JSON string * called <tt>embedCode</tt> whose value is a JSON string containing the fragment of HTML.</dd>
* containing the fragment of HTML. * </dl>
*</dd> *
*</dl>
* @author robert.cooper * @author robert.cooper
*/ */
public class Audio extends ActivityObject { public class Audio extends ActivityObject {
@ -48,38 +46,38 @@ public class Audio extends ActivityObject {
/** /**
* Set the value of embedCode * Set the value of embedCode
* *
* @param newembedCode new value of embedCode * @param newembedCode new value of embedCode
*/ */
public void setEmbedCode(String newembedCode) { public void setEmbedCode(final String newembedCode) {
this.embedCode = newembedCode; embedCode = newembedCode;
} }
/** /**
* Get the value of embedCode * Get the value of embedCode
* *
* @return the value of embedCode * @return the value of embedCode
*/ */
public String getEmbedCode() { public String getEmbedCode() {
return this.embedCode; return embedCode;
} }
/** /**
* Set the value of streamLink * Set the value of streamLink
* *
* @param newstreamLink new value of streamLink * @param newstreamLink new value of streamLink
*/ */
public void setStreamLink(String newstreamLink) { public void setStreamLink(final String newstreamLink) {
this.streamLink = newstreamLink; streamLink = newstreamLink;
} }
/** /**
* Get the value of streamLink * Get the value of streamLink
* *
* @return the value of streamLink * @return the value of streamLink
*/ */
public String getStreamLink() { public String getStreamLink() {
return this.streamLink; return streamLink;
} }
@Override @Override

View file

@ -19,62 +19,49 @@ package org.rometools.feed.module.activitystreams.types;
import com.sun.syndication.feed.atom.Link; import com.sun.syndication.feed.atom.Link;
/** /**
* <p>The "bookmark" Object type represents a pointer to some URL -- * <p>
* typically a web page. In most cases, a bookmark is specific to a * The "bookmark" Object type represents a pointer to some URL -- typically a web page. In most cases, a bookmark is specific to a given user and contains
* given user and contains metadata chosen by that user. Bookmark * metadata chosen by that user. Bookmark Objects are similar in principle to the concept of bookmarks or favorites in a web browser. A bookmark represents a
* Objects are similar in principle to the concept of bookmarks or * pointer to the URL, not the URL or the associated resource itself.
* favorites in a web browser. A bookmark represents a pointer to the * </p>
* URL, not the URL or the associated resource itself. * <p>
*</p> * When dealing with bookmarks it is important to note the distinction between the title, description, and URL of the bookmark itself and the title, content,
*<p>When dealing with bookmarks it is important to note the * and URL of the resource that is the target of the bookmark. In some implementations these MAY be the same, but bookmark managers often allow a user to edit
* distinction between the title, description, and URL of the bookmark * the title and description of his or her own bookmarks to differ from the metadata on the target itself.
* itself and the title, content, and URL of the resource that is the * </p>
* target of the bookmark. In some implementations these MAY be the * <p>
* same, but bookmark managers often allow a user to edit the title and * Some implementations refer to this Object type as a "link". This specification uses the term "bookmark" to avoid confusion with the general concept of
* description of his or her own bookmarks to differ from the metadata * hyperlinks which apply to all Object types.
* on the target itself. * </p>
*</p> * <p>
*<p>Some implementations refer to this Object type as a "link". This * Since bookmarks are often specific to a particular user, even though multiple users might have bookmarks pointing at the same resource, it is appropriate to
* specification uses the term "bookmark" to avoid confusion with the * use the "post" Verb to describe the publication of such a bookmark. The "mark as favorite" Verb SHOULD be used when a user flags another user's bookmark as
* general concept of hyperlinks which apply to all Object types. * being a favorite without creating his own bookmark, or when a user flags his own bookmark as being a favorite as a special classification within his own
*</p> * bookmark collection.
*<p>Since bookmarks are often specific to a particular user, even * </p>
* though multiple users might have bookmarks pointing at the same * <p>
* resource, it is appropriate to use the "post" Verb to describe the * The "bookmark" Object type is identified by the URI <tt>http://activitystrea.ms/schema/1.0/bookmark</tt>.
* publication of such a bookmark. The "mark as favorite" Verb SHOULD * </p>
* be used when a user flags another user's bookmark as being a * <p>
* favorite without creating his own bookmark, or when a user flags his * A bookmark has the following additional components:
* own bookmark as being a favorite as a special classification within * </p>
* his own bookmark collection. * <p>
*</p> * </p>
*<p>The "bookmark" Object type is identified by the URI <tt>http://activitystrea.ms/schema/1.0/bookmark</tt>. * <blockquote class="text">
*</p> * <dl>
*<p>A bookmark has the following additional components: * <dt>Title</dt>
*</p> * <dd>The title of the bookmark, as entered by the user who created the bookmark. Represented by the Name component of the base Object Construct. Publishers
*<p></p> * MAY use the title of the target resource as a default for this property where a user hasn't entered a customized value.</dd>
*<blockquote class="text"><dl> * <dt>Target URL</dt>
*<dt>Title</dt> * <dd>The URL of the item that is the target of the bookmark. Represented in JSON by a property called <tt>targetUrl</tt> whose value is a JSON string
*<dd>The title of the bookmark, as entered by the * containing the target URL.</dd>
* user who created the bookmark. Represented by the Name component * <dt>Thumbnail</dt>
* of the base Object Construct. Publishers MAY use the title of * <dd>The URL and metadata for a thumbnail version of the page. Represented by the Representative Image component of the base Object Construct. Processors MAY
* the target resource as a default for this property where a user * ignore thumbnails that are of an inappropriate size for their user interface.</dd>
* hasn't entered a customized value. * </dl>
*</dd> * </blockquote>
*<dt>Target URL</dt> *
*<dd>The URL of the item that is the target
* of the bookmark. Represented in JSON by a property called <tt>targetUrl</tt> whose value is a JSON string
* containing the target URL.
*</dd>
*<dt>Thumbnail</dt>
*<dd>The URL and metadata for a thumbnail
* version of the page. Represented by the Representative Image
* component of the base Object Construct. Processors MAY ignore
* thumbnails that are of an inappropriate size for their user
* interface.
*</dd>
*</dl></blockquote>
* @author robert.cooper * @author robert.cooper
*/ */
public class Bookmark extends ActivityObject { public class Bookmark extends ActivityObject {
@ -84,36 +71,33 @@ public class Bookmark extends ActivityObject {
return "http://activitystrea.ms/schema/1.0/bookmark"; return "http://activitystrea.ms/schema/1.0/bookmark";
} }
/** /**
* Get the value of thumbnail * Get the value of thumbnail
* *
* @return the value of thumbnail * @return the value of thumbnail
*/ */
public Link getThumbnail() { public Link getThumbnail() {
return this.findRelatedLink("thumbnail"); return findRelatedLink("thumbnail");
} }
/** /**
* Set the value of thumbnail * Set the value of thumbnail
* *
* @param newthumbnail new value of thumbnail * @param newthumbnail new value of thumbnail
*/ */
public void setThumbnail(Link newthumbnail) { public void setThumbnail(final Link newthumbnail) {
Link old = null; Link old = null;
for(Link l : this.getOtherLinks()){ for (final Link l : getOtherLinks()) {
if("thumbnail".equals(l.getRel())){ if ("thumbnail".equals(l.getRel())) {
old = l; old = l;
break; break;
} }
} }
if(old != null){ if (old != null) {
this.getOtherLinks().remove(old); getOtherLinks().remove(old);
newthumbnail.setRel("thumbnail"); newthumbnail.setRel("thumbnail");
} }
this.getOtherLinks().add(newthumbnail); getOtherLinks().add(newthumbnail);
} }
} }

View file

@ -18,37 +18,33 @@
package org.rometools.feed.module.activitystreams.types; package org.rometools.feed.module.activitystreams.types;
/** /**
* <p>The "comment" object type represents a textual response to * <p>
* another object. * The "comment" object type represents a textual response to another object.
*</p> * </p>
*<p>The comment object type MUST NOT be used for other kinds of * <p>
* replies, such as video replies or reviews. * The comment object type MUST NOT be used for other kinds of replies, such as video replies or reviews.
*</p> * </p>
*<p>The "comment" object type is identified by the URI <tt>http://activitystrea.ms/schema/1.0/comment</tt>. * <p>
*</p> * The "comment" object type is identified by the URI <tt>http://activitystrea.ms/schema/1.0/comment</tt>.
*<p>A comment has the following additional components: * </p>
*</p> * <p>
*<p></p> * A comment has the following additional components:
*<blockquote class="text"><dl> * </p>
*<dt>Subject</dt> * <p>
*<dd>The subject of the comment. Represented by * </p>
* the Name component of the base Object Construct. Many systems do * <blockquote class="text">
* not have the concept of a title or subject for a comment; such * <dl>
* systems MUST omit the Name component. Processors SHOULD refer to * <dt>Subject</dt>
* such comments as simply being "a comment", with appropriate * <dd>The subject of the comment. Represented by the Name component of the base Object Construct. Many systems do not have the concept of a title or subject
* localization, if they are to be described in a sentence. * for a comment; such systems MUST omit the Name component. Processors SHOULD refer to such comments as simply being "a comment", with appropriate
*</dd> * localization, if they are to be described in a sentence.</dd>
*<dt>Content</dt> * <dt>Content</dt>
*<dd>The content of the comment. Represented in * <dd>The content of the comment. Represented in JSON as a property called <tt>content</tt> whose value is a JSON string containing a fragment of HTML that
* JSON as a property called <tt>content</tt> * represents the content. Publishers SHOULD include any markup necessary to achieve a similar presentation to that on the publisher's own HTML pages, including
* whose value is a JSON string containing a fragment of HTML that * any links that the service automatically adds. Processors MAY remove all HTML markup and consider the comment to be plain text.</dd>
* represents the content. Publishers SHOULD include any markup * </dl>
* necessary to achieve a similar presentation to that on the * </blockquote>
* publisher's own HTML pages, including any links that the service *
* automatically adds. Processors MAY remove all HTML markup and
* consider the comment to be plain text.
*</dd>
*</dl></blockquote>
* @author robert.cooper * @author robert.cooper
*/ */
public class Comment extends ActivityObject { public class Comment extends ActivityObject {

View file

@ -18,31 +18,28 @@
package org.rometools.feed.module.activitystreams.types; package org.rometools.feed.module.activitystreams.types;
/** /**
* <p>The "event" object type represents an event that occurs in a * <p>
* certain place during a particular interval of time. * The "event" object type represents an event that occurs in a certain place during a particular interval of time.
*</p> * </p>
*<p>The object type URL for the "event" object type is <tt>http://activitystrea.ms/schema/1.0/event</tt>. * <p>
*</p> * The object type URL for the "event" object type is <tt>http://activitystrea.ms/schema/1.0/event</tt>.
*<p>An event has the following additional components: * </p>
*</p> * <p>
*<p></p> * An event has the following additional components:
*<blockquote class="text"><dl> * </p>
*<dt>Start Date and Time</dt> * <p>
*<dd>The date and time that the * </p>
* event begins. Represented in JSON as a property called <tt>startTime</tt> whose value is JSON string * <blockquote class="text">
* containing a W3CDTF timestamp. [TODO: Reference W3CDTF spec.] * <dl>
* [TODO: Include prose describing how to represent just a date vs. * <dt>Start Date and Time</dt>
* a date and time.] * <dd>The date and time that the event begins. Represented in JSON as a property called <tt>startTime</tt> whose value is JSON string containing a W3CDTF
*</dd> * timestamp. [TODO: Reference W3CDTF spec.] [TODO: Include prose describing how to represent just a date vs. a date and time.]</dd>
*<dt>End Date and Time</dt> * <dt>End Date and Time</dt>
*<dd>The date and time that the event * <dd>The date and time that the event ends. Represented in JSON as a property called <tt>endTime</tt> whose value is JSON string containing a W3CDTF
* ends. Represented in JSON as a property called <tt>endTime</tt> whose value is JSON string * timestamp. [TODO: Reference W3CDTF spec.] [TODO: Include prose describing how to represent just a date vs. a date and time.]</dd>
* containing a W3CDTF timestamp. [TODO: Reference W3CDTF spec.] * </dl>
* [TODO: Include prose describing how to represent just a date vs. * </blockquote>
* a date and time.] *
*</dd>
*</dl></blockquote>
*
* @author robert.cooper * @author robert.cooper
*/ */
public class Event extends ActivityObject { public class Event extends ActivityObject {

View file

@ -18,33 +18,32 @@
package org.rometools.feed.module.activitystreams.types; package org.rometools.feed.module.activitystreams.types;
/** /**
* <p>The "file" Object type represents some document or other file * <p>
* with no additional machine-readable semantics. * The "file" Object type represents some document or other file with no additional machine-readable semantics.
*</p> * </p>
*<p>It is intended that this type be used as a base type for other * <p>
* Objects that manifest as files, so that additional semantics can be * It is intended that this type be used as a base type for other Objects that manifest as files, so that additional semantics can be added while providing a
* added while providing a fallback ability for clients that do not * fallback ability for clients that do not support the more specific Object type.
* support the more specific Object type. * </p>
*</p> * <p>
*<p>The "file" Object type is identified by the URI <tt>http://activitystrea.ms/schema/1.0/file</tt>. * The "file" Object type is identified by the URI <tt>http://activitystrea.ms/schema/1.0/file</tt>.
*</p> * </p>
*<p>A file has the following additional components: * <p>
*</p> * A file has the following additional components:
*<p></p> * </p>
*<blockquote class="text"><dl> * <p>
*<dt>Associated File URL</dt> * </p>
*<dd>The URL of the file described * <blockquote class="text">
* by this Object Construct. Represented in JSON by a property * <dl>
* called <tt>fileUrl</tt> whose value is a JSON * <dt>Associated File URL</dt>
* string containing the URL. * <dd>The URL of the file described by this Object Construct. Represented in JSON by a property called <tt>fileUrl</tt> whose value is a JSON string containing
*</dd> * the URL.</dd>
*<dt>File MIME Type</dt> * <dt>File MIME Type</dt>
*<dd>The MIME type of the file described * <dd>The MIME type of the file described by this Object Construct. Represented in JSON by a property called <tt>mimeType</tt> whose value is a JSON string
* by this Object Construct. Represented in JSON by a property * containing the MIME type.</dd>
* called <tt>mimeType</tt> whose value is a * </dl>
* JSON string containing the MIME type. * </blockquote>
*</dd> *
*</dl></blockquote>
* @author robert.cooper * @author robert.cooper
*/ */
public class File extends ActivityObject { public class File extends ActivityObject {
@ -54,6 +53,4 @@ public class File extends ActivityObject {
return "http://activitystrea.ms/schema/1.0/file"; return "http://activitystrea.ms/schema/1.0/file";
} }
} }

View file

@ -18,32 +18,33 @@
package org.rometools.feed.module.activitystreams.types; package org.rometools.feed.module.activitystreams.types;
/** /**
* <p>The "folder" object type represents a collection of files or * <p>
* media objects. This is similar to the "photo album" object type, but * The "folder" object type represents a collection of files or media objects. This is similar to the "photo album" object type, but not specifically
* not specifically representing a collection of "photos." * representing a collection of "photos."
*</p> * </p>
*<p>The "folder" object type is identified by the URI <tt>http://activitystrea.ms/schema/1.0/folder</tt>. * <p>
*</p> * The "folder" object type is identified by the URI <tt>http://activitystrea.ms/schema/1.0/folder</tt>.
*<p>A folder has the following additional components: * </p>
*</p> * <p>
*<p></p> * A folder has the following additional components:
*<blockquote class="text"><dl> * </p>
*<dt>Preview Image Link</dt> * <p>
*<dd>A Media Link Construct * </p>
* describing an image file that can be used as a preview image for * <blockquote class="text">
* the folder. Represented by the Representative Image component of * <dl>
* the base Object Construct. Processors MAY ignore thumbnails that * <dt>Preview Image Link</dt>
* are of an inappropriate size for their user interface. * <dd>A Media Link Construct describing an image file that can be used as a preview image for the folder. Represented by the Representative Image component of
*</dd> * the base Object Construct. Processors MAY ignore thumbnails that are of an inappropriate size for their user interface.</dd>
*</dl></blockquote> * </dl>
* </blockquote>
*
* @author robert.cooper * @author robert.cooper
*/ */
public class Folder extends ActivityObject{ public class Folder extends ActivityObject {
@Override @Override
public String getTypeIRI() { public String getTypeIRI() {
return "http://activitystrea.ms/schema/1.0/folder"; return "http://activitystrea.ms/schema/1.0/folder";
} }
} }

View file

@ -18,13 +18,15 @@
package org.rometools.feed.module.activitystreams.types; package org.rometools.feed.module.activitystreams.types;
/** /**
* <p>The "group" Object type represents a social networking group. A * <p>
* group is a collection of people which people can join and leave. * The "group" Object type represents a social networking group. A group is a collection of people which people can join and leave.
*</p> * </p>
*<p>The "group" Object type is identified by the URI <tt>http://activitystrea.ms/schema/1.0/group</tt>. * <p>
*</p> * The "group" Object type is identified by the URI <tt>http://activitystrea.ms/schema/1.0/group</tt>.
*<p>A group has no additional components. * </p>
* <p>
* A group has no additional components.
*
* @author robert.cooper * @author robert.cooper
*/ */
public class Group { public class Group {

View file

@ -21,64 +21,74 @@ import org.rometools.feed.module.georss.GeoRSSModule;
import org.rometools.feed.module.portablecontacts.ContactModule; import org.rometools.feed.module.portablecontacts.ContactModule;
/** /**
* <p>Location is a concept which can be used inside the atom:entry * <p>
* level, atom:author and activity:object. Location can be specified * Location is a concept which can be used inside the atom:entry level, atom:author and activity:object. Location can be specified via geographic coordinates, a
* via geographic coordinates, a street address, a free-form location * street address, a free-form location name or a combination of these. Geographic coordinates should be included as a geo:point element as described by the
* name or a combination of these. Geographic coordinates should be * GeoRSS specification. Addresses should be included using a poco:address element defined at Portable Contacts specification. The entry level location
* included as a geo:point element as described by the GeoRSS * represents the location of the author at the time the activity was performed. The author level location represents the primary location of the author.
* specification. Addresses should be included using a poco:address * Finally, the location within other objects represents the physical location of those objects. All location fields are optional. For free form addresses use
* element defined at Portable Contacts specification. The entry level * the poco:formatted field.
* location represents the location of the author at the time the * </p>
* activity was performed. The author level location represents the * <p>
* primary location of the author. Finally, the location within other * <a class='info' href='#location-poco'>Figure&nbsp;1<span> (</span><span class='info'>Location Example</span><span>)</span></a>
* objects represents the physical location of those objects. All * </p>
* location fields are optional. For free form addresses use the * <p>
* poco:formatted field. * <br />
*</p> * <hr class="insert" />
*<p><a class='info' href='#location-poco'>Figure&nbsp;1<span> (</span><span class='info'>Location Example</span><span>)</span></a> * <a name="location-poco"></a>
*</p> * </p>
*<p><br /><hr class="insert" /> * <div style='display: table; width: 0; margin-left: 3em; margin-right: auto'>
*<a name="location-poco"></a> *
*</p> * <pre>
*<div style='display: table; width: 0; margin-left: 3em; margin-right: auto'><pre>&lt;entry&gt; * &lt;entry&gt;
* &lt;id&gt;tag:world:activity:1212121212121&lt;/id&gt; * &lt;id&gt;tag:world:activity:1212121212121&lt;/id&gt;
* &lt;title&gt;Rob liked Goldeberg's Deli&lt;/title&gt; * &lt;title&gt;Rob liked Goldeberg's Deli&lt;/title&gt;
* &lt;author&gt; * &lt;author&gt;
* &lt;name&gt;Rob Dolin&lt;/name&gt; * &lt;name&gt;Rob Dolin&lt;/name&gt;
* &lt;id&gt;tag:world:person:1212121212121&lt;/id&gt; * &lt;id&gt;tag:world:person:1212121212121&lt;/id&gt;
* &lt;link rel="alternate" type="text/html" href="http://robdolin.com" /&gt; * &lt;link rel="alternate" type="text/html" href="http://robdolin.com" /&gt;
* &lt;poco:address&gt; * &lt;poco:address&gt;
* &lt;poco:locality&gt;Marina del Rey&lt;/poco:locality&gt; * &lt;poco:locality&gt;Marina del Rey&lt;/poco:locality&gt;
* &lt;poco:region&gt;CA&lt;/poco:region&gt; * &lt;poco:region&gt;CA&lt;/poco:region&gt;
* &lt;poco:postalCode&gt;90292&lt;/poco:postalCode&gt; * &lt;poco:postalCode&gt;90292&lt;/poco:postalCode&gt;
* &lt;poco:country&gt;US&lt;/poco:country&gt; * &lt;poco:country&gt;US&lt;/poco:country&gt;
* &lt;/poco:address&gt; * &lt;/poco:address&gt;
* &lt;/author&gt; * &lt;/author&gt;
* &lt;activity:object&gt; * &lt;activity:object&gt;
* &lt;activity:object-type&gt;http://activitystrea.ms/schema/1.0/place&lt;/object-type&gt; * &lt;activity:object-type&gt;http://activitystrea.ms/schema/1.0/place&lt;/object-type&gt;
* &lt;id&gt;tag:world:place:1212121212121&lt;/id&gt; * &lt;id&gt;tag:world:place:1212121212121&lt;/id&gt;
* &lt;title&gt;Goldberg's Deli&lt;/title&gt; * &lt;title&gt;Goldberg's Deli&lt;/title&gt;
* &lt;link rel="alternate" type="text/html" href="http://www.deli.com" /&gt; * &lt;link rel="alternate" type="text/html" href="http://www.deli.com" /&gt;
* &lt;geo:point&gt;33.9777 -118.4351&lt;/geo:point&gt; * &lt;geo:point&gt;33.9777 -118.4351&lt;/geo:point&gt;
* &lt;poco:address&gt; * &lt;poco:address&gt;
* &lt;poco:streetAddress&gt;14016 Bora Bora Way&lt;/poco:streetAddress&gt; * &lt;poco:streetAddress&gt;14016 Bora Bora Way&lt;/poco:streetAddress&gt;
* &lt;poco:locality&gt;Marina del Rey&lt;/poco:locality&gt; * &lt;poco:locality&gt;Marina del Rey&lt;/poco:locality&gt;
* &lt;poco:region&gt;CA&lt;/poco:region&gt; * &lt;poco:region&gt;CA&lt;/poco:region&gt;
* &lt;poco:postalCode&gt;90292&lt;/poco:postalCode&gt; * &lt;poco:postalCode&gt;90292&lt;/poco:postalCode&gt;
* &lt;poco:country&gt;US&lt;/poco:country&gt; * &lt;poco:country&gt;US&lt;/poco:country&gt;
* &lt;/poco:address&gt; * &lt;/poco:address&gt;
* &lt;/activity:object&gt; * &lt;/activity:object&gt;
* &lt;geo:point&gt;33.9777 -119.4351&lt;/geo:point&gt; * &lt;geo:point&gt;33.9777 -119.4351&lt;/geo:point&gt;
* &lt;activity:verb&gt;http://activitystrea.ms/schema/1.0/like&lt;/activity:verb&gt; * &lt;activity:verb&gt;http://activitystrea.ms/schema/1.0/like&lt;/activity:verb&gt;
*&lt;/entry&gt;</pre></div><p> * &lt;/entry&gt;
*<table border="0" cellpadding="0" cellspacing="2" align="center"><tr><td align="center"><font face="monaco, MS Sans Serif" size="1"><b>&nbsp;Figure&nbsp;1: Location Example&nbsp;</b></font><br /></td></tr></table><hr class="insert" /> * </pre>
* *
*</p> * </div>
* <p>
* <table border="0" cellpadding="0" cellspacing="2" align="center">
* <tr>
* <td align="center"><font face="monaco, MS Sans Serif" size="1"><b>&nbsp;Figure&nbsp;1: Location Example&nbsp;</b></font><br />
* </td>
* </tr>
* </table>
* <hr class="insert" />
*
* </p>
*
* @author robert.cooper * @author robert.cooper
*/ */
public interface HasLocation { public interface HasLocation {
public GeoRSSModule getLocation(); public GeoRSSModule getLocation();
public void setLocation(GeoRSSModule location); public void setLocation(GeoRSSModule location);

View file

@ -18,18 +18,19 @@
package org.rometools.feed.module.activitystreams.types; package org.rometools.feed.module.activitystreams.types;
/** /**
*<p>The "list" object type represents a collection of related * <p>
* objects. * The "list" object type represents a collection of related objects.
*</p> * </p>
*<p>The "list" object type is identified by the URI <tt>http://activitystrea.ms/schema/1.0/list</tt>. * <p>
*</p> * The "list" object type is identified by the URI <tt>http://activitystrea.ms/schema/1.0/list</tt>.
*<p>A list has no additional components. * </p>
*</p> * <p>
* A list has no additional components.
* </p>
*
* @author robert.cooper * @author robert.cooper
*/ */
public class List extends ActivityObject public class List extends ActivityObject {
{
@Override @Override
public String getTypeIRI() { public String getTypeIRI() {

View file

@ -16,25 +16,23 @@
*/ */
package org.rometools.feed.module.activitystreams.types; package org.rometools.feed.module.activitystreams.types;
/** /**
* *
*<p>Mood describes the mood of the user when the activity was * <p>
* performed. This is usually collected via an extra field in the user * Mood describes the mood of the user when the activity was performed. This is usually collected via an extra field in the user interface used to perform the
* interface used to perform the activity. For the purpose of this * activity. For the purpose of this schema, a mood is a freeform, short mood keyword or phrase along with an optional mood icon image.
* schema, a mood is a freeform, short mood keyword or phrase along * </p>
* with an optional mood icon image. * <p>
*</p> * Moods are included via a mood element in the namespace <tt>http://activitystrea.ms/context/</tt>.
*<p>Moods are included via a mood element in the namespace <tt>http://activitystrea.ms/context/</tt>. * </p>
*</p> * <p>
*<p>The content of the mood element is the mood keyword or * The content of the mood element is the mood keyword or phrase.
* phrase. * </p>
*</p> * <p>
*<p>The mood element may have an optional <tt>icon</tt> * The mood element may have an optional <tt>icon</tt> attribute which contains the URL of a mood icon image. The mood icon image SHOULD be small and
* attribute which contains the URL of a mood icon image. The mood icon * appropriate to be displayed alongside the mood keyword at a normal text size.
* image SHOULD be small and appropriate to be displayed alongside the * </p>
* mood keyword at a normal text size. *
*</p>
* @author robert.cooper * @author robert.cooper
*/ */
public class Mood { public class Mood {
@ -43,37 +41,37 @@ public class Mood {
/** /**
* Set the value of iconUrl * Set the value of iconUrl
* *
* @param newiconUrl new value of iconUrl * @param newiconUrl new value of iconUrl
*/ */
public void setIconUrl(String newiconUrl) { public void setIconUrl(final String newiconUrl) {
this.iconUrl = newiconUrl; iconUrl = newiconUrl;
} }
/** /**
* Get the value of iconUrl * Get the value of iconUrl
* *
* @return the value of iconUrl * @return the value of iconUrl
*/ */
public String getIconUrl() { public String getIconUrl() {
return this.iconUrl; return iconUrl;
} }
/** /**
* Set the value of text * Set the value of text
* *
* @param newtext new value of text * @param newtext new value of text
*/ */
public void setText(String newtext) { public void setText(final String newtext) {
this.text = newtext; text = newtext;
} }
/** /**
* Get the value of text * Get the value of text
* *
* @return the value of text * @return the value of text
*/ */
public String getText() { public String getText() {
return this.text; return text;
} }
} }

View file

@ -18,35 +18,31 @@
package org.rometools.feed.module.activitystreams.types; package org.rometools.feed.module.activitystreams.types;
/** /**
*<p>The "note" Object type represents short-form text messages. This * <p>
* Object type is intended for use in "micro-blogging" and in systems * The "note" Object type represents short-form text messages. This Object type is intended for use in "micro-blogging" and in systems where users are invited
* where users are invited to publish short, often plain-text messages * to publish short, often plain-text messages whose useful lifespan is generally shorter than that of an article or weblog entry.
* whose useful lifespan is generally shorter than that of an article * </p>
* or weblog entry. * <p>
*</p> * A note is similar in structure to an article, but it does not have a title and its body tends to be shorter. Applications will often display the entire
*<p>A note is similar in structure to an article, but it does not * content of a note in an activity stream UI, whereas they MAY display only the title or the title and summary for a weblog entry.
* have a title and its body tends to be shorter. Applications will * </p>
* often display the entire content of a note in an activity stream UI, * <p>
* whereas they MAY display only the title or the title and summary for * The "note" Object type is identified by the URI <tt>http://activitystrea.ms/schema/1.0/note</tt>.
* a weblog entry. * </p>
*</p> * <p>
*<p>The "note" Object type is identified by the URI <tt>http://activitystrea.ms/schema/1.0/note</tt>. * A note has the following additional components:
*</p> * </p>
*<p>A note has the following additional components: * <p>
*</p> * </p>
*<p></p> * <blockquote class="text">
*<blockquote class="text"><dl> * <dl>
*<dt>Content</dt> * <dt>Content</dt>
*<dd>The content of the comment. Represented in * <dd>The content of the comment. Represented in JSON as a property called <tt>content</tt> whose value is a JSON string containing a fragment of HTML that
* JSON as a property called <tt>content</tt> * represents the content. Publishers SHOULD include any markup necessary to achieve a similar presentation to that on the publisher's own HTML pages, including
* whose value is a JSON string containing a fragment of HTML that * any links that the service automatically adds. Processors MAY remove all HTML markup and consider the comment to be plain text.</dd>
* represents the content. Publishers SHOULD include any markup * </dl>
* necessary to achieve a similar presentation to that on the * </blockquote>
* publisher's own HTML pages, including any links that the service *
* automatically adds. Processors MAY remove all HTML markup and
* consider the comment to be plain text.
*</dd>
*</dl></blockquote>
* @author robert.cooper * @author robert.cooper
*/ */
public class Note extends ActivityObject { public class Note extends ActivityObject {

View file

@ -20,65 +20,62 @@ package org.rometools.feed.module.activitystreams.types;
import com.sun.syndication.feed.atom.Link; import com.sun.syndication.feed.atom.Link;
/** /**
* <p>The "person" Object type represents a user account. This is often * <p>
represents a person, but might also be a company or fictitious * The "person" Object type represents a user account. This is often represents a person, but might also be a company or fictitious character that is being
* character that is being represented by a user account. * represented by a user account.
*</p> * </p>
*<p>The "person" Object type is identified by the URI <tt>http://activitystrea.ms/schema/1.0/person</tt>. * <p>
*</p> * The "person" Object type is identified by the URI <tt>http://activitystrea.ms/schema/1.0/person</tt>.
*<p>A person has the following additional components: * </p>
*</p> * <p>
*<p></p> * A person has the following additional components:
*<blockquote class="text"><dl> * </p>
*<dt>Display Name</dt> * <p>
*<dd>A name that can be used for the * </p>
* person in the user interface. This is often a name by which the * <blockquote class="text">
* individual is known in a given context; no restriction is placed * <dl>
* on what kind of name may be used here. Represented by the Name * <dt>Display Name</dt>
* component of the base Object Construct. * <dd>A name that can be used for the person in the user interface. This is often a name by which the individual is known in a given context; no restriction is
*</dd> * placed on what kind of name may be used here. Represented by the Name component of the base Object Construct.</dd>
*<dt>Avatar</dt> * <dt>Avatar</dt>
*<dd>A link to an "avatar" or "userpic" image * <dd>A link to an "avatar" or "userpic" image for the user. Represented by the Representative Image component of the base Object Construct.</dd>
* for the user. Represented by the Representative Image component * </dl>
* of the base Object Construct. * </blockquote>
*</dd> *
*</dl></blockquote> * @author robert.cooper
@author robert.cooper
*/ */
public class Person extends ActivityObject { public class Person extends ActivityObject {
@Override @Override
public String getTypeIRI() { public String getTypeIRI() {
return "http://activitystrea.ms/schema/1.0/person"; return "http://activitystrea.ms/schema/1.0/person";
} }
/** /**
* Get the value of avatar * Get the value of avatar
* *
* @return the value of avatar * @return the value of avatar
*/ */
public Link getAvatar() { public Link getAvatar() {
Link result = this.findRelatedLink("avatar"); final Link result = findRelatedLink("avatar");
if(result != null){ if (result != null) {
return result; return result;
} }
return this.findRelatedLink("userpic"); return findRelatedLink("userpic");
} }
/** /**
* Set the value of avatar * Set the value of avatar
* *
* @param newavatar new value of avatar * @param newavatar new value of avatar
*/ */
public void setAvatar(Link newavatar) { public void setAvatar(final Link newavatar) {
Link old = this.getAvatar(); final Link old = getAvatar();
if(old != null){ if (old != null) {
this.getOtherLinks().remove(old); getOtherLinks().remove(old);
} }
newavatar.setRel("avatar"); newavatar.setRel("avatar");
this.getOtherLinks().add(newavatar); getOtherLinks().add(newavatar);
} }
} }

View file

@ -18,29 +18,28 @@
package org.rometools.feed.module.activitystreams.types; package org.rometools.feed.module.activitystreams.types;
/** /**
* <p>The "photo" object type represents a graphical still image. * <p>
*</p> * The "photo" object type represents a graphical still image.
*<p>The "photo" Object type is identified by the URI <tt>http://activitystrea.ms/schema/1.0/photo</tt>. * </p>
*</p> * <p>
*<p>A photo has the following additional components: * The "photo" Object type is identified by the URI <tt>http://activitystrea.ms/schema/1.0/photo</tt>.
*</p> * </p>
*<p></p> * <p>
*<blockquote class="text"><dl> * A photo has the following additional components:
*<dt>Thumbnail</dt> * </p>
*<dd>A link to a thumbnail version of the * <p>
* image. Represented by the Representative Image component of the * </p>
* base Object Construct. Processors MAY ignore thumbnails that are * <blockquote class="text">
* of an inappropriate size for their user interface. * <dl>
*</dd> * <dt>Thumbnail</dt>
*<dt>Larger Image</dt> * <dd>A link to a thumbnail version of the image. Represented by the Representative Image component of the base Object Construct. Processors MAY ignore
*<dd>A Media Link Construct linking to a * thumbnails that are of an inappropriate size for their user interface.</dd>
* larger -- ideally, full-size -- version of the photo intended * <dt>Larger Image</dt>
* for standalone viewing. Represented in JSON as a property named * <dd>A Media Link Construct linking to a larger -- ideally, full-size -- version of the photo intended for standalone viewing. Represented in JSON as a
* <tt>fullImage</tt> whose value is a JSON * property named <tt>fullImage</tt> whose value is a JSON object with properties as defined in [TODO: xref the JSON serialization of a Media Link Construct].</dd>
* object with properties as defined in [TODO: xref the JSON * </dl>
* serialization of a Media Link Construct]. * </blockquote>
*</dd> *
*</dl></blockquote>
* @author robert.cooper * @author robert.cooper
*/ */
public class Photo extends ActivityObject { public class Photo extends ActivityObject {
@ -50,6 +49,4 @@ public class Photo extends ActivityObject {
return "http://activitystrea.ms/schema/1.0/photo"; return "http://activitystrea.ms/schema/1.0/photo";
} }
} }

View file

@ -18,23 +18,25 @@
package org.rometools.feed.module.activitystreams.types; package org.rometools.feed.module.activitystreams.types;
/** /**
* <p>The "photo album" object type represents a collection of * <p>
* images. * The "photo album" object type represents a collection of images.
*</p> * </p>
*<p>The "photo album" object type is identified by the URI <tt>http://activitystrea.ms/schema/1.0/photo-album</tt>. * <p>
*</p> * The "photo album" object type is identified by the URI <tt>http://activitystrea.ms/schema/1.0/photo-album</tt>.
*<p>The photo album has the following additional components: * </p>
*</p> * <p>
*<p></p> * The photo album has the following additional components:
*<blockquote class="text"><dl> * </p>
*<dt>Preview Image Link</dt> * <p>
*<dd>A Media Link Construct * </p>
* describing an image file that can be used as a preview image for * <blockquote class="text">
* the album. Represented by the Representative Image component of * <dl>
* the base Object Construct. Processors MAY ignore thumbnails that * <dt>Preview Image Link</dt>
* are of an inappropriate size for their user interface. * <dd>A Media Link Construct describing an image file that can be used as a preview image for the album. Represented by the Representative Image component of
*</dd> * the base Object Construct. Processors MAY ignore thumbnails that are of an inappropriate size for their user interface.</dd>
*</dl></blockquote> * </dl>
* </blockquote>
*
* @author robert.cooper * @author robert.cooper
*/ */
public class PhotoAlbum extends ActivityObject { public class PhotoAlbum extends ActivityObject {

View file

@ -18,27 +18,28 @@
package org.rometools.feed.module.activitystreams.types; package org.rometools.feed.module.activitystreams.types;
/** /**
* <p>The "place" object type represents a location on Earth. * <p>
*</p> * The "place" object type represents a location on Earth.
*<p>The "place" object type is identified by the URI <tt>http://activitystrea.ms/schema/1.0/place</tt>. * </p>
*</p> * <p>
*<p>A place has the following additional components: * The "place" object type is identified by the URI <tt>http://activitystrea.ms/schema/1.0/place</tt>.
*</p> * </p>
*<p></p> * <p>
*<blockquote class="text"><dl> * A place has the following additional components:
*<dt>Latitude</dt> * </p>
*<dd>The latitude of the place as a point on * <p>
* Earth. Represented in JSON as a property named <tt>latitude</tt> whose value is a JSON number * </p>
* containing a decimal representation of the latitude in * <blockquote class="text">
* degrees. * <dl>
*</dd> * <dt>Latitude</dt>
*<dt>Longitude</dt> * <dd>The latitude of the place as a point on Earth. Represented in JSON as a property named <tt>latitude</tt> whose value is a JSON number containing a
*<dd>The longitude of the place as a point on * decimal representation of the latitude in degrees.</dd>
* Earth. Represented in JSON as a property named <tt>longitude</tt> whose value is a JSON number * <dt>Longitude</dt>
* containing a decimal representation of the longitude in * <dd>The longitude of the place as a point on Earth. Represented in JSON as a property named <tt>longitude</tt> whose value is a JSON number containing a
* degrees. * decimal representation of the longitude in degrees.</dd>
*</dd> * </dl>
*</dl></blockquote> * </blockquote>
*
* @author robert.cooper * @author robert.cooper
*/ */
public class Place extends ActivityObject { public class Place extends ActivityObject {

View file

@ -18,17 +18,20 @@
package org.rometools.feed.module.activitystreams.types; package org.rometools.feed.module.activitystreams.types;
/** /**
* *
*<p>The "playlist" object type represents an ordered list of * <p>
* time-based media items, such as video and audio objects. * The "playlist" object type represents an ordered list of time-based media items, such as video and audio objects.
*</p> * </p>
*<p>The "playlist" object type is identified by the URI <tt>http://activitystrea.ms/schema/1.0/playlist</tt>. * <p>
*</p> * The "playlist" object type is identified by the URI <tt>http://activitystrea.ms/schema/1.0/playlist</tt>.
*<p>A playlist has no additional components. * </p>
*</p> * <p>
* A playlist has no additional components.
* </p>
*
* @author robert.cooper * @author robert.cooper
*/ */
public class Playlist extends ActivityObject { public class Playlist extends ActivityObject {
@Override @Override
public String getTypeIRI() { public String getTypeIRI() {

View file

@ -18,30 +18,28 @@
package org.rometools.feed.module.activitystreams.types; package org.rometools.feed.module.activitystreams.types;
/** /**
* <p>The "product" object type represents a commercial good or * <p>
* service. * The "product" object type represents a commercial good or service.
*</p> * </p>
*<p>The "product" object type is identified by the URI <tt>http://activitystrea.ms/schema/1.0/product</tt>. * <p>
*</p> * The "product" object type is identified by the URI <tt>http://activitystrea.ms/schema/1.0/product</tt>.
*<p>A product has the following additional components: * </p>
*</p> * <p>
*<p></p> * A product has the following additional components:
*<blockquote class="text"><dl> * </p>
*<dt>Thumbnail</dt> * <p>
*<dd>A link to a thumbnail-sized image that * </p>
* contains a photo of the product. Represented by the * <blockquote class="text">
* Representative Image component of the base Object Construct. * <dl>
* Processors MAY ignore thumbnails that are of an inappropriate * <dt>Thumbnail</dt>
* size for their user interface. * <dd>A link to a thumbnail-sized image that contains a photo of the product. Represented by the Representative Image component of the base Object Construct.
*</dd> * Processors MAY ignore thumbnails that are of an inappropriate size for their user interface.</dd>
*<dt>Larger Image</dt> * <dt>Larger Image</dt>
*<dd>A Media Link Construct linking to a * <dd>A Media Link Construct linking to a larger -- ideally, full-size -- version of the photo of the product. Represented in JSON as a property named
* larger -- ideally, full-size -- version of the photo of the * <tt>fullImage</tt> whose value is a JSON object with properties as defined in [TODO: xref the JSON serialization of a Media Link Construct].</dd>
* product. Represented in JSON as a property named <tt>fullImage</tt> whose value is a JSON object with * </dl>
* properties as defined in [TODO: xref the JSON serialization of a * </blockquote>
* Media Link Construct]. *
*</dd>
*</dl></blockquote>
* @author robert.cooper * @author robert.cooper
*/ */
public class Product extends ActivityObject { public class Product extends ActivityObject {

View file

@ -18,45 +18,35 @@
package org.rometools.feed.module.activitystreams.types; package org.rometools.feed.module.activitystreams.types;
/** /**
* <p>The "review" object type represents a primarily prose-based * <p>
* commentary on another object. * The "review" object type represents a primarily prose-based commentary on another object.
*</p> * </p>
*<p>The "review" object type is identified by the URI <tt>http://activitystrea.ms/schema/1.0/review</tt>. * <p>
*</p> * The "review" object type is identified by the URI <tt>http://activitystrea.ms/schema/1.0/review</tt>.
*<p>A review has the following additional components: * </p>
*</p> * <p>
*<p></p> * A review has the following additional components:
*<blockquote class="text"><dl> * </p>
*<dt>Title</dt> * <p>
*<dd>The title of the review. Represented by the * </p>
* Name component of the base Object Construct. Many systems do not * <blockquote class="text">
* have the concept of a title for a review; such systems MUST omit * <dl>
* the Name component. Processors SHOULD refer to such reviews as * <dt>Title</dt>
* simply being "a review", with appropriate localization, if they * <dd>The title of the review. Represented by the Name component of the base Object Construct. Many systems do not have the concept of a title for a review;
* are to be described in a sentence. * such systems MUST omit the Name component. Processors SHOULD refer to such reviews as simply being "a review", with appropriate localization, if they are to
*</dd> * be described in a sentence.</dd>
*<dt>Content</dt> * <dt>Content</dt>
*<dd>The content of the comment. Represented in * <dd>The content of the comment. Represented in JSON as a property called <tt>content</tt> whose value is a JSON string containing a fragment of HTML that
* JSON as a property called <tt>content</tt> * represents the content. Publishers SHOULD include any markup necessary to achieve a similar presentation to that on the publisher's own HTML pages, including
* whose value is a JSON string containing a fragment of HTML that * any links that the service automatically adds. Processors MAY remove all HTML markup and consider the comment to be plain text.</dd>
* represents the content. Publishers SHOULD include any markup * <dt>Reviewed Object</dt>
* necessary to achieve a similar presentation to that on the * <dd>The Object Construct representing the item that this review applies to. Represented as the In Reply To Object component of the base Object Construct.</dd>
* publisher's own HTML pages, including any links that the service * <dt>Rating</dt>
* automatically adds. Processors MAY remove all HTML markup and * <dd>A rating for the item, given as a number between 1.0 and 5.0 inclusive with one decimal place of precision. Represented in JSON as a property called
* consider the comment to be plain text. * <tt>rating</tt> whose value is a JSON number giving the rating.</dd>
*</dd> * </dl>
*<dt>Reviewed Object</dt> * </blockquote>
*<dd>The Object Construct representing *
* the item that this review applies to. Represented as the In
* Reply To Object component of the base Object Construct.
*</dd>
*<dt>Rating</dt>
*<dd>A rating for the item, given as a number
* between 1.0 and 5.0 inclusive with one decimal place of
* precision. Represented in JSON as a property called <tt>rating</tt> whose value is a JSON number giving
* the rating.
*</dd>
*</dl></blockquote>
* @author robert.cooper * @author robert.cooper
*/ */
public class Review extends ActivityObject { public class Review extends ActivityObject {

View file

@ -18,27 +18,27 @@
package org.rometools.feed.module.activitystreams.types; package org.rometools.feed.module.activitystreams.types;
/** /**
* <p>The "service" Object type represents a website, personal website * <p>
* or blog, business, brand, or other entity that performs some kind of * The "service" Object type represents a website, personal website or blog, business, brand, or other entity that performs some kind of work for other
* work for other entities, people, or services, or acts as kind of * entities, people, or services, or acts as kind of container for other objects.
* container for other objects. * </p>
*</p> * <p>
*<p>The "service" Object type is identified by the URI <tt>http://activitystrea.ms/schema/1.0/service</tt>. * The "service" Object type is identified by the URI <tt>http://activitystrea.ms/schema/1.0/service</tt>.
*</p> * </p>
*<p>A service has the following additional components: * <p>
*</p> * A service has the following additional components:
*<p></p> * </p>
*<blockquote class="text"><dl> * <p>
*<dt>icon</dt> * </p>
*<dd>A Media Link Construct representing a link to * <blockquote class="text">
* a small image representing the service. Represented in JSON as a * <dl>
* property named <tt>icon</tt> whose value is a * <dt>icon</dt>
* JSON object with properties as defined in [TODO: xref the JSON * <dd>A Media Link Construct representing a link to a small image representing the service. Represented in JSON as a property named <tt>icon</tt> whose value
* serialization of a Media Link Construct]. The linked image MUST * is a JSON object with properties as defined in [TODO: xref the JSON serialization of a Media Link Construct]. The linked image MUST have an aspect ratio of
* have an aspect ratio of one (horizontal) to one (vertical) and * one (horizontal) to one (vertical) and SHOULD be suitable for presentation at a small size.</dd>
* SHOULD be suitable for presentation at a small size. * </dl>
*</dd> * </blockquote>
*</dl></blockquote> *
* @author robert.cooper * @author robert.cooper
*/ */
public class Service extends ActivityObject { public class Service extends ActivityObject {

View file

@ -16,22 +16,23 @@
*/ */
package org.rometools.feed.module.activitystreams.types; package org.rometools.feed.module.activitystreams.types;
/** /**
* <p>The "song" Object type represents a song or a recording of a * <p>
* song. * The "song" Object type represents a song or a recording of a song.
*</p> * </p>
*<p>Objects of type Song might contain information about the song or * <p>
* recording, or they might contain some representation of the * Objects of type Song might contain information about the song or recording, or they might contain some representation of the recording itself. In the latter
* recording itself. In the latter case, the song SHOULD also be * case, the song SHOULD also be annotated with the "audio" object type as described in <a class='info' href='#audio'>Section&nbsp;3.2.2<span> (</span><span
* annotated with the "audio" object type as described in <a class='info' href='#audio'>Section&nbsp;3.2.2<span> (</span><span class='info'>Audio</span><span>)</span></a> and use its properties. This type should only * class='info'>Audio</span><span>)</span></a> and use its properties. This type should only be used when the publisher can guarantee that the object is a song
* be used when the publisher can guarantee that the object is a song * rather than merely a generic audio stream.
* rather than merely a generic audio stream. * </p>
*</p> * <p>
*<p>The Object type URL for the "song" Object type is <tt>http://activitystrea.ms/schema/1.0/song</tt>. * The Object type URL for the "song" Object type is <tt>http://activitystrea.ms/schema/1.0/song</tt>.
*</p> * </p>
*<p>A song has no additional components. * <p>
*</p> * A song has no additional components.
* </p>
*
* @author robert.cooper * @author robert.cooper
*/ */
public class Song extends ActivityObject { public class Song extends ActivityObject {
@ -39,20 +40,20 @@ public class Song extends ActivityObject {
/** /**
* Set the value of audio * Set the value of audio
* *
* @param newaudio new value of audio * @param newaudio new value of audio
*/ */
public void setAudio(Audio newaudio) { public void setAudio(final Audio newaudio) {
this.audio = newaudio; audio = newaudio;
} }
/** /**
* Get the value of audio * Get the value of audio
* *
* @return the value of audio * @return the value of audio
*/ */
public Audio getAudio() { public Audio getAudio() {
return this.audio; return audio;
} }
@Override @Override

View file

@ -18,22 +18,24 @@
package org.rometools.feed.module.activitystreams.types; package org.rometools.feed.module.activitystreams.types;
/** /**
* <p>The "status" Object type represents a human-readable update of * <p>
* the author's situation, mood, location or other status. * The "status" Object type represents a human-readable update of the author's situation, mood, location or other status.
*</p> * </p>
*<p>A status is similar in structure to a note, but carries the * <p>
* additional meaning that the content is primarily describing * A status is similar in structure to a note, but carries the additional meaning that the content is primarily describing something its author is doing,
* something its author is doing, feeling or experiencing. * feeling or experiencing.
*</p> * </p>
*<p>A consumers MAY consider the content of the most recent status * <p>
* object it encountered to be the user's current status, unless the * A consumers MAY consider the content of the most recent status object it encountered to be the user's current status, unless the most recent status update is
* most recent status update is old. When a status becomes too old is * old. When a status becomes too old is not defined by this specification.
* not defined by this specification. * </p>
*</p> * <p>
*<p>The "status" object type is identified by the URI <tt>http://activitystrea.ms/schema/1.0/status</tt>. * The "status" object type is identified by the URI <tt>http://activitystrea.ms/schema/1.0/status</tt>.
*</p> * </p>
*<p>A status has the same components as a note. * <p>
*</p> * A status has the same components as a note.
* </p>
*
* @author robert.cooper * @author robert.cooper
*/ */
public class Status extends ActivityObject { public class Status extends ActivityObject {

View file

@ -16,164 +16,145 @@
*/ */
package org.rometools.feed.module.activitystreams.types; package org.rometools.feed.module.activitystreams.types;
/** /**
* *
* @author robert.cooper * @author robert.cooper
*/ */
public enum Verb { public enum Verb {
/** /**
* The "mark as favorite" Verb indicates that the Subject marked the Object as an item of * The "mark as favorite" Verb indicates that the Subject marked the Object as an item of special interest. Objects so marked often appear in a collection
* special interest. Objects so marked often appear in a collection of such Objects which * of such Objects which MAY be published as a feed of entries annotated with this Verb. If a particular service uses favorites as a mechanism by which a
* MAY be published as a feed of entries annotated with this Verb. * user can recall items that were earlier marked, it MAY be appropriate to also mark activities of this type with the "save" Verb as described in Section
* If a particular service uses favorites as a mechanism by which a user can recall * 3.1.8. The verb URI for the "mark as favorite" Verb is http://activitystrea.ms/schema/1.0/favorite.
* items that were earlier marked, it MAY be appropriate to also mark activities of
* this type with the "save" Verb as described in Section 3.1.8.
* The verb URI for the "mark as favorite" Verb is http://activitystrea.ms/schema/1.0/favorite.
*/ */
MARK_AS_FAVORITE("http://activitystrea.ms/schema/1.0/favorite"), MARK_AS_FAVORITE("http://activitystrea.ms/schema/1.0/favorite"),
/** /**
* The "start following" Verb indicates that the Subject began following the activity * The "start following" Verb indicates that the Subject began following the activity of the Object. In most cases, the Object of this Verb will be a user,
* of the Object. In most cases, the Object of this Verb will be a user, but it can * but it can potentially be of any type that can sensibly generate activity.
* potentially be of any type that can sensibly generate activity. *
*
* The verb URI for the "start following" Verb is http://activitystrea.ms/schema/1.0/follow. * The verb URI for the "start following" Verb is http://activitystrea.ms/schema/1.0/follow.
* *
* Processors MAY ignore (silently drop) successive identical "start following" activities * Processors MAY ignore (silently drop) successive identical "start following" activities regardless of whether they maintain state sufficient to determine
* regardless of whether they maintain state sufficient to determine (A), (B), or (C) above. * (A), (B), or (C) above.
*/ */
START_FOLLOWING("http://activitystrea.ms/schema/1.0/follow"), START_FOLLOWING("http://activitystrea.ms/schema/1.0/follow"),
/** /**
* The "mark as liked" verb indicates that the actor indicated that it likes the object. * The "mark as liked" verb indicates that the actor indicated that it likes the object.
* *
* The verb URI for the "mark as liked" Verb is http://activitystrea.ms/schema/1.0/like. * The verb URI for the "mark as liked" Verb is http://activitystrea.ms/schema/1.0/like.
*/ */
MARK_AS_LIKED("http://activitystrea.ms/schema/1.0/like"), MARK_AS_LIKED("http://activitystrea.ms/schema/1.0/like"),
/** /**
* The "make friend" Verb indicates the creation of a friendship that is reciprocated by the object. * The "make friend" Verb indicates the creation of a friendship that is reciprocated by the object.
* *
* Since this verb implies an activity on the part of its object, processors MUST NOT accept * Since this verb implies an activity on the part of its object, processors MUST NOT accept activities with this Verb unless they are able to verify
* activities with this Verb unless they are able to verify through some external means that * through some external means that there is in fact a reciprocated connection. For example, a processor MAY have received a guarantee from a particular
* there is in fact a reciprocated connection. For example, a processor MAY have received a * publisher that the publisher will only use this Verb in cases where a reciprocal relationship exists.
* guarantee from a particular publisher that the publisher will only use this Verb in cases *
* where a reciprocal relationship exists.
*
* The verb URI for the "make friend" Verb is http://activitystrea.ms/schema/1.0/make-friend. * The verb URI for the "make friend" Verb is http://activitystrea.ms/schema/1.0/make-friend.
*/ */
MAKE_FRIEND("http://activitystrea.ms/schema/1.0/make-friend"), MAKE_FRIEND("http://activitystrea.ms/schema/1.0/make-friend"),
/** /**
* The "join" Verb indicates that the actor has become a member of the Object. * The "join" Verb indicates that the actor has become a member of the Object. This specification only defines the meaning of this Verb when its Object is a
* This specification only defines the meaning of this Verb when its Object is a Group, * Group, though implementors SHOULD be prepared to handle other Object types as meaning MAY be provided by extension specifications.
* though implementors SHOULD be prepared to handle other Object types as meaning *
* MAY be provided by extension specifications. * Processors MAY ignore (silently drop) successive identical "join" activities regardless of whether they maintain state sufficient to determine (A) or (B)
* * above.
* Processors MAY ignore (silently drop) successive identical "join" activities *
* regardless of whether they maintain state sufficient to determine (A) or (B) above.
*
* The "join" Verb is identified by the URI http://activitystrea.ms/schema/1.0/join. * The "join" Verb is identified by the URI http://activitystrea.ms/schema/1.0/join.
*/ */
JOIN("http://activitystrea.ms/schema/1.0/join"), JOIN("http://activitystrea.ms/schema/1.0/join"),
/** /**
* The "play" verb indicates that the subject spent some time enjoying the object. * The "play" verb indicates that the subject spent some time enjoying the object. For example, if the object is a video this indicates that the subject
* For example, if the object is a video this indicates that the subject watched all or part of the video. * watched all or part of the video.
* *
* The "play" Verb is identified by the URI http://activitystrea.ms/schema/1.0/play. * The "play" Verb is identified by the URI http://activitystrea.ms/schema/1.0/play.
*/ */
PLAY("http://activitystrea.ms/schema/1.0/play"), PLAY("http://activitystrea.ms/schema/1.0/play"),
/** /**
* The "Post" Verb is described in section 8 of the AtomActivity specification. * The "Post" Verb is described in section 8 of the AtomActivity specification. It is only referenced here for completeness.
* It is only referenced here for completeness. *
*
* http://activitystrea.ms/schema/1.0/post * http://activitystrea.ms/schema/1.0/post
*/ */
POST("http://activitystrea.ms/schema/1.0/post"), POST("http://activitystrea.ms/schema/1.0/post"),
/** /**
* The "save" Verb indicates that the Subject has called out the Object as being of * The "save" Verb indicates that the Subject has called out the Object as being of interest primarily to him- or herself. Though this action MAY be shared
* interest primarily to him- or herself. Though this action MAY be shared publicly, * publicly, the implication is that the Object has been saved primarily for the actor's own benefit rather than to show it to others as would be indicated
* the implication is that the Object has been saved primarily for the actor's own * by the "share" Verb (Section 3.1.9).
* benefit rather than to show it to others as would be indicated by the "share" *
* Verb (Section 3.1.9).
*
* The "save" Verb is identified by the URI http://activitystrea.ms/schema/1.0/save. * The "save" Verb is identified by the URI http://activitystrea.ms/schema/1.0/save.
*/ */
SAVE("http://activitystrea.ms/schema/1.0/save"), SAVE("http://activitystrea.ms/schema/1.0/save"),
/** /**
* The "share" Verb indicates that the Subject has called out the Object to readers. * The "share" Verb indicates that the Subject has called out the Object to readers. In most cases, the actor did not create the Object being shared, but is
* In most cases, the actor did not create the Object being shared, but is instead * instead drawing attention to it.
* drawing attention to it. *
*
* The "share" Verb is identified by the URI http://activitystrea.ms/schema/1.0/share. * The "share" Verb is identified by the URI http://activitystrea.ms/schema/1.0/share.
*/ */
SHARE("http://activitystrea.ms/schema/1.0/share"), SHARE("http://activitystrea.ms/schema/1.0/share"),
/** /**
* The "tag" verb indicates that the actor has identified the presence of a target * The "tag" verb indicates that the actor has identified the presence of a target inside another object. For example, the actor may have specified that a
* inside another object. For example, the actor may have specified that a particular * particular user appears in a photo.
* user appears in a photo. *
*
* The "tag" verb is identified by the URI http://activitystrea.ms/schema/1.0/tag. * The "tag" verb is identified by the URI http://activitystrea.ms/schema/1.0/tag.
* *
* The target of the "tag" verb gives the object in which the tag has been added. * The target of the "tag" verb gives the object in which the tag has been added. For example, if a user appears in a photo, the activity:object is the user
* For example, if a user appears in a photo, the activity:object is the user and * and the activity:target is the photo.
* the activity:target is the photo.
*/ */
TAG("http://activitystrea.ms/schema/1.0/tag"), TAG("http://activitystrea.ms/schema/1.0/tag"),
/** /**
* The "update" Verb indicates that the Subject has modified the referenced Object. * The "update" Verb indicates that the Subject has modified the referenced Object.
* *
* Implementors SHOULD use verbs such as Section 3.1.7 where the Subject is adding * Implementors SHOULD use verbs such as Section 3.1.7 where the Subject is adding new items to a Section 3.2.8 or similar. Update is reserved for
* new items to a Section 3.2.8 or similar. Update is reserved for modifications * modifications to existing Objects or data such as changing a user's profile information.
* to existing Objects or data such as changing a user's profile information. *
*
* The "update" Verb is identified by the URI http://activitystrea.ms/schema/1.0/update. * The "update" Verb is identified by the URI http://activitystrea.ms/schema/1.0/update.
*/ */
UPDATE("http://activitystrea.ms/schema/1.0/update"), UPDATE("http://activitystrea.ms/schema/1.0/update"),
/** /**
* *
*<p>The "positive RSVP" verb indicates that the actor has made a * <p>
* positive RSVP for the object. This specification only defines the * The "positive RSVP" verb indicates that the actor has made a positive RSVP for the object. This specification only defines the meaning of this verb when
* meaning of this verb when its object is an event (see <a class='info' href='#event'>Section&nbsp;4.2.1<span> (</span><span class='info'>Event</span><span>)</span></a>), though implementors SHOULD be prepared to * its object is an event (see <a class='info' href='#event'>Section&nbsp;4.2.1<span> (</span><span class='info'>Event</span><span>)</span></a>), though
* handle other object types as meaning MAY be provided by extension * implementors SHOULD be prepared to handle other object types as meaning MAY be provided by extension specifications.
* specifications. * </p>
*</p> * <p>
*<p>The use of this Verb is only appropriate when the RSVP was * The use of this Verb is only appropriate when the RSVP was created by an explicit action by the actor. It is not appropriate to use this verb when a user
* created by an explicit action by the actor. It is not appropriate to * has been added as an attendee by an event organiser or administrator.
* use this verb when a user has been added as an attendee by an event * </p>
* organiser or administrator. * <p>
*</p> * The verb URI for the "positive RSVP" Verb is <tt>http://activitystrea.ms/schema/1.0/rsvp-yes</tt>.
*<p>The verb URI for the "positive RSVP" Verb is <tt>http://activitystrea.ms/schema/1.0/rsvp-yes</tt>. * </p>
*</p>
*/ */
RSVP_YES("http://activitystrea.ms/schema/1.0/rsvp-yes"), RSVP_YES("http://activitystrea.ms/schema/1.0/rsvp-yes"),
/** /**
* <p>The "possible RSVP" verb indicates that the actor has made a * <p>
* possible RSVP for the object. This specification only defines the * The "possible RSVP" verb indicates that the actor has made a possible RSVP for the object. This specification only defines the meaning of this verb when
* meaning of this verb when its object is an event (see <a class='info' href='#event'>Section&nbsp;4.2.1<span> (</span><span class='info'>Event</span><span>)</span></a>), though implementors SHOULD be prepared to * its object is an event (see <a class='info' href='#event'>Section&nbsp;4.2.1<span> (</span><span class='info'>Event</span><span>)</span></a>), though
* handle other object types as meaning MAY be provided by extension * implementors SHOULD be prepared to handle other object types as meaning MAY be provided by extension specifications.
* specifications. * </p>
*</p> * <p>
*<p>The use of this Verb is only appropriate when the RSVP was * The use of this Verb is only appropriate when the RSVP was created by an explicit action by the actor. It is not appropriate to use this verb when a user
* created by an explicit action by the actor. It is not appropriate to * has been added as an attendee by an event organiser or administrator.
* use this verb when a user has been added as an attendee by an event * </p>
* organiser or administrator. * <p>
*</p> * The verb URI for the "possible RSVP" Verb is <tt>http://activitystrea.ms/schema/1.0/rsvp-maybe</tt>.
*<p>The verb URI for the "possible RSVP" Verb is <tt>http://activitystrea.ms/schema/1.0/rsvp-maybe</tt>. * </p>
*</p>
*/ */
RSVP_MAYBE("http://activitystrea.ms/schema/1.0/rsvp-maybe"), RSVP_MAYBE("http://activitystrea.ms/schema/1.0/rsvp-maybe"),
/** /**
* <p>The "negative RSVP" verb indicates that the actor has made a * <p>
* negative RSVP for the object. This specification only defines the * The "negative RSVP" verb indicates that the actor has made a negative RSVP for the object. This specification only defines the meaning of this verb when
* meaning of this verb when its object is an event (see <a class='info' href='#event'>Section&nbsp;4.2.1<span> (</span><span class='info'>Event</span><span>)</span></a>), though implementors SHOULD be prepared to * its object is an event (see <a class='info' href='#event'>Section&nbsp;4.2.1<span> (</span><span class='info'>Event</span><span>)</span></a>), though
* handle other object types as meaning MAY be provided by extension * implementors SHOULD be prepared to handle other object types as meaning MAY be provided by extension specifications.
* specifications. * </p>
*</p> * <p>
*<p>The use of this Verb is only appropriate when the RSVP was * The use of this Verb is only appropriate when the RSVP was created by an explicit action by the actor. It is not appropriate to use this verb when a user
* created by an explicit action by the actor. It is not appropriate to * has been added as an attendee by an event organiser or administrator.
* use this verb when a user has been added as an attendee by an event * </p>
* organiser or administrator. * <p>
*</p> * The verb URI for the "negative RSVP" Verb is <tt>http://activitystrea.ms/schema/1.0/rsvp-no</tt>.
*<p>The verb URI for the "negative RSVP" Verb is <tt>http://activitystrea.ms/schema/1.0/rsvp-no</tt>. * </p>
*</p>
*/ */
RSVP_NO("http://activitystrea.ms/schema/1.0/rsvp-no"); RSVP_NO("http://activitystrea.ms/schema/1.0/rsvp-no");
private final String iri; private final String iri;
@ -181,22 +162,23 @@ public enum Verb {
/** /**
* @param iri * @param iri
*/ */
Verb(final String iri){ Verb(final String iri) {
this.iri = iri; this.iri = iri;
} }
@Override @Override
public String toString(){ public String toString() {
return iri; return iri;
} }
/** /**
* *
* @param iri * @param iri
* @return * @return
*/ */
public static Verb fromIRI(String iri){ public static Verb fromIRI(final String iri) {
for(Verb v: Verb.values()){ for (final Verb v : Verb.values()) {
if(v.toString().equals(iri)){ if (v.toString().equals(iri)) {
return v; return v;
} }
} }

View file

@ -18,29 +18,28 @@
package org.rometools.feed.module.activitystreams.types; package org.rometools.feed.module.activitystreams.types;
/** /**
* <p>The "video" Object type represents video content, which usually * <p>
* consists of a motion picture track and an audio track. * The "video" Object type represents video content, which usually consists of a motion picture track and an audio track.
*</p> * </p>
*<p>The "video" Object type is identified by the URI <tt>http://activitystrea.ms/schema/1.0/video</tt>. * <p>
*</p> * The "video" Object type is identified by the URI <tt>http://activitystrea.ms/schema/1.0/video</tt>.
*<p>A video has the following additional components: * </p>
*</p> * <p>
*<p></p> * A video has the following additional components:
*<blockquote class="text"><dl> * </p>
*<dt>Video Stream Link</dt> * <p>
*<dd>A Media Link Construct linking * </p>
* to the video content itself. Represented in JSON as a property * <blockquote class="text">
* called <tt>stream</tt> whose value is a JSON * <dl>
* object with properties as defined in [TODO: xref the JSON * <dt>Video Stream Link</dt>
* serialization of a Media Link Construct] * <dd>A Media Link Construct linking to the video content itself. Represented in JSON as a property called <tt>stream</tt> whose value is a JSON object with
*</dd> * properties as defined in [TODO: xref the JSON serialization of a Media Link Construct]</dd>
*<dt>Embed Code</dt> * <dt>Embed Code</dt>
*<dd>An HTML fragment that, when embedded in * <dd>An HTML fragment that, when embedded in an HTML page, will provide an interactive player UI for the video stream. Represented in JSON as a property
* an HTML page, will provide an interactive player UI for the * called <tt>embedCode</tt> whose value is a JSON string containing the fragment of HTML.</dd>
* video stream. Represented in JSON as a property called <tt>embedCode</tt> whose value is a JSON string * </dl>
* containing the fragment of HTML. * </blockquote>
*</dd> *
*</dl></blockquote>
* @author robert.cooper * @author robert.cooper
*/ */
public class Video { public class Video {

View file

@ -18,7 +18,7 @@
package org.rometools.feed.module.atomthread; package org.rometools.feed.module.atomthread;
/** /**
* *
* @author robert.cooper * @author robert.cooper
*/ */
public interface ThreadModule { public interface ThreadModule {

View file

@ -41,10 +41,9 @@ package org.rometools.feed.module.base;
import java.util.Date; import java.util.Date;
/** /**
* This is an interface for the GoogleBase plug in that exposes methods used for * This is an interface for the GoogleBase plug in that exposes methods used for Article or News entry types.
* Article or News entry types. *
* @author <a href="mailto:cooper@screaming-penguin.com">Robert "kebernet" Cooper</a> * @author <a href="mailto:cooper@screaming-penguin.com">Robert "kebernet" Cooper</a>
* @version $Revision: 1.2 $ * @version $Revision: 1.2 $
*/ */
@ -52,39 +51,34 @@ public interface Article extends GlobalInterface {
/** /**
* Array of Author Names. Limit 10. * Array of Author Names. Limit 10.
* <table border="1" cellpadding="5" cellspacing="0" width="640"> * <table border="1" cellpadding="5" cellspacing="0" width="640">
* *
* <tbody><tr valign="top"> * <tbody>
* <td colspan="2" bgcolor="#dddddd" valign="top"><font size="-1"> * <tr valign="top">
* <b><a name="author"></a>author</b></font></td> * <td colspan="2" bgcolor="#dddddd" valign="top"><font size="-1"> <b><a name="author"></a>author</b></font></td>
* </tr> * </tr>
* <tr valign="top"> * <tr valign="top">
* <td width="120"><font size="-1"> * <td width="120"><font size="-1"> <b>Details</b></font></td>
* <b>Details</b></font></td> *
* * <td><font size="-1"> Author of the item.</font></td>
* <td><font size="-1">
* Author of the item.</font></td>
* </tr> * </tr>
* <tr valign="top"> * <tr valign="top">
* <td width="120"><font size="-1"> * <td width="120"><font size="-1"> <b>Example</b></font></td>
* <b>Example</b></font></td> * <td><font size="-1"> &lt;g:author&gt;John Steinbeck&lt;/g:author&gt;</font></td>
* <td><font size="-1"> &lt;g:author&gt;John Steinbeck&lt;/g:author&gt;</font></td> *
*
* </tr> * </tr>
* <tr valign="top"> * <tr valign="top">
* <td width="120"><font size="-1"> * <td width="120"><font size="-1"> <b>Attribute of</b></font></td>
* <b>Attribute of</b></font></td> * <td><font size="-1"> Reference Items, News and Articles</font></td>
* <td><font size="-1">
* Reference Items, News and Articles</font></td>
* </tr> * </tr>
* *
* <tr valign="top"> * <tr valign="top">
* *
* <td width="120"><font size="-1"> * <td width="120"><font size="-1"> <b>Content type</b></font></td>
* <b>Content type</b></font></td> * <td><font size="-1"> string</font></td>
* <td><font size="-1">
* string</font></td>
* </tr> * </tr>
* </tbody></table> * </tbody>
* </table>
*
* @param authors Array of Author Names. Limit 10. * @param authors Array of Author Names. Limit 10.
*/ */
public void setAuthors(String[] authors); public void setAuthors(String[] authors);
@ -92,304 +86,283 @@ public interface Article extends GlobalInterface {
/** /**
* Array of Author Names. Limit 10. * Array of Author Names. Limit 10.
* <table border="1" cellpadding="5" cellspacing="0" width="640"> * <table border="1" cellpadding="5" cellspacing="0" width="640">
* *
* <tbody><tr valign="top"> * <tbody>
* <td colspan="2" bgcolor="#dddddd" valign="top"><font size="-1"> * <tr valign="top">
* <b><a name="author"></a>author</b></font></td> * <td colspan="2" bgcolor="#dddddd" valign="top"><font size="-1"> <b><a name="author"></a>author</b></font></td>
* </tr> * </tr>
* <tr valign="top"> * <tr valign="top">
* <td width="120"><font size="-1"> * <td width="120"><font size="-1"> <b>Details</b></font></td>
* <b>Details</b></font></td> *
* * <td><font size="-1"> Author of the item.</font></td>
* <td><font size="-1">
* Author of the item.</font></td>
* </tr> * </tr>
* <tr valign="top"> * <tr valign="top">
* <td width="120"><font size="-1"> * <td width="120"><font size="-1"> <b>Example</b></font></td>
* <b>Example</b></font></td> * <td><font size="-1"> &lt;g:author&gt;John Steinbeck&lt;/g:author&gt;</font></td>
* <td><font size="-1"> &lt;g:author&gt;John Steinbeck&lt;/g:author&gt;</font></td> *
*
* </tr> * </tr>
* <tr valign="top"> * <tr valign="top">
* <td width="120"><font size="-1"> * <td width="120"><font size="-1"> <b>Attribute of</b></font></td>
* <b>Attribute of</b></font></td> * <td><font size="-1"> Reference Items, News and Articles</font></td>
* <td><font size="-1">
* Reference Items, News and Articles</font></td>
* </tr> * </tr>
* *
* <tr valign="top"> * <tr valign="top">
* *
* <td width="120"><font size="-1"> * <td width="120"><font size="-1"> <b>Content type</b></font></td>
* <b>Content type</b></font></td> * <td><font size="-1"> string</font></td>
* <td><font size="-1">
* string</font></td>
* </tr> * </tr>
* </tbody></table> * </tbody>
* </table>
*
* @return Array of author names. * @return Array of author names.
*/ */
public String[] getAuthors(); public String[] getAuthors();
/** /**
* Source for this article. * Source for this article.
* *
* *
* <table border="1" cellpadding="5" cellspacing="0" width="640"> * <table border="1" cellpadding="5" cellspacing="0" width="640">
* <tbody><tr valign="top"> * <tbody>
* * <tr valign="top">
* <td colspan="2" bgcolor="#dddddd"><font size="-1"> *
* <b><a name="news_source"></a>news_source</b></font></td> * <td colspan="2" bgcolor="#dddddd"><font size="-1"> <b><a name="news_source"></a>news_source</b></font></td>
* </tr> * </tr>
* <tr valign="top"> * <tr valign="top">
* <td width="120"><font size="-1"> * <td width="120"><font size="-1"> <b>Details</b></font></td>
* <b>Details</b></font></td> *
* * <td><font size="-1"> The source of news content.</font></td>
* <td><font size="-1"> *
* The source of news content.</font></td>
*
* </tr> * </tr>
* <tr valign="top"> * <tr valign="top">
* <td width="120"><font size="-1"> * <td width="120"><font size="-1"> <b>Example</b></font></td>
* <b>Example</b></font></td> * <td><font size="-1"> &lt;g:news_source&gt;Journal&lt;/g:news_source&gt;</font></td>
* <td><font size="-1"> &lt;g:news_source&gt;Journal&lt;/g:news_source&gt;</font></td> *
*
* </tr> * </tr>
* *
* <tr valign="top"> * <tr valign="top">
* <td width="120"><font size="-1"> * <td width="120"><font size="-1"> <b>Attribute of</b></font></td>
* <b>Attribute of</b></font></td> * <td><font size="-1"> News and Articles</font></td>
* <td><font size="-1">
* News and Articles</font></td>
* </tr> * </tr>
* *
* <tr valign="top"> * <tr valign="top">
* <td width="120"><font size="-1"> * <td width="120"><font size="-1">
* *
* <b>Content type</b></font></td> * <b>Content type</b></font></td>
* <td><font size="-1"> * <td><font size="-1"> string</font></td>
* string</font></td>
* </tr> * </tr>
* </tbody></table> * </tbody>
* </table>
*
* @param newsSource Source for this article * @param newsSource Source for this article
*/ */
public void setNewsSource(String newsSource); public void setNewsSource(String newsSource);
/** /**
* Source for this article. * Source for this article.
* *
* <table border="1" cellpadding="5" cellspacing="0" width="640"> * <table border="1" cellpadding="5" cellspacing="0" width="640">
* <tbody><tr valign="top"> * <tbody>
* * <tr valign="top">
* <td colspan="2" bgcolor="#dddddd"><font size="-1"> *
* <b><a name="news_source"></a>news_source</b></font></td> * <td colspan="2" bgcolor="#dddddd"><font size="-1"> <b><a name="news_source"></a>news_source</b></font></td>
* </tr> * </tr>
* <tr valign="top"> * <tr valign="top">
* <td width="120"><font size="-1"> * <td width="120"><font size="-1"> <b>Details</b></font></td>
* <b>Details</b></font></td> *
* * <td><font size="-1"> The source of news content.</font></td>
* <td><font size="-1"> *
* The source of news content.</font></td>
*
* </tr> * </tr>
* <tr valign="top"> * <tr valign="top">
* <td width="120"><font size="-1"> * <td width="120"><font size="-1"> <b>Example</b></font></td>
* <b>Example</b></font></td> * <td><font size="-1"> &lt;g:news_source&gt;Journal&lt;/g:news_source&gt;</font></td>
* <td><font size="-1"> &lt;g:news_source&gt;Journal&lt;/g:news_source&gt;</font></td> *
*
* </tr> * </tr>
* *
* <tr valign="top"> * <tr valign="top">
* <td width="120"><font size="-1"> * <td width="120"><font size="-1"> <b>Attribute of</b></font></td>
* <b>Attribute of</b></font></td> * <td><font size="-1"> News and Articles</font></td>
* <td><font size="-1">
* News and Articles</font></td>
* </tr> * </tr>
* *
* <tr valign="top"> * <tr valign="top">
* <td width="120"><font size="-1"> * <td width="120"><font size="-1">
* *
* <b>Content type</b></font></td> * <b>Content type</b></font></td>
* <td><font size="-1"> * <td><font size="-1"> string</font></td>
* string</font></td>
* </tr> * </tr>
* </tbody></table> * </tbody>
* </table>
*
* @return source for this article. * @return source for this article.
*/ */
public String getNewsSource(); public String getNewsSource();
/** /**
* Number of pages in the article. * Number of pages in the article.
* *
* <table border="1" cellpadding="5" cellspacing="0" width="640"> * <table border="1" cellpadding="5" cellspacing="0" width="640">
* *
* <tbody><tr valign="top"> * <tbody>
* <td colspan="2" bgcolor="#dddddd" valign="top"><font size="-1"> * <tr valign="top">
* <b><a name="pages"></a>pages</b></font></td> * <td colspan="2" bgcolor="#dddddd" valign="top"><font size="-1"> <b><a name="pages"></a>pages</b></font></td>
* *
* </tr> * </tr>
* <tr valign="top"> * <tr valign="top">
* <td width="120"><font size="-1"> * <td width="120"><font size="-1"> <b>Details</b></font></td>
* <b>Details</b></font></td> * <td><font size="-1">
* <td><font size="-1"> *
* * The number of pages in the publication.</font></td>
* The number of pages in the publication.</font></td>
* </tr> * </tr>
* *
* <tr valign="top"> * <tr valign="top">
* <td width="120"><font size="-1"> * <td width="120"><font size="-1"> <b>Example</b></font></td>
* <b>Example</b></font></td> * <td><font size="-1"> &lt;g:pages&gt;18&lt;/g:pages&gt;</font></td>
* <td><font size="-1"> &lt;g:pages&gt;18&lt;/g:pages&gt;</font></td> *
*
* </tr> * </tr>
* <tr valign="top"> * <tr valign="top">
* *
* <td width="120"><font size="-1"> * <td width="120"><font size="-1"> <b>Attribute of</b></font></td>
* <b>Attribute of</b></font></td> * <td><font size="-1"> Reference Items, News and Articles</font></td>
* <td><font size="-1">
* Reference Items, News and Articles</font></td>
* </tr> * </tr>
* <tr valign="top"> * <tr valign="top">
* *
* <td width="120"><font size="-1"> * <td width="120"><font size="-1">
* *
* <b>Content type</b></font></td> * <b>Content type</b></font></td>
* <td><font size="-1"> * <td><font size="-1"> integer</font></td>
* integer</font></td>
* </tr> * </tr>
* </tbody></table> * </tbody>
* </table>
*
* @param pages Number of pages in the article * @param pages Number of pages in the article
*/ */
public void setPages(Integer pages); public void setPages(Integer pages);
/** /**
* Number of pages in the article. * Number of pages in the article.
* *
* <table border="1" cellpadding="5" cellspacing="0" width="640"> * <table border="1" cellpadding="5" cellspacing="0" width="640">
* *
* <tbody><tr valign="top"> * <tbody>
* <td colspan="2" bgcolor="#dddddd" valign="top"><font size="-1"> * <tr valign="top">
* <b><a name="pages"></a>pages</b></font></td> * <td colspan="2" bgcolor="#dddddd" valign="top"><font size="-1"> <b><a name="pages"></a>pages</b></font></td>
* *
* </tr> * </tr>
* <tr valign="top"> * <tr valign="top">
* <td width="120"><font size="-1"> * <td width="120"><font size="-1"> <b>Details</b></font></td>
* <b>Details</b></font></td> * <td><font size="-1">
* <td><font size="-1"> *
* * The number of pages in the publication.</font></td>
* The number of pages in the publication.</font></td>
* </tr> * </tr>
* *
* <tr valign="top"> * <tr valign="top">
* <td width="120"><font size="-1"> * <td width="120"><font size="-1"> <b>Example</b></font></td>
* <b>Example</b></font></td> * <td><font size="-1"> &lt;g:pages&gt;18&lt;/g:pages&gt;</font></td>
* <td><font size="-1"> &lt;g:pages&gt;18&lt;/g:pages&gt;</font></td> *
*
* </tr> * </tr>
* <tr valign="top"> * <tr valign="top">
* *
* <td width="120"><font size="-1"> * <td width="120"><font size="-1"> <b>Attribute of</b></font></td>
* <b>Attribute of</b></font></td> * <td><font size="-1"> Reference Items, News and Articles</font></td>
* <td><font size="-1">
* Reference Items, News and Articles</font></td>
* </tr> * </tr>
* <tr valign="top"> * <tr valign="top">
* *
* <td width="120"><font size="-1"> * <td width="120"><font size="-1">
* *
* <b>Content type</b></font></td> * <b>Content type</b></font></td>
* <td><font size="-1"> * <td><font size="-1"> integer</font></td>
* integer</font></td>
* </tr> * </tr>
* </tbody></table> * </tbody>
* </table>
*
* @return Number of pages in the article * @return Number of pages in the article
*/ */
public Integer getPages(); public Integer getPages();
/** /**
* Date article was published. * Date article was published.
* *
* <table border="1" cellpadding="5" cellspacing="0" width="640"> * <table border="1" cellpadding="5" cellspacing="0" width="640">
* <tbody><tr valign="top"> * <tbody>
* <td colspan="2" bgcolor="#dddddd"><font size="-1"> * <tr valign="top">
* <b><a name="publish_date"></a>publish_date</b></font></td> * <td colspan="2" bgcolor="#dddddd"><font size="-1"> <b><a name="publish_date"></a>publish_date</b></font></td>
* *
* </tr> * </tr>
* <tr valign="top"> * <tr valign="top">
* <td width="120"><font size="-1"> * <td width="120"><font size="-1">
* *
* <b>Details</b></font></td> * <b>Details</b></font></td>
* <td><font size="-1"> * <td><font size="-1"> Date the item was published in <a href="http://www.iso.org/iso/en/prods-services/popstds/datesandtime.html">ISO 8601</a> format:
* Date the item was published in <a href="http://www.iso.org/iso/en/prods-services/popstds/datesandtime.html">ISO 8601</a> format: * YYYY-MM-DD</font></td>
* YYYY-MM-DD</font></td> *
*
* </tr> * </tr>
* <tr valign="top"> * <tr valign="top">
* <td width="120"><font size="-1"> * <td width="120"><font size="-1">
* *
* <b>Example</b></font></td> * <b>Example</b></font></td>
* <td><font size="-1"> &lt;g:publish_date&gt;2005-12-20&lt;/g:publish_date&gt;</font></td> * <td><font size="-1"> &lt;g:publish_date&gt;2005-12-20&lt;/g:publish_date&gt;</font></td>
* </tr> * </tr>
* *
* <tr valign="top"> * <tr valign="top">
* <td width="120"><font size="-1"> * <td width="120"><font size="-1"> <b>Attribute of</b></font></td>
* <b>Attribute of</b></font></td> *
* * <td><font size="-1"> Reference Items</font></td>
* <td><font size="-1">
* Reference Items</font></td>
* </tr> * </tr>
* <tr valign="top"> * <tr valign="top">
* <td width="120"><font size="-1"> * <td width="120"><font size="-1">
* *
* <b>Content type</b></font></td> * <b>Content type</b></font></td>
* <td><font size="-1"> * <td><font size="-1">
* *
* date</font></td> * date</font></td>
* </tr> * </tr>
* </tbody></table> * </tbody>
* </table>
*
* @param publishDate Date article was published * @param publishDate Date article was published
*/ */
public void setPublishDate(Date publishDate); public void setPublishDate(Date publishDate);
/** /**
* Date article was published. * Date article was published.
* *
* <table border="1" cellpadding="5" cellspacing="0" width="640"> * <table border="1" cellpadding="5" cellspacing="0" width="640">
* <tbody><tr valign="top"> * <tbody>
* <td colspan="2" bgcolor="#dddddd"><font size="-1"> * <tr valign="top">
* <b><a name="publish_date"></a>publish_date</b></font></td> * <td colspan="2" bgcolor="#dddddd"><font size="-1"> <b><a name="publish_date"></a>publish_date</b></font></td>
* *
* </tr> * </tr>
* <tr valign="top"> * <tr valign="top">
* <td width="120"><font size="-1"> * <td width="120"><font size="-1">
* *
* <b>Details</b></font></td> * <b>Details</b></font></td>
* <td><font size="-1"> * <td><font size="-1"> Date the item was published in <a href="http://www.iso.org/iso/en/prods-services/popstds/datesandtime.html">ISO 8601</a> format:
* Date the item was published in <a href="http://www.iso.org/iso/en/prods-services/popstds/datesandtime.html">ISO 8601</a> format: * YYYY-MM-DD</font></td>
* YYYY-MM-DD</font></td> *
*
* </tr> * </tr>
* <tr valign="top"> * <tr valign="top">
* <td width="120"><font size="-1"> * <td width="120"><font size="-1">
* *
* <b>Example</b></font></td> * <b>Example</b></font></td>
* <td><font size="-1"> &lt;g:publish_date&gt;2005-12-20&lt;/g:publish_date&gt;</font></td> * <td><font size="-1"> &lt;g:publish_date&gt;2005-12-20&lt;/g:publish_date&gt;</font></td>
* </tr> * </tr>
* *
* <tr valign="top"> * <tr valign="top">
* <td width="120"><font size="-1"> * <td width="120"><font size="-1"> <b>Attribute of</b></font></td>
* <b>Attribute of</b></font></td> *
* * <td><font size="-1"> Reference Items</font></td>
* <td><font size="-1">
* Reference Items</font></td>
* </tr> * </tr>
* <tr valign="top"> * <tr valign="top">
* <td width="120"><font size="-1"> * <td width="120"><font size="-1">
* *
* <b>Content type</b></font></td> * <b>Content type</b></font></td>
* <td><font size="-1"> * <td><font size="-1">
* *
* date</font></td> * date</font></td>
* </tr> * </tr>
* </tbody></table> * </tbody>
* </table>
*
* @return Date article was published * @return Date article was published
*/ */
public Date getPublishDate(); public Date getPublishDate();

View file

@ -40,443 +40,430 @@ package org.rometools.feed.module.base;
import org.rometools.feed.module.base.types.DateTimeRange; import org.rometools.feed.module.base.types.DateTimeRange;
/** /**
* This is an interface for the GoogleBase plug in that exposes methods used for * This is an interface for the GoogleBase plug in that exposes methods used for Class or Course information entry types.
* Class or Course information entry types. *
* @author <a href="mailto:cooper@screaming-penguin.com">Robert "kebernet" Cooper</a> * @author <a href="mailto:cooper@screaming-penguin.com">Robert "kebernet" Cooper</a>
* @version $Revision: 1.2 $ * @version $Revision: 1.2 $
*/ */
public interface Course extends GlobalInterface { public interface Course extends GlobalInterface {
/** /**
* The timeframe a course is running. * The timeframe a course is running.
* *
* *
* <table border="1" cellpadding="5" cellspacing="0" width="640"> * <table border="1" cellpadding="5" cellspacing="0" width="640">
* *
* <tbody><tr valign="top"> * <tbody>
* * <tr valign="top">
* <td colspan="2" bgcolor="#dddddd"><font size="-1"> *
* <b><a name="course_date_range"></a>course_date_range</b></font></td> * <td colspan="2" bgcolor="#dddddd"><font size="-1"> <b><a name="course_date_range"></a>course_date_range</b></font></td>
* </tr> * </tr>
* <tr valign="top"> * <tr valign="top">
* <td width="120"><font size="-1"> * <td width="120"><font size="-1"> <b>Details</b></font></td>
* <b>Details</b></font></td> * <td><font size="-1">Date and time range a class is in session, in <a href="http://www.iso.org/iso/en/prods-services/popstds/datesandtime.html">ISO
* <td><font size="-1">Date and time range a class is in session, in <a href="http://www.iso.org/iso/en/prods-services/popstds/datesandtime.html">ISO 8601</a>. Two sub-attributes * 8601</a>. Two sub-attributes are included in course_date_range attribute.
* are included in course_date_range attribute.<ul type="disc"> * <ul type="disc">
* *
* <li>start = Start date and time of a trip in * <li>start = Start date and time of a trip in format YYYY-MM-DDThh:mm:ss</li>
* format YYYY-MM-DDThh:mm:ss</li> * <li>end = End date and time of a trip in format YYYY-MM-DDThh:mm:ss</li>
* <li>end = End date and time of a trip in * </ul>
* format YYYY-MM-DDThh:mm:ss</li></ul></font></td> * </font></td>
* </tr> * </tr>
* <tr valign="top"> * <tr valign="top">
* <td width="120"><font size="-1"> * <td width="120"><font size="-1"> <b>Example</b></font></td>
* <b>Example</b></font></td> * <td><font size="-1"> &lt;g:course_date_range&gt; <br>
* <td><font size="-1"> &lt;g:course_date_range&gt; <br> *
* * &lt;g:start&gt;2005-12-20T09:30:01&lt;/g:start&gt; <br>
* &lt;g:start&gt;2005-12-20T09:30:01&lt;/g:start&gt;
* <br>
* &lt;g:end&gt;2005-12-29T10:30:59&lt;/g:end&gt;<br> * &lt;g:end&gt;2005-12-29T10:30:59&lt;/g:end&gt;<br>
* &lt;/g:course_date_range&gt;</font></td> * &lt;/g:course_date_range&gt;</font></td>
* </tr> * </tr>
* <tr valign="top"> * <tr valign="top">
* *
* <td width="120"><font size="-1"> * <td width="120"><font size="-1">
* *
* <b>Attribute of</b></font></td> * <b>Attribute of</b></font></td>
* <td><font size="-1"> * <td><font size="-1"> Course schedules</font></td>
* Course schedules</font></td>
* </tr> * </tr>
* <tr valign="top"> * <tr valign="top">
* <td width="120"><font size="-1"> * <td width="120"><font size="-1">
* *
* <b>Content type</b></font></td> * <b>Content type</b></font></td>
* *
* <td><font size="-1"> * <td><font size="-1"> dateTimeRange</font></td>
* dateTimeRange</font></td>
* </tr> * </tr>
* </tbody></table> * </tbody>
* </table>
*
* @param courseDateRange The timeframe a course is running * @param courseDateRange The timeframe a course is running
*/ */
public void setCourseDateRange(DateTimeRange courseDateRange); public void setCourseDateRange(DateTimeRange courseDateRange);
/** /**
* The timeframe a course is running. * The timeframe a course is running.
* *
* *
* <table border="1" cellpadding="5" cellspacing="0" width="640"> * <table border="1" cellpadding="5" cellspacing="0" width="640">
* *
* <tbody><tr valign="top"> * <tbody>
* * <tr valign="top">
* <td colspan="2" bgcolor="#dddddd"><font size="-1"> *
* <b><a name="course_date_range"></a>course_date_range</b></font></td> * <td colspan="2" bgcolor="#dddddd"><font size="-1"> <b><a name="course_date_range"></a>course_date_range</b></font></td>
* </tr> * </tr>
* <tr valign="top"> * <tr valign="top">
* <td width="120"><font size="-1"> * <td width="120"><font size="-1"> <b>Details</b></font></td>
* <b>Details</b></font></td> * <td><font size="-1">Date and time range a class is in session, in <a href="http://www.iso.org/iso/en/prods-services/popstds/datesandtime.html">ISO
* <td><font size="-1">Date and time range a class is in session, in <a href="http://www.iso.org/iso/en/prods-services/popstds/datesandtime.html">ISO 8601</a>. Two sub-attributes * 8601</a>. Two sub-attributes are included in course_date_range attribute.
* are included in course_date_range attribute.<ul type="disc"> * <ul type="disc">
* *
* <li>start = Start date and time of a trip in * <li>start = Start date and time of a trip in format YYYY-MM-DDThh:mm:ss</li>
* format YYYY-MM-DDThh:mm:ss</li> * <li>end = End date and time of a trip in format YYYY-MM-DDThh:mm:ss</li>
* <li>end = End date and time of a trip in * </ul>
* format YYYY-MM-DDThh:mm:ss</li></ul></font></td> * </font></td>
* </tr> * </tr>
* <tr valign="top"> * <tr valign="top">
* <td width="120"><font size="-1"> * <td width="120"><font size="-1"> <b>Example</b></font></td>
* <b>Example</b></font></td> * <td><font size="-1"> &lt;g:course_date_range&gt; <br>
* <td><font size="-1"> &lt;g:course_date_range&gt; <br> *
* * &lt;g:start&gt;2005-12-20T09:30:01&lt;/g:start&gt; <br>
* &lt;g:start&gt;2005-12-20T09:30:01&lt;/g:start&gt;
* <br>
* &lt;g:end&gt;2005-12-29T10:30:59&lt;/g:end&gt;<br> * &lt;g:end&gt;2005-12-29T10:30:59&lt;/g:end&gt;<br>
* &lt;/g:course_date_range&gt;</font></td> * &lt;/g:course_date_range&gt;</font></td>
* </tr> * </tr>
* <tr valign="top"> * <tr valign="top">
* *
* <td width="120"><font size="-1"> * <td width="120"><font size="-1">
* *
* <b>Attribute of</b></font></td> * <b>Attribute of</b></font></td>
* <td><font size="-1"> * <td><font size="-1"> Course schedules</font></td>
* Course schedules</font></td>
* </tr> * </tr>
* <tr valign="top"> * <tr valign="top">
* <td width="120"><font size="-1"> * <td width="120"><font size="-1">
* *
* <b>Content type</b></font></td> * <b>Content type</b></font></td>
* *
* <td><font size="-1"> * <td><font size="-1"> dateTimeRange</font></td>
* dateTimeRange</font></td>
* </tr> * </tr>
* </tbody></table> * </tbody>
* </table>
*
* @return The timeframe a course is running * @return The timeframe a course is running
*/ */
public DateTimeRange getCourseDateRange(); public DateTimeRange getCourseDateRange();
/** /**
* ID code associated with a course. * ID code associated with a course.
* *
* *
* <table border="1" cellpadding="5" cellspacing="0" width="640"> * <table border="1" cellpadding="5" cellspacing="0" width="640">
* <tbody><tr valign="top"> * <tbody>
* <td colspan="2" bgcolor="#dddddd" valign="top"> <font size="-1"><b><a name="course_number"></a>course_number</b></font></td> * <tr valign="top">
* </tr> * <td colspan="2" bgcolor="#dddddd" valign="top"><font size="-1"><b><a name="course_number"></a>course_number</b></font></td>
* <tr valign="top"> * </tr>
* <td width="120"> <font size="-1"><b>Details</b></font></td> * <tr valign="top">
* * <td width="120"><font size="-1"><b>Details</b></font></td>
* <td> <font size="-1">ID code associated with a course</font></td> *
* * <td><font size="-1">ID code associated with a course</font></td>
* </tr> *
* <tr valign="top"> * </tr>
* <td width="120"> <font size="-1"><b>Example</b></font></td> * <tr valign="top">
* <td> <font size="-1">&lt;g:course_number&gt;HIST-90A&lt;/g:course_number&gt;</font></td> * <td width="120"><font size="-1"><b>Example</b></font></td>
* * <td><font size="-1">&lt;g:course_number&gt;HIST-90A&lt;/g:course_number&gt;</font></td>
* </tr> *
* <tr valign="top"> * </tr>
* * <tr valign="top">
* <td width="120"> <font size="-1"><b>Attribute *
* of</b></font></td> * <td width="120"><font size="-1"><b>Attribute of</b></font></td>
* <td> <font size="-1">Course schedules</font></td> * <td><font size="-1">Course schedules</font></td>
* </tr> * </tr>
* <tr valign="top"> * <tr valign="top">
* <td width="120"> <font size="-1"><b>Content * <td width="120"><font size="-1"><b>Content type</b></font></td>
* type</b></font></td> *
* * <td><font size="-1">string</font></td>
* <td> <font size="-1">string</font></td> *
* * </tr>
* </tr> * </tbody>
* </tbody></table> * </table>
*
* @param courseNumber ID code associated with a course * @param courseNumber ID code associated with a course
*/ */
public void setCourseNumber(String courseNumber); public void setCourseNumber(String courseNumber);
/** /**
* ID code associated with a course. * ID code associated with a course.
* *
* *
* *
* <table border="1" cellpadding="5" cellspacing="0" width="640"> * <table border="1" cellpadding="5" cellspacing="0" width="640">
* <tbody><tr valign="top"> * <tbody>
* <td colspan="2" bgcolor="#dddddd" valign="top"> <font size="-1"><b><a name="course_number"></a>course_number</b></font></td> * <tr valign="top">
* </tr> * <td colspan="2" bgcolor="#dddddd" valign="top"><font size="-1"><b><a name="course_number"></a>course_number</b></font></td>
* <tr valign="top"> * </tr>
* <td width="120"> <font size="-1"><b>Details</b></font></td> * <tr valign="top">
* * <td width="120"><font size="-1"><b>Details</b></font></td>
* <td> <font size="-1">ID code associated with a course</font></td> *
* * <td><font size="-1">ID code associated with a course</font></td>
* </tr> *
* <tr valign="top"> * </tr>
* <td width="120"> <font size="-1"><b>Example</b></font></td> * <tr valign="top">
* <td> <font size="-1">&lt;g:course_number&gt;HIST-90A&lt;/g:course_number&gt;</font></td> * <td width="120"><font size="-1"><b>Example</b></font></td>
* * <td><font size="-1">&lt;g:course_number&gt;HIST-90A&lt;/g:course_number&gt;</font></td>
* </tr> *
* <tr valign="top"> * </tr>
* * <tr valign="top">
* <td width="120"> <font size="-1"><b>Attribute *
* of</b></font></td> * <td width="120"><font size="-1"><b>Attribute of</b></font></td>
* <td> <font size="-1">Course schedules</font></td> * <td><font size="-1">Course schedules</font></td>
* </tr> * </tr>
* <tr valign="top"> * <tr valign="top">
* <td width="120"> <font size="-1"><b>Content * <td width="120"><font size="-1"><b>Content type</b></font></td>
* type</b></font></td> *
* * <td><font size="-1">string</font></td>
* <td> <font size="-1">string</font></td> *
* * </tr>
* </tr> * </tbody>
* </tbody></table> * </table>
*
* @return ID code associated with a course * @return ID code associated with a course
*/ */
public String getCourseNumber(); public String getCourseNumber();
/** /**
* Time a class is in session. * Time a class is in session.
* *
* *
* <table border="1" cellpadding="5" cellspacing="0" width="640"> * <table border="1" cellpadding="5" cellspacing="0" width="640">
* <tbody><tr valign="top"> * <tbody>
* <td colspan="2" bgcolor="#dddddd" valign="top"> <font size="-1"><b><a name="course_times"></a>course_times</b></font></td> * <tr valign="top">
* * <td colspan="2" bgcolor="#dddddd" valign="top"><font size="-1"><b><a name="course_times"></a>course_times</b></font></td>
* </tr> *
* * </tr>
* <tr valign="top"> *
* <td width="120"> <font size="-1"><b>Details</b></font></td> * <tr valign="top">
* <td> <font size="-1">Time a class is in session.</font></td> * <td width="120"><font size="-1"><b>Details</b></font></td>
* </tr> * <td><font size="-1">Time a class is in session.</font></td>
* <tr valign="top"> * </tr>
* <td width="120"> <font size="-1"><b>Example</b></font></td> * <tr valign="top">
* * <td width="120"><font size="-1"><b>Example</b></font></td>
* <td> <font size="-1">&lt;g:course_times&gt;MWF 08:30 - 09:45&lt;/g:course_times&gt;</font></td> *
* * <td><font size="-1">&lt;g:course_times&gt;MWF 08:30 - 09:45&lt;/g:course_times&gt;</font></td>
* </tr> *
* <tr valign="top"> * </tr>
* <td width="120"> <font size="-1"><b>Attribute * <tr valign="top">
* of</b></font></td> * <td width="120"><font size="-1"><b>Attribute of</b></font></td>
* <td> <font size="-1">Course schedules</font></td> * <td><font size="-1">Course schedules</font></td>
* *
* </tr> * </tr>
* <tr valign="top"> * <tr valign="top">
* <td width="120"> <font size="-1"><b>Content * <td width="120"><font size="-1"><b>Content type</b></font></td>
* type</b></font></td> *
* * <td><font size="-1">string</font></td>
* <td> <font size="-1">string</font></td> * </tr>
* </tr> * </tbody>
* </tbody></table> * </table>
*
* @param courseTimes Time a class is in session * @param courseTimes Time a class is in session
*/ */
public void setCourseTimes(String courseTimes); public void setCourseTimes(String courseTimes);
/** /**
* Time a class is in session. * Time a class is in session.
* *
* *
* *
* <table border="1" cellpadding="5" cellspacing="0" width="640"> * <table border="1" cellpadding="5" cellspacing="0" width="640">
* <tbody><tr valign="top"> * <tbody>
* <td colspan="2" bgcolor="#dddddd" valign="top"> <font size="-1"><b><a name="course_times"></a>course_times</b></font></td> * <tr valign="top">
* * <td colspan="2" bgcolor="#dddddd" valign="top"><font size="-1"><b><a name="course_times"></a>course_times</b></font></td>
* </tr> *
* * </tr>
* <tr valign="top"> *
* <td width="120"> <font size="-1"><b>Details</b></font></td> * <tr valign="top">
* <td> <font size="-1">Time a class is in session.</font></td> * <td width="120"><font size="-1"><b>Details</b></font></td>
* </tr> * <td><font size="-1">Time a class is in session.</font></td>
* <tr valign="top"> * </tr>
* <td width="120"> <font size="-1"><b>Example</b></font></td> * <tr valign="top">
* * <td width="120"><font size="-1"><b>Example</b></font></td>
* <td> <font size="-1">&lt;g:course_times&gt;MWF 08:30 - 09:45&lt;/g:course_times&gt;</font></td> *
* * <td><font size="-1">&lt;g:course_times&gt;MWF 08:30 - 09:45&lt;/g:course_times&gt;</font></td>
* </tr> *
* <tr valign="top"> * </tr>
* <td width="120"> <font size="-1"><b>Attribute * <tr valign="top">
* of</b></font></td> * <td width="120"><font size="-1"><b>Attribute of</b></font></td>
* <td> <font size="-1">Course schedules</font></td> * <td><font size="-1">Course schedules</font></td>
* *
* </tr> * </tr>
* <tr valign="top"> * <tr valign="top">
* <td width="120"> <font size="-1"><b>Content * <td width="120"><font size="-1"><b>Content type</b></font></td>
* type</b></font></td> *
* * <td><font size="-1">string</font></td>
* <td> <font size="-1">string</font></td> * </tr>
* </tr> * </tbody>
* </tbody></table> * </table>
*
* @return Time a class is in session * @return Time a class is in session
*/ */
public String getCourseTimes(); public String getCourseTimes();
/** /**
* Salary for this position. * Salary for this position.
* *
* *
* *
* <table border="1" cellpadding="5" cellspacing="0" width="640"> * <table border="1" cellpadding="5" cellspacing="0" width="640">
* <tbody><tr valign="top"> * <tbody>
* <td colspan="2" bgcolor="#dddddd" valign="top"><font size="-1">
* <b><a name="salary"></a>salary</b></font></td>
* </tr>
*
* <tr valign="top"> * <tr valign="top">
* * <td colspan="2" bgcolor="#dddddd" valign="top"><font size="-1"> <b><a name="salary"></a>salary</b></font></td>
* <td width="120"><font size="-1"> * </tr>
* <b>Details</b></font></td> *
* <td><font size="-1"> * <tr valign="top">
* Salary for this position. Non-numeric values such as "$" symbols are not acceptable. </font></td> *
* <td width="120"><font size="-1"> <b>Details</b></font></td>
* <td><font size="-1"> Salary for this position. Non-numeric values such as "$" symbols are not acceptable. </font></td>
* </tr> * </tr>
* <tr valign="top"> * <tr valign="top">
* *
* <td width="120"><font size="-1"> * <td width="120"><font size="-1">
* *
* <b>Example</b></font></td> * <b>Example</b></font></td>
* <td><font size="-1"> * <td><font size="-1"> &lt;g:salary&gt;55000&lt;/g:salary&gt;</font></td>
* &lt;g:salary&gt;55000&lt;/g:salary&gt;</font></td>
* </tr> * </tr>
* <tr valign="top"> * <tr valign="top">
* <td width="120"><font size="-1"> * <td width="120"><font size="-1">
* *
* <b>Attribute of</b></font></td> * <b>Attribute of</b></font></td>
* *
* <td><font size="-1"> * <td><font size="-1"> Jobs</font></td>
* Jobs</font></td>
* </tr> * </tr>
* <tr valign="top"> * <tr valign="top">
* <td width="120"><font size="-1"> * <td width="120"><font size="-1"> <b>Content type</b></font></td>
* <b>Content type</b></font></td> *
* * <td><font size="-1">
* <td><font size="-1"> *
*
* float</font></td> * float</font></td>
* </tr> * </tr>
* </tbody></table> * </tbody>
* </table>
*
* @param salary Salary for this position * @param salary Salary for this position
*/ */
public void setSalary(Float salary); public void setSalary(Float salary);
/** /**
* Salary for this position. * Salary for this position.
* *
* *
* <table border="1" cellpadding="5" cellspacing="0" width="640"> * <table border="1" cellpadding="5" cellspacing="0" width="640">
* <tbody><tr valign="top"> * <tbody>
* <td colspan="2" bgcolor="#dddddd" valign="top"><font size="-1">
* <b><a name="salary"></a>salary</b></font></td>
* </tr>
*
* <tr valign="top"> * <tr valign="top">
* * <td colspan="2" bgcolor="#dddddd" valign="top"><font size="-1"> <b><a name="salary"></a>salary</b></font></td>
* <td width="120"><font size="-1"> * </tr>
* <b>Details</b></font></td> *
* <td><font size="-1"> * <tr valign="top">
* Salary for this position. Non-numeric values such as "$" symbols are not acceptable. </font></td> *
* <td width="120"><font size="-1"> <b>Details</b></font></td>
* <td><font size="-1"> Salary for this position. Non-numeric values such as "$" symbols are not acceptable. </font></td>
* </tr> * </tr>
* <tr valign="top"> * <tr valign="top">
* *
* <td width="120"><font size="-1"> * <td width="120"><font size="-1">
* *
* <b>Example</b></font></td> * <b>Example</b></font></td>
* <td><font size="-1"> * <td><font size="-1"> &lt;g:salary&gt;55000&lt;/g:salary&gt;</font></td>
* &lt;g:salary&gt;55000&lt;/g:salary&gt;</font></td>
* </tr> * </tr>
* <tr valign="top"> * <tr valign="top">
* <td width="120"><font size="-1"> * <td width="120"><font size="-1">
* *
* <b>Attribute of</b></font></td> * <b>Attribute of</b></font></td>
* *
* <td><font size="-1"> * <td><font size="-1"> Jobs</font></td>
* Jobs</font></td>
* </tr> * </tr>
* <tr valign="top"> * <tr valign="top">
* <td width="120"><font size="-1"> * <td width="120"><font size="-1"> <b>Content type</b></font></td>
* <b>Content type</b></font></td> *
* * <td><font size="-1">
* <td><font size="-1"> *
*
* float</font></td> * float</font></td>
* </tr> * </tr>
* </tbody></table> * </tbody>
* </table>
*
* @return Salary for this position * @return Salary for this position
*/ */
public Float getSalary(); public Float getSalary();
/** /**
* Topics of study for a course. * Topics of study for a course.
* *
* *
* <table border="1" cellpadding="5" cellspacing="0" width="640"> * <table border="1" cellpadding="5" cellspacing="0" width="640">
* <tbody><tr valign="top"> * <tbody>
* <td colspan="2" bgcolor="#dddddd" valign="top"><font size="-1"> * <tr valign="top">
* <b><a name="subject"></a>subject</b></font></td> * <td colspan="2" bgcolor="#dddddd" valign="top"><font size="-1"> <b><a name="subject"></a>subject</b></font></td>
* </tr> * </tr>
* <tr valign="top"> * <tr valign="top">
* *
* <td width="120"><font size="-1"> * <td width="120"><font size="-1">
* *
* <b>Details</b></font></td> * <b>Details</b></font></td>
* <td><font size="-1"> * <td><font size="-1"> Topic of study for a course.</font></td>
* Topic of study for a course.</font></td>
* </tr> * </tr>
* <tr valign="top"> * <tr valign="top">
* <td width="120"><font size="-1"> * <td width="120"><font size="-1"> <b>Example</b></font></td>
* <b>Example</b></font></td> *
* * <td><font size="-1"> &lt;g:subject&gt;Trigonometry&lt;/g:subject&gt;</font></td>
* <td><font size="-1"> &lt;g:subject&gt;Trigonometry&lt;/g:subject&gt;</font></td>
* </tr> * </tr>
* <tr valign="top"> * <tr valign="top">
* <td width="120"><font size="-1"> * <td width="120"><font size="-1"> <b>Attribute of</b></font></td>
* <b>Attribute of</b></font></td> * <td><font size="-1">
* <td><font size="-1"> *
* * Course schedules</font></td>
* Course schedules</font></td>
* </tr> * </tr>
* <tr valign="top"> * <tr valign="top">
* <td width="120"><font size="-1"> * <td width="120"><font size="-1"> <b>Content type</b></font></td>
* <b>Content type</b></font></td> * <td><font size="-1"> string</font></td>
* <td><font size="-1"> *
* string</font></td>
*
* </tr> * </tr>
* </tbody></table> * </tbody>
* </table>
*
* @param subject Topics of study for a course * @param subject Topics of study for a course
*/ */
public void setSubjects(String[] subject); public void setSubjects(String[] subject);
/** /**
* Topics of study for a course. * Topics of study for a course.
* *
* *
* <table border="1" cellpadding="5" cellspacing="0" width="640"> * <table border="1" cellpadding="5" cellspacing="0" width="640">
* <tbody><tr valign="top"> * <tbody>
* <td colspan="2" bgcolor="#dddddd" valign="top"><font size="-1"> * <tr valign="top">
* <b><a name="subject"></a>subject</b></font></td> * <td colspan="2" bgcolor="#dddddd" valign="top"><font size="-1"> <b><a name="subject"></a>subject</b></font></td>
* </tr> * </tr>
* <tr valign="top"> * <tr valign="top">
* *
* <td width="120"><font size="-1"> * <td width="120"><font size="-1">
* *
* <b>Details</b></font></td> * <b>Details</b></font></td>
* <td><font size="-1"> * <td><font size="-1"> Topic of study for a course.</font></td>
* Topic of study for a course.</font></td>
* </tr> * </tr>
* <tr valign="top"> * <tr valign="top">
* <td width="120"><font size="-1"> * <td width="120"><font size="-1"> <b>Example</b></font></td>
* <b>Example</b></font></td> *
* * <td><font size="-1"> &lt;g:subject&gt;Trigonometry&lt;/g:subject&gt;</font></td>
* <td><font size="-1"> &lt;g:subject&gt;Trigonometry&lt;/g:subject&gt;</font></td>
* </tr> * </tr>
* <tr valign="top"> * <tr valign="top">
* <td width="120"><font size="-1"> * <td width="120"><font size="-1"> <b>Attribute of</b></font></td>
* <b>Attribute of</b></font></td> * <td><font size="-1">
* <td><font size="-1"> *
* * Course schedules</font></td>
* Course schedules</font></td>
* </tr> * </tr>
* <tr valign="top"> * <tr valign="top">
* <td width="120"><font size="-1"> * <td width="120"><font size="-1"> <b>Content type</b></font></td>
* <b>Content type</b></font></td> * <td><font size="-1"> string</font></td>
* <td><font size="-1"> *
* string</font></td>
*
* </tr> * </tr>
* </tbody></table> * </tbody>
* </table>
*
* @return Topics of study for a course * @return Topics of study for a course
*/ */
public String[] getSubjects(); public String[] getSubjects();
@ -484,41 +471,38 @@ public interface Course extends GlobalInterface {
/** /**
* Name of the school at which a class is offered. * Name of the school at which a class is offered.
* <table border="1" cellpadding="5" cellspacing="0" width="640"> * <table border="1" cellpadding="5" cellspacing="0" width="640">
* <tbody><tr valign="top"> * <tbody>
* <td colspan="2" bgcolor="#dddddd" valign="top"><font size="-1"> * <tr valign="top">
* <b><a name="university"></a>university</b></font></td> * <td colspan="2" bgcolor="#dddddd" valign="top"><font size="-1"> <b><a name="university"></a>university</b></font></td>
* *
* </tr> * </tr>
* <tr valign="top"> * <tr valign="top">
* <td width="120"><font size="-1"> * <td width="120"><font size="-1"> <b>Details</b></font></td>
* <b>Details</b></font></td> * <td><font size="-1"> Name of the school a class is offered at. </font></td>
* <td><font size="-1">
* Name of the school a class is offered at. </font></td>
* </tr> * </tr>
* *
* <tr valign="top"> * <tr valign="top">
* *
* <td width="120"><font size="-1"> * <td width="120"><font size="-1"> <b>Example</b></font></td>
* <b>Example</b></font></td> * <td><font size="-1"> &lt;g:university&gt;Stanford&lt;/g:university&gt;</font></td>
* <td><font size="-1"> &lt;g:university&gt;Stanford&lt;/g:university&gt;</font></td>
* </tr> * </tr>
* <tr valign="top"> * <tr valign="top">
* *
* <td width="120"><font size="-1"> * <td width="120"><font size="-1">
* *
* <b>Attribute of</b></font></td> * <b>Attribute of</b></font></td>
* <td><font size="-1"> * <td><font size="-1"> Course schedules</font></td>
* Course schedules</font></td>
* </tr> * </tr>
* <tr valign="top"> * <tr valign="top">
* <td width="120"><font size="-1"> * <td width="120"><font size="-1"> <b>Content type</b></font></td>
* <b>Content type</b></font></td> *
* * <td><font size="-1">
* <td><font size="-1"> *
* * string</font></td>
* string</font></td>
* </tr> * </tr>
* </tbody></table> * </tbody>
* </table>
*
* @param university Name of the school at which a class is offered. * @param university Name of the school at which a class is offered.
*/ */
public void setUniversity(String university); public void setUniversity(String university);
@ -526,41 +510,38 @@ public interface Course extends GlobalInterface {
/** /**
* Name of the school at which a class is offered. * Name of the school at which a class is offered.
* <table border="1" cellpadding="5" cellspacing="0" width="640"> * <table border="1" cellpadding="5" cellspacing="0" width="640">
* <tbody><tr valign="top"> * <tbody>
* <td colspan="2" bgcolor="#dddddd" valign="top"><font size="-1"> * <tr valign="top">
* <b><a name="university"></a>university</b></font></td> * <td colspan="2" bgcolor="#dddddd" valign="top"><font size="-1"> <b><a name="university"></a>university</b></font></td>
* *
* </tr> * </tr>
* <tr valign="top"> * <tr valign="top">
* <td width="120"><font size="-1"> * <td width="120"><font size="-1"> <b>Details</b></font></td>
* <b>Details</b></font></td> * <td><font size="-1"> Name of the school a class is offered at. </font></td>
* <td><font size="-1">
* Name of the school a class is offered at. </font></td>
* </tr> * </tr>
* *
* <tr valign="top"> * <tr valign="top">
* *
* <td width="120"><font size="-1"> * <td width="120"><font size="-1"> <b>Example</b></font></td>
* <b>Example</b></font></td> * <td><font size="-1"> &lt;g:university&gt;Stanford&lt;/g:university&gt;</font></td>
* <td><font size="-1"> &lt;g:university&gt;Stanford&lt;/g:university&gt;</font></td>
* </tr> * </tr>
* <tr valign="top"> * <tr valign="top">
* *
* <td width="120"><font size="-1"> * <td width="120"><font size="-1">
* *
* <b>Attribute of</b></font></td> * <b>Attribute of</b></font></td>
* <td><font size="-1"> * <td><font size="-1"> Course schedules</font></td>
* Course schedules</font></td>
* </tr> * </tr>
* <tr valign="top"> * <tr valign="top">
* <td width="120"><font size="-1"> * <td width="120"><font size="-1"> <b>Content type</b></font></td>
* <b>Content type</b></font></td> *
* * <td><font size="-1">
* <td><font size="-1"> *
* * string</font></td>
* string</font></td>
* </tr> * </tr>
* </tbody></table> * </tbody>
* </table>
*
* @return Name of the school at which a class is offered. * @return Name of the school at which a class is offered.
*/ */
public String getUniversity(); public String getUniversity();

View file

@ -20,106 +20,111 @@
package org.rometools.feed.module.base; package org.rometools.feed.module.base;
/** /**
* This class represents a custom tag name and value. * This class represents a custom tag name and value.
*
* @author <a href="mailto:cooper@screaming-penguin.com">Robert "kebernet" Cooper</a> * @author <a href="mailto:cooper@screaming-penguin.com">Robert "kebernet" Cooper</a>
* @version $Revision: 1.2 $ * @version $Revision: 1.2 $
*/ */
public interface CustomTag { public interface CustomTag {
/** /**
* Returns the tag name used. * Returns the tag name used.
*
* @return Returns the tag name used. * @return Returns the tag name used.
*/ */
public String getName(); public String getName();
/** /**
* The value of the custom tag. * The value of the custom tag. <br>
* <br>
* <br> * <br>
* <table border="1" cellpadding="6" cellspacing="0"> * <table border="1" cellpadding="6" cellspacing="0">
* <tbody><tr valign="top"> * <tbody>
* <td><strong><font size="-1">Type (JavaType)</font></strong></td> * <tr valign="top">
* <td><strong><font size="-1">Type (JavaType)</font></strong></td>
* *
* <td><strong><font size="-1">Description</font></strong></td> * <td><strong><font size="-1">Description</font></strong></td>
* <td><strong><font size="-1">Examples</font></strong></td> * <td><strong><font size="-1">Examples</font></strong></td>
* </tr> * </tr>
* <tr valign="top"> * <tr valign="top">
* <td><font size="-1">string (String)</font></td> * <td><font size="-1">string (String)</font></td>
* <td><font size="-1">Any string</font></td> * <td><font size="-1">Any string</font></td>
* <td><font size="-1">Blue</font></td> * <td><font size="-1">Blue</font></td>
* *
* </tr> * </tr>
* <tr valign="top"> * <tr valign="top">
* <td><font size="-1">int (Integer)</font></td> * <td><font size="-1">int (Integer)</font></td>
* <td><font size="-1">Whole number values</font></td> * <td><font size="-1">Whole number values</font></td>
* <td><font size="-1">1000</font></td> * <td><font size="-1">1000</font></td>
* </tr> * </tr>
* <tr valign="top"> * <tr valign="top">
* *
* <td><font size="-1">float (Float)</font></td> * <td><font size="-1">float (Float)</font></td>
* <td><font size="-1">Numbers with decimal digits</font></td> * <td><font size="-1">Numbers with decimal digits</font></td>
* <td><font size="-1">3.5</font></td> * <td><font size="-1">3.5</font></td>
* </tr> * </tr>
* <tr valign="top"> * <tr valign="top">
* <td><font size="-1">intUnit (IntUnit)</font></td> * <td><font size="-1">intUnit (IntUnit)</font></td>
* *
* <td><font size="-1">Whole number value and a string</font></td> * <td><font size="-1">Whole number value and a string</font></td>
* *
* <td><font size="-1">10 km</font></td> * <td><font size="-1">10 km</font></td>
* </tr> * </tr>
* <tr valign="top"> * <tr valign="top">
* <td><font size="-1">floatUnit (FloatUnit)</font></td> * <td><font size="-1">floatUnit (FloatUnit)</font></td>
* <td><font size="-1">Numbers with decimal digits and a string</font></td> * <td><font size="-1">Numbers with decimal digits and a string</font></td>
* *
* <td><font size="-1">1.5 km</font></td> * <td><font size="-1">1.5 km</font></td>
* </tr> * </tr>
* *
* <tr valign="top"> * <tr valign="top">
* <td><font size="-1">date (ShortDate)</font></td> * <td><font size="-1">date (ShortDate)</font></td>
* <td><font size="-1">Date of an event, in format YYYY-MM-DD</font></td> * <td><font size="-1">Date of an event, in format YYYY-MM-DD</font></td>
* <td><font size="-1">2005-12-12</font></td> * <td><font size="-1">2005-12-12</font></td>
* </tr> * </tr>
* *
* <tr valign="top"> * <tr valign="top">
* <td><font size="-1">dateTime (java.util.Date)</font></td> * <td><font size="-1">dateTime (java.util.Date)</font></td>
* *
* <td><font size="-1">Date and time for an event, in format YYYY-MM-DDThh:mm:ss</font></td> * <td><font size="-1">Date and time for an event, in format YYYY-MM-DDThh:mm:ss</font></td>
* <td><font size="-1">2005-12-12T12:00:00 </font></td> * <td><font size="-1">2005-12-12T12:00:00 </font></td>
* </tr> * </tr>
* <tr valign="top"> * <tr valign="top">
* <td><font size="-1">dateTimeRange (DateTimeRange)</font></td> * <td><font size="-1">dateTimeRange (DateTimeRange)</font></td>
* *
* <td><font size="-1">Start and end dates for an event. An attribute of this type will contain two sub-attributes, &lt;start&gt; and &lt;end&gt; in format YYYY-MM-DD</font></td> * <td><font size="-1">Start and end dates for an event. An attribute of this type will contain two sub-attributes, &lt;start&gt; and &lt;end&gt; in format
* YYYY-MM-DD</font></td>
* *
* <td><font size="-1">&lt;start&gt;1975-09-25&lt;/start&gt;<br>&lt;end&gt;1975-09-25&lt;/end&gt; * <td><font size="-1">&lt;start&gt;1975-09-25&lt;/start&gt;<br>
* &lt;end&gt;1975-09-25&lt;/end&gt;
* *
* </font></td> * </font></td>
* </tr> * </tr>
* <tr valign="top"> * <tr valign="top">
* <td><font size="-1">url (java.net.URL)</font></td> * <td><font size="-1">url (java.net.URL)</font></td>
* <td><font size="-1">HTTP URL </font></td> * <td><font size="-1">HTTP URL </font></td>
* *
* <td><font size="-1">http://www.google.com</font></td> * <td><font size="-1">http://www.google.com</font></td>
* </tr> * </tr>
* *
* <tr valign="top"> * <tr valign="top">
* <td><font size="-1">boolean (Boolean)</font></td> * <td><font size="-1">boolean (Boolean)</font></td>
* <td><font size="-1">Value may be either true or false.</font></td> * <td><font size="-1">Value may be either true or false.</font></td>
* <td><font size="-1">true</font></td> * <td><font size="-1">true</font></td>
* </tr> * </tr>
* *
* <tr valign="top"> * <tr valign="top">
* <td><font size="-1">location (CustomTagImpl.Location)</font></td> * <td><font size="-1">location (CustomTagImpl.Location)</font></td>
* *
* <td><font size="-1">Location</font></td> * <td><font size="-1">Location</font></td>
* <td><font size="-1">921 W. Dana Street, Mtn View, CA-94103 </font></td> * <td><font size="-1">921 W. Dana Street, Mtn View, CA-94103 </font></td>
* </tr> * </tr>
*
* </tbody>
* </table>
* *
* </tbody></table>
* @return The value of the tag. The objects class is determined by the "type" attribute on the tag. * @return The value of the tag. The objects class is determined by the "type" attribute on the tag.
*/ */
public Object getValue(); public Object getValue();
} }

View file

@ -19,179 +19,191 @@
*/ */
package org.rometools.feed.module.base; package org.rometools.feed.module.base;
import java.net.URL;
import java.util.Date;
import org.rometools.feed.module.base.types.DateTimeRange; import org.rometools.feed.module.base.types.DateTimeRange;
import org.rometools.feed.module.base.types.FloatUnit; import org.rometools.feed.module.base.types.FloatUnit;
import org.rometools.feed.module.base.types.IntUnit; import org.rometools.feed.module.base.types.IntUnit;
import org.rometools.feed.module.base.types.ShortDate; import org.rometools.feed.module.base.types.ShortDate;
import java.net.URL;
import java.util.Date;
/** /**
* @version $Revision: 1.1 $ * @version $Revision: 1.1 $
* @author <a href="mailto:cooper@screaming-penguin.com">Robert "kebernet" Cooper</a> * @author <a href="mailto:cooper@screaming-penguin.com">Robert "kebernet" Cooper</a>
*/ */
public class CustomTagImpl implements CustomTag { public class CustomTagImpl implements CustomTag {
private Object value; private Object value;
private String name; private final String name;
/** Creates a new instance of CustomTagImpl */ /** Creates a new instance of CustomTagImpl */
public CustomTagImpl(String name,String value) { public CustomTagImpl(final String name, final String value) {
if( name == null || value == null ){ throw new NullPointerException("Name and Value cannont be null."); } if (name == null || value == null) {
throw new NullPointerException("Name and Value cannont be null.");
}
this.name = name; this.name = name;
this.value = value; this.value = value;
} }
public CustomTagImpl(String name,Integer value) { public CustomTagImpl(final String name, final Integer value) {
if( name == null || value == null ){ throw new NullPointerException("Name and Value cannont be null."); } if (name == null || value == null) {
throw new NullPointerException("Name and Value cannont be null.");
}
this.name = name; this.name = name;
this.value = value; this.value = value;
} }
public CustomTagImpl(String name,Float value) { public CustomTagImpl(final String name, final Float value) {
if( name == null || value == null ){ throw new NullPointerException("Name and Value cannont be null."); } if (name == null || value == null) {
throw new NullPointerException("Name and Value cannont be null.");
}
this.name = name; this.name = name;
this.value = value; this.value = value;
} }
public CustomTagImpl(String name,IntUnit value) { public CustomTagImpl(final String name, final IntUnit value) {
if( name == null || value == null ){ throw new NullPointerException("Name and Value cannont be null."); } if (name == null || value == null) {
throw new NullPointerException("Name and Value cannont be null.");
}
this.name = name; this.name = name;
this.value = value; this.value = value;
} }
public CustomTagImpl(String name,FloatUnit value) { public CustomTagImpl(final String name, final FloatUnit value) {
if( name == null || value == null ){ throw new NullPointerException("Name and Value cannont be null."); } if (name == null || value == null) {
throw new NullPointerException("Name and Value cannont be null.");
}
this.name = name; this.name = name;
this.value = value; this.value = value;
} }
public CustomTagImpl(String name,ShortDate value) { public CustomTagImpl(final String name, final ShortDate value) {
if( name == null || value == null ){ throw new NullPointerException("Name and Value cannont be null."); } if (name == null || value == null) {
throw new NullPointerException("Name and Value cannont be null.");
}
this.name = name; this.name = name;
this.value = value; this.value = value;
} }
public CustomTagImpl(String name,Date value) { public CustomTagImpl(final String name, final Date value) {
if( name == null || value == null ){ throw new NullPointerException("Name and Value cannont be null."); } if (name == null || value == null) {
throw new NullPointerException("Name and Value cannont be null.");
}
this.name = name; this.name = name;
this.value = value; this.value = value;
} }
public CustomTagImpl(String name,DateTimeRange value) { public CustomTagImpl(final String name, final DateTimeRange value) {
if( name == null || value == null ){ throw new NullPointerException("Name and Value cannont be null."); } if (name == null || value == null) {
throw new NullPointerException("Name and Value cannont be null.");
}
this.name = name; this.name = name;
this.value = value; this.value = value;
} }
public CustomTagImpl(String name,URL value) { public CustomTagImpl(final String name, final URL value) {
if( name == null || value == null ){ throw new NullPointerException("Name and Value cannont be null."); } if (name == null || value == null) {
throw new NullPointerException("Name and Value cannont be null.");
}
this.name = name; this.name = name;
this.value = value; this.value = value;
} }
public CustomTagImpl(String name,Boolean value) { public CustomTagImpl(final String name, final Boolean value) {
if( name == null || value == null ){ throw new NullPointerException("Name and Value cannont be null."); } if (name == null || value == null) {
throw new NullPointerException("Name and Value cannont be null.");
}
this.name = name; this.name = name;
this.value = value; this.value = value;
} }
public CustomTagImpl(String name,Location value) { public CustomTagImpl(final String name, final Location value) {
if( name == null || value == null ){ throw new NullPointerException("Name and Value cannont be null."); } if (name == null || value == null) {
throw new NullPointerException("Name and Value cannont be null.");
}
this.name = name; this.name = name;
this.value = value; this.value = value;
} }
public String getName() { public String getName() {
return this.name; return name;
} }
public Object getValue() { public Object getValue() {
return this.value; return value;
} }
public boolean equals( Object o ){ @Override
if( o instanceof CustomTag ){ public boolean equals(final Object o) {
CustomTag tag = (CustomTag) o; if (o instanceof CustomTag) {
if( this.name.equals( tag.getName() ) && this.value.equals( tag.getValue() )) final CustomTag tag = (CustomTag) o;
return true; if (name.equals(tag.getName()) && value.equals(tag.getValue())) {
} return true;
return false; }
}
return false;
} }
/** /**
* Creates and returns a copy of this object. The precise meaning * Creates and returns a copy of this object. The precise meaning of "copy" may depend on the class of the object. The general intent is that, for any
* of "copy" may depend on the class of the object. The general * object <tt>x</tt>, the expression: <blockquote>
* intent is that, for any object <tt>x</tt>, the expression:
* <blockquote>
* <pre>
* x.clone() != x</pre></blockquote>
* will be true, and that the expression:
* <blockquote>
* <pre>
* x.clone().getClass() == x.getClass()</pre></blockquote>
* will be <tt>true</tt>, but these are not absolute requirements.
* While it is typically the case that:
* <blockquote>
* <pre>
* x.clone().equals(x)</pre></blockquote>
* will be <tt>true</tt>, this is not an absolute requirement.
* <p>
* By convention, the returned object should be obtained by calling
* <tt>super.clone</tt>. If a class and all of its superclasses (except
* <tt>Object</tt>) obey this convention, it will be the case that
* <tt>x.clone().getClass() == x.getClass()</tt>.
* <p>
* By convention, the object returned by this method should be independent
* of this object (which is being cloned). To achieve this independence,
* it may be necessary to modify one or more fields of the object returned
* by <tt>super.clone</tt> before returning it. Typically, this means
* copying any mutable objects that comprise the internal "deep structure"
* of the object being cloned and replacing the references to these
* objects with references to the copies. If a class contains only
* primitive fields or references to immutable objects, then it is usually
* the case that no fields in the object returned by <tt>super.clone</tt>
* need to be modified.
* <p>
* The method <tt>clone</tt> for class <tt>Object</tt> performs a
* specific cloning operation. First, if the class of this object does
* not implement the interface <tt>Cloneable</tt>, then a
* <tt>CloneNotSupportedException</tt> is thrown. Note that all arrays
* are considered to implement the interface <tt>Cloneable</tt>.
* Otherwise, this method creates a new instance of the class of this
* object and initializes all its fields with exactly the contents of
* the corresponding fields of this object, as if by assignment; the
* contents of the fields are not themselves cloned. Thus, this method
* performs a "shallow copy" of this object, not a "deep copy" operation.
* <p>
* The class <tt>Object</tt> does not itself implement the interface
* <tt>Cloneable</tt>, so calling the <tt>clone</tt> method on an object
* whose class is <tt>Object</tt> will result in throwing an
* exception at run time.
* *
* @return a clone of this instance. * <pre>
* @exception CloneNotSupportedException if the object's class does not * x.clone() != x
* support the <code>Cloneable</code> interface. Subclasses * </pre>
* that override the <code>clone</code> method can also *
* throw this exception to indicate that an instance cannot * </blockquote> will be true, and that the expression: <blockquote>
* be cloned. *
* <pre>
* x.clone().getClass() == x.getClass()
* </pre>
*
* </blockquote> will be <tt>true</tt>, but these are not absolute requirements. While it is typically the case that: <blockquote>
*
* <pre>
* x.clone().equals(x)
* </pre>
*
* </blockquote> will be <tt>true</tt>, this is not an absolute requirement.
* <p>
* By convention, the returned object should be obtained by calling <tt>super.clone</tt>. If a class and all of its superclasses (except <tt>Object</tt>)
* obey this convention, it will be the case that <tt>x.clone().getClass() == x.getClass()</tt>.
* <p>
* By convention, the object returned by this method should be independent of this object (which is being cloned). To achieve this independence, it may be
* necessary to modify one or more fields of the object returned by <tt>super.clone</tt> before returning it. Typically, this means copying any mutable
* objects that comprise the internal "deep structure" of the object being cloned and replacing the references to these objects with references to the
* copies. If a class contains only primitive fields or references to immutable objects, then it is usually the case that no fields in the object returned
* by <tt>super.clone</tt> need to be modified.
* <p>
* The method <tt>clone</tt> for class <tt>Object</tt> performs a specific cloning operation. First, if the class of this object does not implement the
* interface <tt>Cloneable</tt>, then a <tt>CloneNotSupportedException</tt> is thrown. Note that all arrays are considered to implement the interface
* <tt>Cloneable</tt>. Otherwise, this method creates a new instance of the class of this object and initializes all its fields with exactly the contents of
* the corresponding fields of this object, as if by assignment; the contents of the fields are not themselves cloned. Thus, this method performs a
* "shallow copy" of this object, not a "deep copy" operation.
* <p>
* The class <tt>Object</tt> does not itself implement the interface <tt>Cloneable</tt>, so calling the <tt>clone</tt> method on an object whose class is
* <tt>Object</tt> will result in throwing an exception at run time.
*
* @return a clone of this instance.
* @exception CloneNotSupportedException if the object's class does not support the <code>Cloneable</code> interface. Subclasses that override the
* <code>clone</code> method can also throw this exception to indicate that an instance cannot be cloned.
* @see java.lang.Cloneable * @see java.lang.Cloneable
*/ */
@Override
public Object clone() throws CloneNotSupportedException { public Object clone() throws CloneNotSupportedException {
CustomTagImpl cti = new CustomTagImpl( this.name, "" ); final CustomTagImpl cti = new CustomTagImpl(name, "");
cti.value = this.value; cti.value = value;
return cti; return cti;
} }
@Override
public String toString() { public String toString() {
return "[custom name=\""+this.name+"\" value=\""+this.value.toString()+"\"]"; return "[custom name=\"" + name + "\" value=\"" + value.toString() + "\"]";
} }
public static class Location {
private String value;
public Location(String value) { public static class Location {
private final String value;
public Location(final String value) {
this.value = value; this.value = value;
} }
@ -199,17 +211,23 @@ public class CustomTagImpl implements CustomTag {
return value; return value;
} }
@Override
public Object clone() { public Object clone() {
return new Location(this.value); return new Location(value);
} }
@Override
public String toString() { public String toString() {
return value; return value;
} }
public boolean equals( Object o ){ @Override
if( o instanceof Location && ((Location) o).value.equals(this.value) ) return true; public boolean equals(final Object o) {
else return false; if (o instanceof Location && ((Location) o).value.equals(value)) {
} return true;
} else {
return false;
}
}
} }
} }

View file

@ -20,19 +20,20 @@
package org.rometools.feed.module.base; package org.rometools.feed.module.base;
import com.sun.syndication.feed.module.Module;
import java.util.List; import java.util.List;
import com.sun.syndication.feed.module.Module;
/** /**
* @version $Revision: 1.1 $ * @version $Revision: 1.1 $
* @author <a href="mailto:cooper@screaming-penguin.com">Robert "kebernet" Cooper</a> * @author <a href="mailto:cooper@screaming-penguin.com">Robert "kebernet" Cooper</a>
*/ */
public interface CustomTags extends Module { public interface CustomTags extends Module {
public static final String URI = "http://base.google.com/cns/1.0"; public static final String URI = "http://base.google.com/cns/1.0";
public List getValues(); public List getValues();
public void setValues(List values); public void setValues(List values);
} }

View file

@ -20,49 +20,50 @@
package org.rometools.feed.module.base; package org.rometools.feed.module.base;
import com.sun.syndication.feed.CopyFrom;
import java.util.ArrayList; import java.util.ArrayList;
import java.util.List; import java.util.List;
import com.sun.syndication.feed.CopyFrom;
/** /**
* @version $Revision: 1.1 $ * @version $Revision: 1.1 $
* @author <a href="mailto:cooper@screaming-penguin.com">Robert "kebernet" Cooper</a> * @author <a href="mailto:cooper@screaming-penguin.com">Robert "kebernet" Cooper</a>
*/ */
public class CustomTagsImpl implements CustomTags { public class CustomTagsImpl implements CustomTags {
private List values; private List values;
/** Creates a new instance of CustomTagsImpl */ /** Creates a new instance of CustomTagsImpl */
public CustomTagsImpl() { public CustomTagsImpl() {
} }
public List getValues(){ public List getValues() {
values = (values == null )? new ArrayList() : values; values = values == null ? new ArrayList() : values;
return values; return values;
} }
public void setValues(List values){ public void setValues(final List values) {
this.values = values; this.values = values;
} }
public void copyFrom(CopyFrom object) { public void copyFrom(final CopyFrom object) {
CustomTags ct = (CustomTags) object; final CustomTags ct = (CustomTags) object;
this.values = new ArrayList( ct.getValues() ); values = new ArrayList(ct.getValues());
} }
@Override @Override
public Object clone() { public Object clone() {
CustomTagsImpl cti = new CustomTagsImpl(); final CustomTagsImpl cti = new CustomTagsImpl();
cti.values = new ArrayList( this.values ); cti.values = new ArrayList(values);
return cti; return cti;
} }
public Class getInterface(){ public Class getInterface() {
return CustomTags.class; return CustomTags.class;
} }
public String getUri() { public String getUri() {
return CustomTags.URI; return CustomTags.URI;
} }
} }

File diff suppressed because it is too large Load diff

View file

@ -43,489 +43,479 @@ import java.io.Serializable;
import java.net.URL; import java.net.URL;
import java.util.Date; import java.util.Date;
/** /**
* This is an interface representing the universals. * This is an interface representing the universals.
*
* @author <a href="mailto:cooper@screaming-penguin.com">Robert "kebernet" Cooper</a> * @author <a href="mailto:cooper@screaming-penguin.com">Robert "kebernet" Cooper</a>
* @version $Revision: 1.2 $ * @version $Revision: 1.2 $
*/ */
public interface GlobalInterface extends Serializable { public interface GlobalInterface extends Serializable {
/**Expiration Date for this item. /**
* <br> * Expiration Date for this item. <br>
* *
* <table border="1" cellpadding="5" cellspacing="0" width="640"> * <table border="1" cellpadding="5" cellspacing="0" width="640">
* <tbody><tr valign="top"> * <tbody>
* <td colspan="2" bgcolor="#dddddd" valign="top"> <font size="-1"><b><a name="expiration_date"></a>expiration_date</b></font></td> * <tr valign="top">
* </tr> * <td colspan="2" bgcolor="#dddddd" valign="top"><font size="-1"><b><a name="expiration_date"></a>expiration_date</b></font></td>
* <tr valign="top"> * </tr>
* <td width="120"> <font size="-1"><b>Details</b></font></td> * <tr valign="top">
* * <td width="120"><font size="-1"><b>Details</b></font></td>
* <td><font size="-1"> Date that the item expires in <a href="http://www.iso.org/iso/en/prods-services/popstds/datesandtime.html">ISO 8601</a> format: *
* YYYY-MM-DD</font></td> * <td><font size="-1"> Date that the item expires in <a href="http://www.iso.org/iso/en/prods-services/popstds/datesandtime.html">ISO 8601</a> format:
* </tr> * YYYY-MM-DD</font></td>
* <tr valign="top"> * </tr>
* <td width="120"><font size="-1"><b>Example</b></font></td> * <tr valign="top">
* <td><font size="-1"> * <td width="120"><font size="-1"><b>Example</b></font></td>
* &lt;g:expiration_date&gt;2005-20-12&lt;/g:expiration_date&gt; * <td><font size="-1"> &lt;g:expiration_date&gt;2005-20-12&lt;/g:expiration_date&gt;
* *
* </font></td> * </font></td>
* </tr> * </tr>
* <tr valign="top"> * <tr valign="top">
* <td width="120"> <font size="-1"><b>Attribute of</b></font></td> * <td width="120"><font size="-1"><b>Attribute of</b></font></td>
* <td><font size="-1"> Reference Items, Events, Housing, * <td><font size="-1"> Reference Items, Events, Housing, Jobs, People profiles, Products, Services, Travel, Vehicles, Wanted Ads.</font></td>
* Jobs, People profiles, Products, Services, Travel, Vehicles, Wanted Ads.</font></td> * </tr>
* </tr> * <tr valign="top">
* <tr valign="top"> * <td width="120"><font size="-1"><b>Content type</b></font></td>
* <td width="120"> <font size="-1"><b>Content type</b></font></td> *
* * <td><font size="-1"> date</font></td>
* <td><font size="-1"> date</font></td> * </tr>
* </tr> * </tbody>
* </tbody></table> * </table>
*
* @param expirationDate the date this entry will expire * @param expirationDate the date this entry will expire
*/ */
public void setExpirationDate(Date expirationDate); public void setExpirationDate(Date expirationDate);
/** Expiration Date for this item. /**
* <br> * Expiration Date for this item. <br>
* *
* <table border="1" cellpadding="5" cellspacing="0" width="640"> * <table border="1" cellpadding="5" cellspacing="0" width="640">
* <tbody><tr valign="top"> * <tbody>
* <td colspan="2" bgcolor="#dddddd" valign="top"> <font size="-1"><b><a name="expiration_date"></a>expiration_date</b></font></td> * <tr valign="top">
* </tr> * <td colspan="2" bgcolor="#dddddd" valign="top"><font size="-1"><b><a name="expiration_date"></a>expiration_date</b></font></td>
* <tr valign="top"> * </tr>
* <td width="120"> <font size="-1"><b>Details</b></font></td> * <tr valign="top">
* * <td width="120"><font size="-1"><b>Details</b></font></td>
* <td><font size="-1"> Date that the item expires in <a href="http://www.iso.org/iso/en/prods-services/popstds/datesandtime.html">ISO 8601</a> format: *
* YYYY-MM-DD</font></td> * <td><font size="-1"> Date that the item expires in <a href="http://www.iso.org/iso/en/prods-services/popstds/datesandtime.html">ISO 8601</a> format:
* </tr> * YYYY-MM-DD</font></td>
* <tr valign="top"> * </tr>
* <td width="120"><font size="-1"><b>Example</b></font></td> * <tr valign="top">
* <td><font size="-1"> * <td width="120"><font size="-1"><b>Example</b></font></td>
* &lt;g:expiration_date&gt;2005-20-12&lt;/g:expiration_date&gt; * <td><font size="-1"> &lt;g:expiration_date&gt;2005-20-12&lt;/g:expiration_date&gt;
* *
* </font></td> * </font></td>
* </tr> * </tr>
* <tr valign="top"> * <tr valign="top">
* <td width="120"> <font size="-1"><b>Attribute of</b></font></td> * <td width="120"><font size="-1"><b>Attribute of</b></font></td>
* <td><font size="-1"> Reference Items, Events, Housing, * <td><font size="-1"> Reference Items, Events, Housing, Jobs, People profiles, Products, Services, Travel, Vehicles, Wanted Ads.</font></td>
* Jobs, People profiles, Products, Services, Travel, Vehicles, Wanted Ads.</font></td> * </tr>
* </tr> * <tr valign="top">
* <tr valign="top"> * <td width="120"><font size="-1"><b>Content type</b></font></td>
* <td width="120"> <font size="-1"><b>Content type</b></font></td> *
* * <td><font size="-1"> date</font></td>
* <td><font size="-1"> date</font></td> * </tr>
* </tr> * </tbody>
* </tbody></table> * </table>
*
* @return the date this entry will expire * @return the date this entry will expire
*/ */
public Date getExpirationDate(); public Date getExpirationDate();
/** /**
* Date and time that the item expires. * Date and time that the item expires.
* *
* <table border="1" cellpadding="5" cellspacing="0" width="640"> * <table border="1" cellpadding="5" cellspacing="0" width="640">
* <tbody><tr valign="top"> * <tbody>
* <td colspan="2" bgcolor="#dddddd" valign="top"> <font size="-1"><b><a name="expiration_date_time"></a>expiration_date_time</b></font></td> * <tr valign="top">
* * <td colspan="2" bgcolor="#dddddd" valign="top"><font size="-1"><b><a name="expiration_date_time"></a>expiration_date_time</b></font></td>
* </tr> *
* <tr valign="top"> * </tr>
* <td width="120"> <font size="-1"><b>Details</b></font></td> * <tr valign="top">
* <td><font size="-1"> Date and time that the item expires in <a href="http://www.iso.org/iso/en/prods-services/popstds/datesandtime.html">ISO 8601</a> format: * <td width="120"><font size="-1"><b>Details</b></font></td>
* YYYY-MM-DDThh:mm:ss</font></td> * <td><font size="-1"> Date and time that the item expires in <a href="http://www.iso.org/iso/en/prods-services/popstds/datesandtime.html">ISO 8601</a>
* </tr> * format: YYYY-MM-DDThh:mm:ss</font></td>
* * </tr>
* <tr valign="top"> *
* <td width="120"><font size="-1"><b>Example</b></font></td> * <tr valign="top">
* * <td width="120"><font size="-1"><b>Example</b></font></td>
* <td><font size="-1"> *
* &lt;g:expiration_date_time&gt;12-20-05T11:59:59&lt;/g:expiration_date_time&gt; * <td><font size="-1"> &lt;g:expiration_date_time&gt;12-20-05T11:59:59&lt;/g:expiration_date_time&gt; </font></td>
* </font></td> * </tr>
* </tr> * <tr valign="top">
* <tr valign="top"> * <td width="120"><font size="-1"><b>Attribute of</b></font></td>
* <td width="120"> <font size="-1"><b>Attribute of</b></font></td> *
* * <td><font size="-1"> Reference Items, Events, Housing, Jobs, People profiles, Products, Services, Travel, Vehicles, Wanted Ads.</font></td>
* <td><font size="-1"> Reference Items, Events, Housing, *
* Jobs, People profiles, Products, Services, Travel, Vehicles, Wanted Ads.</font></td> * </tr>
* * <tr valign="top">
* </tr> * <td width="120"><font size="-1"><b>Content type</b></font></td>
* <tr valign="top"> * <td><font size="-1"> dateTime</font></td>
* <td width="120"> <font size="-1"><b>Content type</b></font></td> * </tr>
* <td><font size="-1"> dateTime</font></td> *
* </tr> * </tbody>
* * </table>
* </tbody></table> *
* @param expirationDateTime Date and time that the item expires. * @param expirationDateTime Date and time that the item expires.
*/ */
public void setExpirationDateTime(Date expirationDateTime); public void setExpirationDateTime(Date expirationDateTime);
/** /**
* Date and time that the item expires. * Date and time that the item expires.
* *
* <table border="1" cellpadding="5" cellspacing="0" width="640"> * <table border="1" cellpadding="5" cellspacing="0" width="640">
* <tbody><tr valign="top"> * <tbody>
* <td colspan="2" bgcolor="#dddddd" valign="top"> <font size="-1"><b><a name="expiration_date_time"></a>expiration_date_time</b></font></td> * <tr valign="top">
* * <td colspan="2" bgcolor="#dddddd" valign="top"><font size="-1"><b><a name="expiration_date_time"></a>expiration_date_time</b></font></td>
* </tr> *
* <tr valign="top"> * </tr>
* <td width="120"> <font size="-1"><b>Details</b></font></td> * <tr valign="top">
* <td><font size="-1"> Date and time that the item expires in <a href="http://www.iso.org/iso/en/prods-services/popstds/datesandtime.html">ISO 8601</a> format: * <td width="120"><font size="-1"><b>Details</b></font></td>
* YYYY-MM-DDThh:mm:ss</font></td> * <td><font size="-1"> Date and time that the item expires in <a href="http://www.iso.org/iso/en/prods-services/popstds/datesandtime.html">ISO 8601</a>
* </tr> * format: YYYY-MM-DDThh:mm:ss</font></td>
* * </tr>
* <tr valign="top"> *
* <td width="120"><font size="-1"><b>Example</b></font></td> * <tr valign="top">
* * <td width="120"><font size="-1"><b>Example</b></font></td>
* <td><font size="-1"> *
* &lt;g:expiration_date_time&gt;12-20-05T11:59:59&lt;/g:expiration_date_time&gt; * <td><font size="-1"> &lt;g:expiration_date_time&gt;12-20-05T11:59:59&lt;/g:expiration_date_time&gt; </font></td>
* </font></td> * </tr>
* </tr> * <tr valign="top">
* <tr valign="top"> * <td width="120"><font size="-1"><b>Attribute of</b></font></td>
* <td width="120"> <font size="-1"><b>Attribute of</b></font></td> *
* * <td><font size="-1"> Reference Items, Events, Housing, Jobs, People profiles, Products, Services, Travel, Vehicles, Wanted Ads.</font></td>
* <td><font size="-1"> Reference Items, Events, Housing, *
* Jobs, People profiles, Products, Services, Travel, Vehicles, Wanted Ads.</font></td> * </tr>
* * <tr valign="top">
* </tr> * <td width="120"><font size="-1"><b>Content type</b></font></td>
* <tr valign="top"> * <td><font size="-1"> dateTime</font></td>
* <td width="120"> <font size="-1"><b>Content type</b></font></td> * </tr>
* <td><font size="-1"> dateTime</font></td> *
* </tr> * </tbody>
* * </table>
* </tbody></table> *
* @return Date and time that the item expires. * @return Date and time that the item expires.
*/ */
public Date getExpirationDateTime(); public Date getExpirationDateTime();
/** Unique id for this item. /**
* Unique id for this item.
* <table border="1" cellpadding="5" cellspacing="0" width="640"> * <table border="1" cellpadding="5" cellspacing="0" width="640">
* <tbody><tr valign="top"> * <tbody>
* <td colspan="2" bgcolor="#dddddd" valign="top"> <font size="-1"><b><a name="id"></a>id</b></font></td> * <tr valign="top">
* </tr> * <td colspan="2" bgcolor="#dddddd" valign="top"><font size="-1"><b><a name="id"></a>id</b></font></td>
* <tr valign="top"> * </tr>
* <td width="120"> <font size="-1"><b>Details</b></font></td> * <tr valign="top">
* * <td width="120"><font size="-1"><b>Details</b></font></td>
* <td><font size="-1"> Unique alphanumeric identifier for each item *
* - e.g., your internal ID code.<br> * <td><font size="-1"> Unique alphanumeric identifier for each item - e.g., your internal ID code.<br>
* IMPORTANT: Once you submit an item with a unique id, this identifier * IMPORTANT: Once you submit an item with a unique id, this identifier must not change when you send in a new bulk upload. Each item must retain the same
* must not change when you send in a new bulk upload. Each item must * id in subsequent bulk uploads.</font></td>
* retain the same id in subsequent bulk uploads.</font></td> * </tr>
* </tr> * <tr valign="top">
* <tr valign="top"> * <td width="120"><font size="-1"><b>Example</b></font></td>
* <td width="120"> <font size="-1"><b>Example</b></font></td> * <td><font size="-1">
* <td> <font size="-1"> *
* * &lt;g:id&gt;01flx&lt;/g:id&gt;</font></td>
* &lt;g:id&gt;01flx&lt;/g:id&gt;</font></td> * </tr>
* </tr> * <tr valign="top">
* <tr valign="top"> * <td width="120"><font size="-1"><b>Attribute of</b></font></td>
* <td width="120"> <font size="-1"><b>Attribute of</b></font></td> * <td><font size="-1"> Reference Items, Events, Housing, Jobs, News and Articles, People profiles, Products, Reviews, Services, Travel, Vehicles, Wanted
* <td><font size="-1"> Reference Items, Events, Housing, * Ads.</font></td>
* Jobs, News and Articles, People profiles, Products, Reviews, Services, *
* Travel, Vehicles, Wanted Ads.</font></td> * </tr>
* *
* </tr> * <tr valign="top">
* * <td width="120"><font size="-1"><b>Content type</b></font></td>
* <tr valign="top"> * <td><font size="-1"> string</font></td>
* <td width="120"> <font size="-1"><b>Content type</b></font></td> * </tr>
* <td><font size="-1"> string</font></td> * </tbody>
* </tr> * </table>
* </tbody></table> *
* @param id unique identifier for this entry * @param id unique identifier for this entry
*/ */
public void setId(String id); public void setId(String id);
/** Unique id for this item. /**
* Unique id for this item.
* <table border="1" cellpadding="5" cellspacing="0" width="640"> * <table border="1" cellpadding="5" cellspacing="0" width="640">
* <tbody><tr valign="top"> * <tbody>
* <td colspan="2" bgcolor="#dddddd" valign="top"> <font size="-1"><b><a name="id"></a>id</b></font></td> * <tr valign="top">
* </tr> * <td colspan="2" bgcolor="#dddddd" valign="top"><font size="-1"><b><a name="id"></a>id</b></font></td>
* <tr valign="top"> * </tr>
* <td width="120"> <font size="-1"><b>Details</b></font></td> * <tr valign="top">
* * <td width="120"><font size="-1"><b>Details</b></font></td>
* <td><font size="-1"> Unique alphanumeric identifier for each item *
* - e.g., your internal ID code.<br> * <td><font size="-1"> Unique alphanumeric identifier for each item - e.g., your internal ID code.<br>
* IMPORTANT: Once you submit an item with a unique id, this identifier * IMPORTANT: Once you submit an item with a unique id, this identifier must not change when you send in a new bulk upload. Each item must retain the same
* must not change when you send in a new bulk upload. Each item must * id in subsequent bulk uploads.</font></td>
* retain the same id in subsequent bulk uploads.</font></td> * </tr>
* </tr> * <tr valign="top">
* <tr valign="top"> * <td width="120"><font size="-1"><b>Example</b></font></td>
* <td width="120"> <font size="-1"><b>Example</b></font></td> * <td><font size="-1">
* <td> <font size="-1"> *
* * &lt;g:id&gt;01flx&lt;/g:id&gt;</font></td>
* &lt;g:id&gt;01flx&lt;/g:id&gt;</font></td> * </tr>
* </tr> * <tr valign="top">
* <tr valign="top"> * <td width="120"><font size="-1"><b>Attribute of</b></font></td>
* <td width="120"> <font size="-1"><b>Attribute of</b></font></td> * <td><font size="-1"> Reference Items, Events, Housing, Jobs, News and Articles, People profiles, Products, Reviews, Services, Travel, Vehicles, Wanted
* <td><font size="-1"> Reference Items, Events, Housing, * Ads.</font></td>
* Jobs, News and Articles, People profiles, Products, Reviews, Services, *
* Travel, Vehicles, Wanted Ads.</font></td> * </tr>
* *
* </tr> * <tr valign="top">
* * <td width="120"><font size="-1"><b>Content type</b></font></td>
* <tr valign="top"> * <td><font size="-1"> string</font></td>
* <td width="120"> <font size="-1"><b>Content type</b></font></td> * </tr>
* <td><font size="-1"> string</font></td> * </tbody>
* </tr> * </table>
* </tbody></table> *
* @return unique identifier for this entry * @return unique identifier for this entry
*/ */
public String getId(); public String getId();
/**Images for this item. /**
* <br> * Images for this item. <br>
* *
* <table border="1" cellpadding="5" cellspacing="0" width="640"> * <table border="1" cellpadding="5" cellspacing="0" width="640">
* <tbody><tr valign="top"> * <tbody>
* <td colspan="2" bgcolor="#dddddd" valign="top"> <font size="-1"><b><a name="image_link"></a>image_link</b></font></td> * <tr valign="top">
* * <td colspan="2" bgcolor="#dddddd" valign="top"><font size="-1"><b><a name="image_link"></a>image_link</b></font></td>
* </tr> *
* <tr valign="top"> * </tr>
* <td width="120"> <font size="-1"><b>Details</b></font></td> * <tr valign="top">
* <td><font size="-1"> URL of an associated image if available online. * <td width="120"><font size="-1"><b>Details</b></font></td>
* Use your full-sized images; do not use thumbnail images. Up to ten * <td><font size="-1"> URL of an associated image if available online. Use your full-sized images; do not use thumbnail images. Up to ten image_links, all
* image_links, all placed in between their own &lt;image_link&gt; * placed in between their own &lt;image_link&gt; and &lt;/image_link&gt; attributes, can be included with each item. If you do not have an image available,
* and &lt;/image_link&gt; attributes, can be included with each item. * do not include this attribute. Please do not include an image that says "Image not available." Relative URLs and logo images are not acceptable.</font></td>
* If you do not have an image available, do not include this attribute. *
* Please do not include an image that says "Image not available." * </tr>
* Relative URLs and logo images are not acceptable.</font></td> * <tr valign="top">
* * <td width="120"><font size="-1"><b>Example</b></font></td>
* </tr> * <td><font size="-1"> <em>Acceptable:</em><br>
* <tr valign="top"> * &lt;image_link&gt;http://example.com/images/1006.jpg&lt;/image_link&gt;<br>
* <td width="120"> <font size="-1"><b>Example</b></font></td> *
* <td><font size="-1"> <em>Acceptable:</em><br> * &lt;image_link&gt;http://example.com/i/6.jpg,http://example.com/i/9.jpg&lt;/image_link&gt;<br>
* &lt;image_link&gt;http://example.com/images/1006.jpg&lt;/image_link&gt;<br> *
* * <em>Not acceptable:</em><br>
* &lt;image_link&gt;http://example.com/i/6.jpg,http://example.com/i/9.jpg&lt;/image_link&gt;<br> * &lt;image_link&gt;/images/1006.jpg&lt;/image_link&gt;<br>
* * &lt;image_link&gt;example.com/images/1006.jpg&lt;/image_link&gt;</font></td>
* <em>Not acceptable:</em><br> *
* &lt;image_link&gt;/images/1006.jpg&lt;/image_link&gt;<br> * </tr>
* &lt;image_link&gt;example.com/images/1006.jpg&lt;/image_link&gt;</font></td> * <tr valign="top">
* * <td width="120"><font size="-1"><b>Attribute of</b></font></td>
* </tr> *
* <tr valign="top"> * <td><font size="-1"> Reference Items, Events, Housing, Jobs, News and Articles, People profiles, Products, Reviews, Services, Travel, Vehicles, Wanted
* <td width="120"> <font size="-1"><b>Attribute of</b></font></td> * Ads.</font></td>
* * </tr>
* <td><font size="-1"> Reference Items, Events, Housing, * <tr valign="top">
* Jobs, News and Articles, People profiles, Products, Reviews, Services, * <td width="120"><font size="-1"><b>Content type</b></font></td>
* Travel, Vehicles, Wanted Ads.</font></td> *
* </tr> * <td><font size="-1"> url</font></td>
* <tr valign="top"> * </tr>
* <td width="120"> <font size="-1"><b>Content type</b></font></td> *
* * </tbody>
* <td><font size="-1"> url</font></td> * </table>
* </tr> *
*
* </tbody></table>
* @param imageLinks URLs to images. Limit 10. * @param imageLinks URLs to images. Limit 10.
*/ */
public void setImageLinks(URL[] imageLinks); public void setImageLinks(URL[] imageLinks);
/**Images for this item. /**
* <br> * Images for this item. <br>
* *
* <table border="1" cellpadding="5" cellspacing="0" width="640"> * <table border="1" cellpadding="5" cellspacing="0" width="640">
* <tbody><tr valign="top"> * <tbody>
* <td colspan="2" bgcolor="#dddddd" valign="top"> <font size="-1"><b><a name="image_link"></a>image_link</b></font></td> * <tr valign="top">
* * <td colspan="2" bgcolor="#dddddd" valign="top"><font size="-1"><b><a name="image_link"></a>image_link</b></font></td>
* </tr> *
* <tr valign="top"> * </tr>
* <td width="120"> <font size="-1"><b>Details</b></font></td> * <tr valign="top">
* <td><font size="-1"> URL of an associated image if available online. * <td width="120"><font size="-1"><b>Details</b></font></td>
* Use your full-sized images; do not use thumbnail images. Up to ten * <td><font size="-1"> URL of an associated image if available online. Use your full-sized images; do not use thumbnail images. Up to ten image_links, all
* image_links, all placed in between their own &lt;image_link&gt; * placed in between their own &lt;image_link&gt; and &lt;/image_link&gt; attributes, can be included with each item. If you do not have an image available,
* and &lt;/image_link&gt; attributes, can be included with each item. * do not include this attribute. Please do not include an image that says "Image not available." Relative URLs and logo images are not acceptable.</font></td>
* If you do not have an image available, do not include this attribute. *
* Please do not include an image that says "Image not available." * </tr>
* Relative URLs and logo images are not acceptable.</font></td> * <tr valign="top">
* * <td width="120"><font size="-1"><b>Example</b></font></td>
* </tr> * <td><font size="-1"> <em>Acceptable:</em><br>
* <tr valign="top"> * &lt;image_link&gt;http://example.com/images/1006.jpg&lt;/image_link&gt;<br>
* <td width="120"> <font size="-1"><b>Example</b></font></td> *
* <td><font size="-1"> <em>Acceptable:</em><br> * &lt;image_link&gt;http://example.com/i/6.jpg,http://example.com/i/9.jpg&lt;/image_link&gt;<br>
* &lt;image_link&gt;http://example.com/images/1006.jpg&lt;/image_link&gt;<br> *
* * <em>Not acceptable:</em><br>
* &lt;image_link&gt;http://example.com/i/6.jpg,http://example.com/i/9.jpg&lt;/image_link&gt;<br> * &lt;image_link&gt;/images/1006.jpg&lt;/image_link&gt;<br>
* * &lt;image_link&gt;example.com/images/1006.jpg&lt;/image_link&gt;</font></td>
* <em>Not acceptable:</em><br> *
* &lt;image_link&gt;/images/1006.jpg&lt;/image_link&gt;<br> * </tr>
* &lt;image_link&gt;example.com/images/1006.jpg&lt;/image_link&gt;</font></td> * <tr valign="top">
* * <td width="120"><font size="-1"><b>Attribute of</b></font></td>
* </tr> *
* <tr valign="top"> * <td><font size="-1"> Reference Items, Events, Housing, Jobs, News and Articles, People profiles, Products, Reviews, Services, Travel, Vehicles, Wanted
* <td width="120"> <font size="-1"><b>Attribute of</b></font></td> * Ads.</font></td>
* * </tr>
* <td><font size="-1"> Reference Items, Events, Housing, * <tr valign="top">
* Jobs, News and Articles, People profiles, Products, Reviews, Services, * <td width="120"><font size="-1"><b>Content type</b></font></td>
* Travel, Vehicles, Wanted Ads.</font></td> *
* </tr> * <td><font size="-1"> url</font></td>
* <tr valign="top"> * </tr>
* <td width="120"> <font size="-1"><b>Content type</b></font></td> *
* * </tbody>
* <td><font size="-1"> url</font></td> * </table>
* </tr> *
*
* </tbody></table>
* @return URLs to images * @return URLs to images
*/ */
public URL[] getImageLinks(); public URL[] getImageLinks();
/**Labels for this item. /**
* <br> * Labels for this item. <br>
* *
* <table border="1" cellpadding="5" cellspacing="0" width="640"> * <table border="1" cellpadding="5" cellspacing="0" width="640">
* <tbody><tr valign="top"> * <tbody>
* * <tr valign="top">
* <td colspan="2" bgcolor="#dddddd" valign="top"> *
* <font size="-1"><b><a name="label"></a>label</b></font></td> * <td colspan="2" bgcolor="#dddddd" valign="top">
* <font size="-1"><b><a name="label"></a>label</b></font></td>
* </tr> * </tr>
* <tr valign="top"> * <tr valign="top">
* <td width="120"> * <td width="120">
* *
* <font size="-1"><b>Details</b></font></td> * <font size="-1"><b>Details</b></font></td>
* <td> * <td>
* <font size="-1">A * <font size="-1">A list of classifications the item may fall under. Up to ten user-selected label, each placed in between their own &lt;label&gt;
* list of classifications the item may fall under. Up to ten user-selected *
* label, each placed in between their own &lt;label&gt; * and &lt;/label&gt; tags, can be included with each item. These attributes will be used to match your items to search queries. Each attribute value will
* * be checked for policy compliance.</font></td>
* and &lt;/label&gt; tags, can be included with each item. These attributes will be used to match your items to search queries. Each attribute value will be checked for policy compliance.</font></td>
* </tr> * </tr>
* *
* <tr valign="top"> * <tr valign="top">
* <td width="120"> * <td width="120">
* <font size="-1"><b>Example</b></font></td> * <font size="-1"><b>Example</b></font></td>
* <td> * <td>
* *
* <font size="-1"><em>Acceptable:<br> * <font size="-1"><em>Acceptable:<br>
* For an automobile in a Vehicles information type:</em><br> * For an automobile in a Vehicles information type:</em><br>
* </font> * </font>
* *
* <font size="-1">&lt;g:label&gt;Leather&lt;/g:label&gt;<br> * <font size="-1">&lt;g:label&gt;Leather&lt;/g:label&gt;<br>
* </font> * </font> <font size="-1">&lt;g:label&gt;Power locks&lt;/g:label&gt;<br>
* <font size="-1">&lt;g:label&gt;Power locks&lt;/g:label&gt;<br> *
* * </font> <font size="-1">&lt;g:label&gt;sunroof&lt;/g:label&gt;<br>
* </font> *
* <font size="-1">&lt;g:label&gt;sunroof&lt;/g:label&gt;<br> * </font> <font size="-1">&lt;g:label&gt;ABS&lt;/g:label&gt;<br>
* * <br>
* </font> * </font> <font size="-1"><em>For a concert in an Events information type:</em></font><br>
* <font size="-1">&lt;g:label&gt;ABS&lt;/g:label&gt;<br><br> *
* </font> * <font size="-1">&lt;g:label&gt;VIP&lt;/g:label&gt;<br>
* <font size="-1"><em>For a concert in an Events information type:</em></font><br> *
* * </font> <font size="-1">&lt;g:label&gt;front row&lt;/g:label&gt;<br>
* <font size="-1">&lt;g:label&gt;VIP&lt;/g:label&gt;<br> * </font> <font size="-1">&lt;g:label&gt;backstage&lt;/g:label&gt;<br>
* *
* </font> * </font>
* <font size="-1">&lt;g:label&gt;front row&lt;/g:label&gt;<br> *
* </font> * <font size="-1">&lt;g:label&gt;KROCK 101.5&lt;/g:label&gt;<br>
* <font size="-1">&lt;g:label&gt;backstage&lt;/g:label&gt;<br> * </font> <font size="-1">&lt;g:label&gt;parking passes&lt;/g:label&gt;<br>
* * <br>
* </font> * </font> <font size="-1"><em>Not acceptable:</em><br>
* *
* <font size="-1">&lt;g:label&gt;KROCK 101.5&lt;/g:label&gt;<br> * </font> <font size="-1">&lt;g:label&gt; leater, power locks, sunroof, ABS &lt;/g:label&gt;</font></td>
* </font>
* <font size="-1">&lt;g:label&gt;parking passes&lt;/g:label&gt;<br><br>
* </font>
* <font size="-1"><em>Not acceptable:</em><br>
*
* </font>
* <font size="-1">&lt;g:label&gt; leater, power locks, sunroof, ABS &lt;/g:label&gt;</font></td>
* </tr> * </tr>
* <tr valign="top"> * <tr valign="top">
* <td width="120"> * <td width="120">
* <font size="-1"><b>Attribute of</b></font></td> * <font size="-1"><b>Attribute of</b></font></td>
* *
* <td> * <td>
* <font size="-1">Reference Items, Events, Housing, Jobs, News and Articles, * <font size="-1">Reference Items, Events, Housing, Jobs, News and Articles, People profiles, Products, Reviews, Services, Travel, Vehicles, Wanted
* People profiles, Products, Reviews, Services, Travel, Vehicles, Wanted Ads.</font></td> * Ads.</font></td>
* </tr> * </tr>
* <tr valign="top"> * <tr valign="top">
* <td width="120"> * <td width="120">
* <font size="-1"><b>Content type</b></font></td> * <font size="-1"><b>Content type</b></font></td>
* <td> * <td>
* *
* <font size="-1">string</font></td> * <font size="-1">string</font></td>
* *
* </tr> * </tr>
* </tbody></table> * </tbody>
* </table>
*
* @param labels labels for this entry. Limit 10. * @param labels labels for this entry. Limit 10.
*/ */
public void setLabels(String[] labels); public void setLabels(String[] labels);
/**Labels for this item. /**
* <br> * Labels for this item. <br>
* *
* <table border="1" cellpadding="5" cellspacing="0" width="640"> * <table border="1" cellpadding="5" cellspacing="0" width="640">
* <tbody><tr valign="top"> * <tbody>
* * <tr valign="top">
* <td colspan="2" bgcolor="#dddddd" valign="top"> *
* <font size="-1"><b><a name="label"></a>label</b></font></td> * <td colspan="2" bgcolor="#dddddd" valign="top">
* <font size="-1"><b><a name="label"></a>label</b></font></td>
* </tr> * </tr>
* <tr valign="top"> * <tr valign="top">
* <td width="120"> * <td width="120">
* *
* <font size="-1"><b>Details</b></font></td> * <font size="-1"><b>Details</b></font></td>
* <td> * <td>
* <font size="-1">A * <font size="-1">A list of classifications the item may fall under. Up to ten user-selected label, each placed in between their own &lt;label&gt;
* list of classifications the item may fall under. Up to ten user-selected *
* label, each placed in between their own &lt;label&gt; * and &lt;/label&gt; tags, can be included with each item. These attributes will be used to match your items to search queries. Each attribute value will
* * be checked for policy compliance.</font></td>
* and &lt;/label&gt; tags, can be included with each item. These attributes will be used to match your items to search queries. Each attribute value will be checked for policy compliance.</font></td>
* </tr> * </tr>
* *
* <tr valign="top"> * <tr valign="top">
* <td width="120"> * <td width="120">
* <font size="-1"><b>Example</b></font></td> * <font size="-1"><b>Example</b></font></td>
* <td> * <td>
* *
* <font size="-1"><em>Acceptable:<br> * <font size="-1"><em>Acceptable:<br>
* For an automobile in a Vehicles information type:</em><br> * For an automobile in a Vehicles information type:</em><br>
* </font> * </font>
* *
* <font size="-1">&lt;g:label&gt;Leather&lt;/g:label&gt;<br> * <font size="-1">&lt;g:label&gt;Leather&lt;/g:label&gt;<br>
* </font> * </font> <font size="-1">&lt;g:label&gt;Power locks&lt;/g:label&gt;<br>
* <font size="-1">&lt;g:label&gt;Power locks&lt;/g:label&gt;<br> *
* * </font> <font size="-1">&lt;g:label&gt;sunroof&lt;/g:label&gt;<br>
* </font> *
* <font size="-1">&lt;g:label&gt;sunroof&lt;/g:label&gt;<br> * </font> <font size="-1">&lt;g:label&gt;ABS&lt;/g:label&gt;<br>
* * <br>
* </font> * </font> <font size="-1"><em>For a concert in an Events information type:</em></font><br>
* <font size="-1">&lt;g:label&gt;ABS&lt;/g:label&gt;<br><br> *
* </font> * <font size="-1">&lt;g:label&gt;VIP&lt;/g:label&gt;<br>
* <font size="-1"><em>For a concert in an Events information type:</em></font><br> *
* * </font> <font size="-1">&lt;g:label&gt;front row&lt;/g:label&gt;<br>
* <font size="-1">&lt;g:label&gt;VIP&lt;/g:label&gt;<br> * </font> <font size="-1">&lt;g:label&gt;backstage&lt;/g:label&gt;<br>
* *
* </font> * </font>
* <font size="-1">&lt;g:label&gt;front row&lt;/g:label&gt;<br> *
* </font> * <font size="-1">&lt;g:label&gt;KROCK 101.5&lt;/g:label&gt;<br>
* <font size="-1">&lt;g:label&gt;backstage&lt;/g:label&gt;<br> * </font> <font size="-1">&lt;g:label&gt;parking passes&lt;/g:label&gt;<br>
* * <br>
* </font> * </font> <font size="-1"><em>Not acceptable:</em><br>
* *
* <font size="-1">&lt;g:label&gt;KROCK 101.5&lt;/g:label&gt;<br> * </font> <font size="-1">&lt;g:label&gt; leater, power locks, sunroof, ABS &lt;/g:label&gt;</font></td>
* </font>
* <font size="-1">&lt;g:label&gt;parking passes&lt;/g:label&gt;<br><br>
* </font>
* <font size="-1"><em>Not acceptable:</em><br>
*
* </font>
* <font size="-1">&lt;g:label&gt; leater, power locks, sunroof, ABS &lt;/g:label&gt;</font></td>
* </tr> * </tr>
* <tr valign="top"> * <tr valign="top">
* <td width="120"> * <td width="120">
* <font size="-1"><b>Attribute of</b></font></td> * <font size="-1"><b>Attribute of</b></font></td>
* *
* <td> * <td>
* <font size="-1">Reference Items, Events, Housing, Jobs, News and Articles, * <font size="-1">Reference Items, Events, Housing, Jobs, News and Articles, People profiles, Products, Reviews, Services, Travel, Vehicles, Wanted
* People profiles, Products, Reviews, Services, Travel, Vehicles, Wanted Ads.</font></td> * Ads.</font></td>
* </tr> * </tr>
* <tr valign="top"> * <tr valign="top">
* <td width="120"> * <td width="120">
* <font size="-1"><b>Content type</b></font></td> * <font size="-1"><b>Content type</b></font></td>
* <td> * <td>
* *
* <font size="-1">string</font></td> * <font size="-1">string</font></td>
* *
* </tr> * </tr>
* </tbody></table> * </tbody>
* </table>
*
* @return labels for this entry * @return labels for this entry
*/ */
public String[] getLabels(); public String[] getLabels();

View file

@ -41,22 +41,19 @@ package org.rometools.feed.module.base;
import com.sun.syndication.feed.module.Module; import com.sun.syndication.feed.module.Module;
/** /**
* This is the root interface for the Google Base module. * This is the root interface for the Google Base module.
* *
* <p> * <p>
* It supports all the individual data "types". If you want to work with, for * It supports all the individual data "types". If you want to work with, for instance, just the Article or Job datatype, you can cast it to the respective
* instance, just the Article or Job datatype, you can cast it to the * interface and see only methods related to a particular entry type.
* respective interface and see only methods related to a particular entry
* type.
* </p> * </p>
* *
* @author <a href="mailto:cooper@screaming-penguin.com">Robert "kebernet" * @author <a href="mailto:cooper@screaming-penguin.com">Robert "kebernet" Cooper</a>
* Cooper</a>
* @version $Revision: 1.1 $ * @version $Revision: 1.1 $
*/ */
public interface GoogleBase extends Module,Article,Course,Event,Job,Person,Product,Review,ScholarlyArticle,Service,Travel,Unknown,Vehicle,Wanted,Housing { public interface GoogleBase extends Module, Article, Course, Event, Job, Person, Product, Review, ScholarlyArticle, Service, Travel, Unknown, Vehicle, Wanted,
Housing {
/** This is the URI for the Google Base Schema. */ /** This is the URI for the Google Base Schema. */
public static final String URI = "http://base.google.com/ns/1.0"; public static final String URI = "http://base.google.com/ns/1.0";
} }

File diff suppressed because it is too large Load diff

File diff suppressed because it is too large Load diff

File diff suppressed because it is too large Load diff

File diff suppressed because it is too large Load diff

File diff suppressed because it is too large Load diff

View file

@ -41,11 +41,9 @@ package org.rometools.feed.module.base;
import java.util.Date; import java.util.Date;
/** /**
* This is an interface for the GoogleBase plug in that exposes methods used for * This is an interface for the GoogleBase plug in that exposes methods used for Scholarly publication, research studies and reference materials.
* Scholarly publication, research studies and reference materials. *
*
* @author <a href="mailto:cooper@screaming-penguin.com">Robert "kebernet" Cooper</a> * @author <a href="mailto:cooper@screaming-penguin.com">Robert "kebernet" Cooper</a>
* @version $Revision: 1.2 $ * @version $Revision: 1.2 $
*/ */
@ -53,39 +51,34 @@ public interface ScholarlyArticle extends GlobalInterface {
/** /**
* Array of Author Names. Limit 10. * Array of Author Names. Limit 10.
* <table border="1" cellpadding="5" cellspacing="0" width="640"> * <table border="1" cellpadding="5" cellspacing="0" width="640">
* *
* <tbody><tr valign="top"> * <tbody>
* <td colspan="2" bgcolor="#dddddd" valign="top"><font size="-1"> * <tr valign="top">
* <b><a name="author"></a>author</b></font></td> * <td colspan="2" bgcolor="#dddddd" valign="top"><font size="-1"> <b><a name="author"></a>author</b></font></td>
* </tr> * </tr>
* <tr valign="top"> * <tr valign="top">
* <td width="120"><font size="-1"> * <td width="120"><font size="-1"> <b>Details</b></font></td>
* <b>Details</b></font></td> *
* * <td><font size="-1"> Author of the item.</font></td>
* <td><font size="-1">
* Author of the item.</font></td>
* </tr> * </tr>
* <tr valign="top"> * <tr valign="top">
* <td width="120"><font size="-1"> * <td width="120"><font size="-1"> <b>Example</b></font></td>
* <b>Example</b></font></td> * <td><font size="-1"> &lt;g:author&gt;John Steinbeck&lt;/g:author&gt;</font></td>
* <td><font size="-1"> &lt;g:author&gt;John Steinbeck&lt;/g:author&gt;</font></td> *
*
* </tr> * </tr>
* <tr valign="top"> * <tr valign="top">
* <td width="120"><font size="-1"> * <td width="120"><font size="-1"> <b>Attribute of</b></font></td>
* <b>Attribute of</b></font></td> * <td><font size="-1"> Reference Items, News and Articles</font></td>
* <td><font size="-1">
* Reference Items, News and Articles</font></td>
* </tr> * </tr>
* *
* <tr valign="top"> * <tr valign="top">
* *
* <td width="120"><font size="-1"> * <td width="120"><font size="-1"> <b>Content type</b></font></td>
* <b>Content type</b></font></td> * <td><font size="-1"> string</font></td>
* <td><font size="-1">
* string</font></td>
* </tr> * </tr>
* </tbody></table> * </tbody>
* </table>
*
* @param authors Array of Author Names. Limit 10. * @param authors Array of Author Names. Limit 10.
*/ */
public void setAuthors(String[] authors); public void setAuthors(String[] authors);
@ -93,215 +86,198 @@ public interface ScholarlyArticle extends GlobalInterface {
/** /**
* Array of Author Names. Limit 10. * Array of Author Names. Limit 10.
* <table border="1" cellpadding="5" cellspacing="0" width="640"> * <table border="1" cellpadding="5" cellspacing="0" width="640">
* *
* <tbody><tr valign="top"> * <tbody>
* <td colspan="2" bgcolor="#dddddd" valign="top"><font size="-1"> * <tr valign="top">
* <b><a name="author"></a>author</b></font></td> * <td colspan="2" bgcolor="#dddddd" valign="top"><font size="-1"> <b><a name="author"></a>author</b></font></td>
* </tr> * </tr>
* <tr valign="top"> * <tr valign="top">
* <td width="120"><font size="-1"> * <td width="120"><font size="-1"> <b>Details</b></font></td>
* <b>Details</b></font></td> *
* * <td><font size="-1"> Author of the item.</font></td>
* <td><font size="-1">
* Author of the item.</font></td>
* </tr> * </tr>
* <tr valign="top"> * <tr valign="top">
* <td width="120"><font size="-1"> * <td width="120"><font size="-1"> <b>Example</b></font></td>
* <b>Example</b></font></td> * <td><font size="-1"> &lt;g:author&gt;John Steinbeck&lt;/g:author&gt;</font></td>
* <td><font size="-1"> &lt;g:author&gt;John Steinbeck&lt;/g:author&gt;</font></td> *
*
* </tr> * </tr>
* <tr valign="top"> * <tr valign="top">
* <td width="120"><font size="-1"> * <td width="120"><font size="-1"> <b>Attribute of</b></font></td>
* <b>Attribute of</b></font></td> * <td><font size="-1"> Reference Items, News and Articles</font></td>
* <td><font size="-1">
* Reference Items, News and Articles</font></td>
* </tr> * </tr>
* *
* <tr valign="top"> * <tr valign="top">
* *
* <td width="120"><font size="-1"> * <td width="120"><font size="-1"> <b>Content type</b></font></td>
* <b>Content type</b></font></td> * <td><font size="-1"> string</font></td>
* <td><font size="-1">
* string</font></td>
* </tr> * </tr>
* </tbody></table> * </tbody>
* </table>
*
* @return Array of author names. * @return Array of author names.
*/ */
public String[] getAuthors(); public String[] getAuthors();
/** /**
* Number of pages in the article. * Number of pages in the article.
* *
* <table border="1" cellpadding="5" cellspacing="0" width="640"> * <table border="1" cellpadding="5" cellspacing="0" width="640">
* *
* <tbody><tr valign="top"> * <tbody>
* <td colspan="2" bgcolor="#dddddd" valign="top"><font size="-1"> * <tr valign="top">
* <b><a name="pages"></a>pages</b></font></td> * <td colspan="2" bgcolor="#dddddd" valign="top"><font size="-1"> <b><a name="pages"></a>pages</b></font></td>
* *
* </tr> * </tr>
* <tr valign="top"> * <tr valign="top">
* <td width="120"><font size="-1"> * <td width="120"><font size="-1"> <b>Details</b></font></td>
* <b>Details</b></font></td> * <td><font size="-1">
* <td><font size="-1"> *
* * The number of pages in the publication.</font></td>
* The number of pages in the publication.</font></td>
* </tr> * </tr>
* *
* <tr valign="top"> * <tr valign="top">
* <td width="120"><font size="-1"> * <td width="120"><font size="-1"> <b>Example</b></font></td>
* <b>Example</b></font></td> * <td><font size="-1"> &lt;g:pages&gt;18&lt;/g:pages&gt;</font></td>
* <td><font size="-1"> &lt;g:pages&gt;18&lt;/g:pages&gt;</font></td> *
*
* </tr> * </tr>
* <tr valign="top"> * <tr valign="top">
* *
* <td width="120"><font size="-1"> * <td width="120"><font size="-1"> <b>Attribute of</b></font></td>
* <b>Attribute of</b></font></td> * <td><font size="-1"> Reference Items, News and Articles</font></td>
* <td><font size="-1">
* Reference Items, News and Articles</font></td>
* </tr> * </tr>
* <tr valign="top"> * <tr valign="top">
* *
* <td width="120"><font size="-1"> * <td width="120"><font size="-1">
* *
* <b>Content type</b></font></td> * <b>Content type</b></font></td>
* <td><font size="-1"> * <td><font size="-1"> integer</font></td>
* integer</font></td>
* </tr> * </tr>
* </tbody></table> * </tbody>
* </table>
*
* @param pages Number of pages in the article * @param pages Number of pages in the article
*/ */
public void setPages(Integer pages); public void setPages(Integer pages);
/** /**
* Number of pages in the article. * Number of pages in the article.
* *
* <table border="1" cellpadding="5" cellspacing="0" width="640"> * <table border="1" cellpadding="5" cellspacing="0" width="640">
* *
* <tbody><tr valign="top"> * <tbody>
* <td colspan="2" bgcolor="#dddddd" valign="top"><font size="-1"> * <tr valign="top">
* <b><a name="pages"></a>pages</b></font></td> * <td colspan="2" bgcolor="#dddddd" valign="top"><font size="-1"> <b><a name="pages"></a>pages</b></font></td>
* *
* </tr> * </tr>
* <tr valign="top"> * <tr valign="top">
* <td width="120"><font size="-1"> * <td width="120"><font size="-1"> <b>Details</b></font></td>
* <b>Details</b></font></td> * <td><font size="-1">
* <td><font size="-1"> *
* * The number of pages in the publication.</font></td>
* The number of pages in the publication.</font></td>
* </tr> * </tr>
* *
* <tr valign="top"> * <tr valign="top">
* <td width="120"><font size="-1"> * <td width="120"><font size="-1"> <b>Example</b></font></td>
* <b>Example</b></font></td> * <td><font size="-1"> &lt;g:pages&gt;18&lt;/g:pages&gt;</font></td>
* <td><font size="-1"> &lt;g:pages&gt;18&lt;/g:pages&gt;</font></td> *
*
* </tr> * </tr>
* <tr valign="top"> * <tr valign="top">
* *
* <td width="120"><font size="-1"> * <td width="120"><font size="-1"> <b>Attribute of</b></font></td>
* <b>Attribute of</b></font></td> * <td><font size="-1"> Reference Items, News and Articles</font></td>
* <td><font size="-1">
* Reference Items, News and Articles</font></td>
* </tr> * </tr>
* <tr valign="top"> * <tr valign="top">
* *
* <td width="120"><font size="-1"> * <td width="120"><font size="-1">
* *
* <b>Content type</b></font></td> * <b>Content type</b></font></td>
* <td><font size="-1"> * <td><font size="-1"> integer</font></td>
* integer</font></td>
* </tr> * </tr>
* </tbody></table> * </tbody>
* </table>
*
* @return Number of pages in the article * @return Number of pages in the article
*/ */
public Integer getPages(); public Integer getPages();
/** /**
* Name of the publication. * Name of the publication.
* *
* <table border="1" cellpadding="5" cellspacing="0" width="640"> * <table border="1" cellpadding="5" cellspacing="0" width="640">
* *
* <tbody><tr valign="top"> * <tbody>
* <td colspan="2" bgcolor="#dddddd"><font size="-1">
* <b><a name="publication_name"></a>publication_name</b></font></td>
* </tr>
*
* <tr valign="top"> * <tr valign="top">
* <td width="120"><font size="-1"> * <td colspan="2" bgcolor="#dddddd"><font size="-1"> <b><a name="publication_name"></a>publication_name</b></font></td>
* <b>Details</b></font></td> * </tr>
* <td><font size="-1"> *
* * <tr valign="top">
* Name of the publication.</font></td> * <td width="120"><font size="-1"> <b>Details</b></font></td>
* <td><font size="-1">
*
* Name of the publication.</font></td>
* </tr> * </tr>
* <tr valign="top"> * <tr valign="top">
* *
* <td width="120"><font size="-1"> * <td width="120"><font size="-1"> <b>Example</b></font></td>
* <b>Example</b></font></td> * <td><font size="-1"> &lt;g:publication_name&gt; Journal of Appropriate Technology&lt;/g:publication_name&gt;</font></td>
* <td><font size="-1"> &lt;g:publication_name&gt; Journal of Appropriate Technology&lt;/g:publication_name&gt;</font></td> *
*
* </tr> * </tr>
* <tr valign="top"> * <tr valign="top">
* *
* <td width="120"><font size="-1"> * <td width="120"><font size="-1"> <b>Attribute of</b></font></td>
* <b>Attribute of</b></font></td> * <td><font size="-1"> Research studies and publications</font></td>
* <td><font size="-1">
* Research studies and publications</font></td>
* </tr> * </tr>
* <tr valign="top"> * <tr valign="top">
* *
* <td width="120"><font size="-1"> * <td width="120"><font size="-1">
* *
* <b>Content type</b></font></td> * <b>Content type</b></font></td>
* <td><font size="-1"> * <td><font size="-1"> string</font></td>
* string</font></td>
* </tr> * </tr>
* </tbody></table> * </tbody>
* </table>
*
* @param publicationName Name of the publication. * @param publicationName Name of the publication.
*/ */
public void setPublicationName(String publicationName); public void setPublicationName(String publicationName);
/** /**
* Name of the publication. * Name of the publication.
* *
* <table border="1" cellpadding="5" cellspacing="0" width="640"> * <table border="1" cellpadding="5" cellspacing="0" width="640">
* *
* <tbody><tr valign="top"> * <tbody>
* <td colspan="2" bgcolor="#dddddd"><font size="-1">
* <b><a name="publication_name"></a>publication_name</b></font></td>
* </tr>
*
* <tr valign="top"> * <tr valign="top">
* <td width="120"><font size="-1"> * <td colspan="2" bgcolor="#dddddd"><font size="-1"> <b><a name="publication_name"></a>publication_name</b></font></td>
* <b>Details</b></font></td> * </tr>
* <td><font size="-1"> *
* * <tr valign="top">
* Name of the publication.</font></td> * <td width="120"><font size="-1"> <b>Details</b></font></td>
* <td><font size="-1">
*
* Name of the publication.</font></td>
* </tr> * </tr>
* <tr valign="top"> * <tr valign="top">
* *
* <td width="120"><font size="-1"> * <td width="120"><font size="-1"> <b>Example</b></font></td>
* <b>Example</b></font></td> * <td><font size="-1"> &lt;g:publication_name&gt; Journal of Appropriate Technology&lt;/g:publication_name&gt;</font></td>
* <td><font size="-1"> &lt;g:publication_name&gt; Journal of Appropriate Technology&lt;/g:publication_name&gt;</font></td> *
*
* </tr> * </tr>
* <tr valign="top"> * <tr valign="top">
* *
* <td width="120"><font size="-1"> * <td width="120"><font size="-1"> <b>Attribute of</b></font></td>
* <b>Attribute of</b></font></td> * <td><font size="-1"> Research studies and publications</font></td>
* <td><font size="-1">
* Research studies and publications</font></td>
* </tr> * </tr>
* <tr valign="top"> * <tr valign="top">
* *
* <td width="120"><font size="-1"> * <td width="120"><font size="-1">
* *
* <b>Content type</b></font></td> * <b>Content type</b></font></td>
* <td><font size="-1"> * <td><font size="-1"> string</font></td>
* string</font></td>
* </tr> * </tr>
* </tbody></table> * </tbody>
* </table>
*
* @return Name of the publication. * @return Name of the publication.
*/ */
public String getPublicationName(); public String getPublicationName();
@ -309,41 +285,37 @@ public interface ScholarlyArticle extends GlobalInterface {
/** /**
* Volume of the publication. * Volume of the publication.
* <table border="1" cellpadding="5" cellspacing="0" width="640"> * <table border="1" cellpadding="5" cellspacing="0" width="640">
* <tbody><tr valign="top"> * <tbody>
* * <tr valign="top">
* <td colspan="2" bgcolor="#dddddd"><font size="-1"> *
* <b><a name="publication_volume"></a>publication_volume</b></font></td> * <td colspan="2" bgcolor="#dddddd"><font size="-1"> <b><a name="publication_volume"></a>publication_volume</b></font></td>
* </tr> * </tr>
* <tr valign="top"> * <tr valign="top">
* <td width="120"><font size="-1"> * <td width="120"><font size="-1"> <b>Details</b></font></td>
* <b>Details</b></font></td> * <td><font size="-1">
* <td><font size="-1"> *
* * Volume of the publication.</font></td>
* Volume of the publication.</font></td> *
*
* </tr> * </tr>
* <tr valign="top"> * <tr valign="top">
* <td width="120"><font size="-1"> * <td width="120"><font size="-1"> <b>Example</b></font></td>
* <b>Example</b></font></td> * <td><font size="-1">&lt;g:publication_volume&gt;VI&lt;/g:publication_volume&gt;</font></td>
* <td><font size="-1">&lt;g:publication_volume&gt;VI&lt;/g:publication_volume&gt;</font></td> *
*
* </tr> * </tr>
* <tr valign="top"> * <tr valign="top">
* *
* <td width="120"><font size="-1"> * <td width="120"><font size="-1"> <b>Attribute of</b></font></td>
* <b>Attribute of</b></font></td> * <td><font size="-1"> Reference Items</font></td>
* <td><font size="-1">
* Reference Items</font></td>
* </tr> * </tr>
* *
* <tr valign="top"> * <tr valign="top">
* <td width="120"><font size="-1"> * <td width="120"><font size="-1"> <b>Content type</b></font></td>
* <b>Content type</b></font></td> *
* * <td><font size="-1"> string</font></td>
* <td><font size="-1">
* string</font></td>
* </tr> * </tr>
* </tbody></table> * </tbody>
* </table>
*
* @param publicationVolume Volume of the publication. * @param publicationVolume Volume of the publication.
*/ */
public void setPublicationVolume(String publicationVolume); public void setPublicationVolume(String publicationVolume);
@ -351,131 +323,125 @@ public interface ScholarlyArticle extends GlobalInterface {
/** /**
* Volume of the publication. * Volume of the publication.
* <table border="1" cellpadding="5" cellspacing="0" width="640"> * <table border="1" cellpadding="5" cellspacing="0" width="640">
* <tbody><tr valign="top"> * <tbody>
* * <tr valign="top">
* <td colspan="2" bgcolor="#dddddd"><font size="-1"> *
* <b><a name="publication_volume"></a>publication_volume</b></font></td> * <td colspan="2" bgcolor="#dddddd"><font size="-1"> <b><a name="publication_volume"></a>publication_volume</b></font></td>
* </tr> * </tr>
* <tr valign="top"> * <tr valign="top">
* <td width="120"><font size="-1"> * <td width="120"><font size="-1"> <b>Details</b></font></td>
* <b>Details</b></font></td> * <td><font size="-1">
* <td><font size="-1"> *
* * Volume of the publication.</font></td>
* Volume of the publication.</font></td> *
*
* </tr> * </tr>
* <tr valign="top"> * <tr valign="top">
* <td width="120"><font size="-1"> * <td width="120"><font size="-1"> <b>Example</b></font></td>
* <b>Example</b></font></td> * <td><font size="-1">&lt;g:publication_volume&gt;VI&lt;/g:publication_volume&gt;</font></td>
* <td><font size="-1">&lt;g:publication_volume&gt;VI&lt;/g:publication_volume&gt;</font></td> *
*
* </tr> * </tr>
* <tr valign="top"> * <tr valign="top">
* *
* <td width="120"><font size="-1"> * <td width="120"><font size="-1"> <b>Attribute of</b></font></td>
* <b>Attribute of</b></font></td> * <td><font size="-1"> Reference Items</font></td>
* <td><font size="-1">
* Reference Items</font></td>
* </tr> * </tr>
* *
* <tr valign="top"> * <tr valign="top">
* <td width="120"><font size="-1"> * <td width="120"><font size="-1"> <b>Content type</b></font></td>
* <b>Content type</b></font></td> *
* * <td><font size="-1"> string</font></td>
* <td><font size="-1">
* string</font></td>
* </tr> * </tr>
* </tbody></table> * </tbody>
* </table>
*
* @return Volume of the publication. * @return Volume of the publication.
*/ */
public String getPublicationVolume(); public String getPublicationVolume();
/** /**
* Date article was published. * Date article was published.
* *
* <table border="1" cellpadding="5" cellspacing="0" width="640"> * <table border="1" cellpadding="5" cellspacing="0" width="640">
* <tbody><tr valign="top"> * <tbody>
* <td colspan="2" bgcolor="#dddddd"><font size="-1"> * <tr valign="top">
* <b><a name="publish_date"></a>publish_date</b></font></td> * <td colspan="2" bgcolor="#dddddd"><font size="-1"> <b><a name="publish_date"></a>publish_date</b></font></td>
* *
* </tr> * </tr>
* <tr valign="top"> * <tr valign="top">
* <td width="120"><font size="-1"> * <td width="120"><font size="-1">
* *
* <b>Details</b></font></td> * <b>Details</b></font></td>
* <td><font size="-1"> * <td><font size="-1"> Date the item was published in <a href="http://www.iso.org/iso/en/prods-services/popstds/datesandtime.html">ISO 8601</a> format:
* Date the item was published in <a href="http://www.iso.org/iso/en/prods-services/popstds/datesandtime.html">ISO 8601</a> format: * YYYY-MM-DD</font></td>
* YYYY-MM-DD</font></td> *
*
* </tr> * </tr>
* <tr valign="top"> * <tr valign="top">
* <td width="120"><font size="-1"> * <td width="120"><font size="-1">
* *
* <b>Example</b></font></td> * <b>Example</b></font></td>
* <td><font size="-1"> &lt;g:publish_date&gt;2005-12-20&lt;/g:publish_date&gt;</font></td> * <td><font size="-1"> &lt;g:publish_date&gt;2005-12-20&lt;/g:publish_date&gt;</font></td>
* </tr> * </tr>
* *
* <tr valign="top"> * <tr valign="top">
* <td width="120"><font size="-1"> * <td width="120"><font size="-1"> <b>Attribute of</b></font></td>
* <b>Attribute of</b></font></td> *
* * <td><font size="-1"> Reference Items</font></td>
* <td><font size="-1">
* Reference Items</font></td>
* </tr> * </tr>
* <tr valign="top"> * <tr valign="top">
* <td width="120"><font size="-1"> * <td width="120"><font size="-1">
* *
* <b>Content type</b></font></td> * <b>Content type</b></font></td>
* <td><font size="-1"> * <td><font size="-1">
* *
* date</font></td> * date</font></td>
* </tr> * </tr>
* </tbody></table> * </tbody>
* </table>
*
* @param publishDate Date article was published * @param publishDate Date article was published
*/ */
public void setPublishDate(Date publishDate); public void setPublishDate(Date publishDate);
/** /**
* Date article was published. * Date article was published.
* *
* <table border="1" cellpadding="5" cellspacing="0" width="640"> * <table border="1" cellpadding="5" cellspacing="0" width="640">
* <tbody><tr valign="top"> * <tbody>
* <td colspan="2" bgcolor="#dddddd"><font size="-1"> * <tr valign="top">
* <b><a name="publish_date"></a>publish_date</b></font></td> * <td colspan="2" bgcolor="#dddddd"><font size="-1"> <b><a name="publish_date"></a>publish_date</b></font></td>
* *
* </tr> * </tr>
* <tr valign="top"> * <tr valign="top">
* <td width="120"><font size="-1"> * <td width="120"><font size="-1">
* *
* <b>Details</b></font></td> * <b>Details</b></font></td>
* <td><font size="-1"> * <td><font size="-1"> Date the item was published in <a href="http://www.iso.org/iso/en/prods-services/popstds/datesandtime.html">ISO 8601</a> format:
* Date the item was published in <a href="http://www.iso.org/iso/en/prods-services/popstds/datesandtime.html">ISO 8601</a> format: * YYYY-MM-DD</font></td>
* YYYY-MM-DD</font></td> *
*
* </tr> * </tr>
* <tr valign="top"> * <tr valign="top">
* <td width="120"><font size="-1"> * <td width="120"><font size="-1">
* *
* <b>Example</b></font></td> * <b>Example</b></font></td>
* <td><font size="-1"> &lt;g:publish_date&gt;2005-12-20&lt;/g:publish_date&gt;</font></td> * <td><font size="-1"> &lt;g:publish_date&gt;2005-12-20&lt;/g:publish_date&gt;</font></td>
* </tr> * </tr>
* *
* <tr valign="top"> * <tr valign="top">
* <td width="120"><font size="-1"> * <td width="120"><font size="-1"> <b>Attribute of</b></font></td>
* <b>Attribute of</b></font></td> *
* * <td><font size="-1"> Reference Items</font></td>
* <td><font size="-1">
* Reference Items</font></td>
* </tr> * </tr>
* <tr valign="top"> * <tr valign="top">
* <td width="120"><font size="-1"> * <td width="120"><font size="-1">
* *
* <b>Content type</b></font></td> * <b>Content type</b></font></td>
* <td><font size="-1"> * <td><font size="-1">
* *
* date</font></td> * date</font></td>
* </tr> * </tr>
* </tbody></table> * </tbody>
* </table>
*
* @return Date article was published * @return Date article was published
*/ */
public Date getPublishDate(); public Date getPublishDate();

File diff suppressed because it is too large Load diff

File diff suppressed because it is too large Load diff

View file

@ -43,13 +43,10 @@ import java.net.URL;
import org.rometools.feed.module.base.types.IntUnit; import org.rometools.feed.module.base.types.IntUnit;
/** /**
* This interface contains all the other schema elements that the document * This interface contains all the other schema elements that the document doesn't associate with a particular type.
* doesn't associate with a particular type. *
* * @author <a href="mailto:cooper@screaming-penguin.com">Robert "kebernet" Cooper</a>
* @author <a href="mailto:cooper@screaming-penguin.com">Robert "kebernet"
* Cooper</a>
*/ */
public interface Unknown extends GlobalInterface { public interface Unknown extends GlobalInterface {
public void setLicenses(String[] licenses); public void setLicenses(String[] licenses);

View file

@ -20,16 +20,17 @@
package org.rometools.feed.module.base; package org.rometools.feed.module.base;
/** This is an unchecked exception that is thrown when a data value violates /**
* the Google Schema limits. * This is an unchecked exception that is thrown when a data value violates the Google Schema limits.
*
* @version $Revision: 1.1 $ * @version $Revision: 1.1 $
* @author <a href="mailto:cooper@screaming-penguin.com">Robert "kebernet" Cooper</a> * @author <a href="mailto:cooper@screaming-penguin.com">Robert "kebernet" Cooper</a>
*/ */
public class ValidationException extends RuntimeException{ public class ValidationException extends RuntimeException {
/** Creates a new instance of ValidationException */ /** Creates a new instance of ValidationException */
public ValidationException(String message) { public ValidationException(final String message) {
super( message ); super(message);
} }
} }

File diff suppressed because it is too large Load diff

View file

@ -41,214 +41,205 @@ package org.rometools.feed.module.base;
import org.rometools.feed.module.base.types.FloatUnit; import org.rometools.feed.module.base.types.FloatUnit;
/**
/**This is an interface for the GoogleBase plug in that exposes methods used for * This is an interface for the GoogleBase plug in that exposes methods used for wanted ads.
* wanted ads. *
*
* @author <a href="mailto:cooper@screaming-penguin.com">Robert "kebernet" Cooper</a> * @author <a href="mailto:cooper@screaming-penguin.com">Robert "kebernet" Cooper</a>
* @version $Revision: 1.1 $ * @version $Revision: 1.1 $
*/ */
public interface Wanted extends GlobalInterface { public interface Wanted extends GlobalInterface {
/** /**
* Additional instructions to explain the items delivery process. * Additional instructions to explain the items delivery process.
* *
* <table border="1" cellpadding="5" cellspacing="0" width="640"> * <table border="1" cellpadding="5" cellspacing="0" width="640">
* <tbody><tr valign="top"> * <tbody>
* <td colspan="2" bgcolor="#dddddd" valign="top"> <font size="-1"><b><a name="delivery_notes"></a>delivery_notes</b></font></td> * <tr valign="top">
* </tr> * <td colspan="2" bgcolor="#dddddd" valign="top"><font size="-1"><b><a name="delivery_notes"></a>delivery_notes</b></font></td>
* <tr valign="top"> * </tr>
* <td width="120"> <font size="-1"><b>Details</b></font></td> * <tr valign="top">
* * <td width="120"><font size="-1"><b>Details</b></font></td>
* <td> <font size="-1">Additional instructions to explain the items delivery process.</font></td> *
* </tr> * <td><font size="-1">Additional instructions to explain the items delivery process.</font></td>
* <tr valign="top"> * </tr>
* <td width="120"><font size="-1"><b>Example</b></font></td> * <tr valign="top">
* <td> * <td width="120"><font size="-1"><b>Example</b></font></td>
* <font size="-1">&lt;g:delivery_notes&gt;Items usually shipped within 24 hours.&lt;g:/delivery_notes&gt;<br> * <td>
* * <font size="-1">&lt;g:delivery_notes&gt;Items usually shipped within 24 hours.&lt;g:/delivery_notes&gt;<br>
* </font></td> *
* * </font></td>
* </tr> *
* <tr valign="top"> * </tr>
* <td width="120"> <font size="-1"><b>Attribute * <tr valign="top">
* of</b></font></td> * <td width="120"><font size="-1"><b>Attribute of</b></font></td>
* <td> * <td>
* <font size="-1">Events, Products, Reviews, Services, Travel, Vehicles, Wanted * <font size="-1">Events, Products, Reviews, Services, Travel, Vehicles, Wanted Ads. </font></td>
* Ads. </font></td> * </tr>
* </tr> * <tr valign="top">
* <tr valign="top"> * <td width="120"><font size="-1"><b>Content type</b></font></td>
* <td width="120"> <font size="-1"><b>Content *
* type</b></font></td> * <td><font size="-1">string</font></td>
* * </tr>
* <td> <font size="-1">string</font></td> * </tbody>
* </tr> * </table>
* </tbody></table> *
* @param deliveryNotes Additional instructions to explain the items delivery process. * @param deliveryNotes Additional instructions to explain the items delivery process.
*/ */
public void setDeliveryNotes(String deliveryNotes); public void setDeliveryNotes(String deliveryNotes);
/** /**
* Additional instructions to explain the items delivery process. * Additional instructions to explain the items delivery process.
* *
* <table border="1" cellpadding="5" cellspacing="0" width="640"> * <table border="1" cellpadding="5" cellspacing="0" width="640">
* <tbody><tr valign="top"> * <tbody>
* <td colspan="2" bgcolor="#dddddd" valign="top"> <font size="-1"><b><a name="delivery_notes"></a>delivery_notes</b></font></td> * <tr valign="top">
* </tr> * <td colspan="2" bgcolor="#dddddd" valign="top"><font size="-1"><b><a name="delivery_notes"></a>delivery_notes</b></font></td>
* <tr valign="top"> * </tr>
* <td width="120"> <font size="-1"><b>Details</b></font></td> * <tr valign="top">
* * <td width="120"><font size="-1"><b>Details</b></font></td>
* <td> <font size="-1">Additional instructions to explain the items delivery process.</font></td> *
* </tr> * <td><font size="-1">Additional instructions to explain the items delivery process.</font></td>
* <tr valign="top"> * </tr>
* <td width="120"><font size="-1"><b>Example</b></font></td> * <tr valign="top">
* <td> * <td width="120"><font size="-1"><b>Example</b></font></td>
* <font size="-1">&lt;g:delivery_notes&gt;Items usually shipped within 24 hours.&lt;g:/delivery_notes&gt;<br> * <td>
* * <font size="-1">&lt;g:delivery_notes&gt;Items usually shipped within 24 hours.&lt;g:/delivery_notes&gt;<br>
* </font></td> *
* * </font></td>
* </tr> *
* <tr valign="top"> * </tr>
* <td width="120"> <font size="-1"><b>Attribute * <tr valign="top">
* of</b></font></td> * <td width="120"><font size="-1"><b>Attribute of</b></font></td>
* <td> * <td>
* <font size="-1">Events, Products, Reviews, Services, Travel, Vehicles, Wanted * <font size="-1">Events, Products, Reviews, Services, Travel, Vehicles, Wanted Ads. </font></td>
* Ads. </font></td> * </tr>
* </tr> * <tr valign="top">
* <tr valign="top"> * <td width="120"><font size="-1"><b>Content type</b></font></td>
* <td width="120"> <font size="-1"><b>Content *
* type</b></font></td> * <td><font size="-1">string</font></td>
* * </tr>
* <td> <font size="-1">string</font></td> * </tbody>
* </tr> * </table>
* </tbody></table> *
* @return Additional instructions to explain the items delivery process. * @return Additional instructions to explain the items delivery process.
*/ */
public String getDeliveryNotes(); public String getDeliveryNotes();
/** /**
* The maximum distance you will deliver an item in any direction. * The maximum distance you will deliver an item in any direction.
* <table border="1" cellpadding="5" cellspacing="0" width="640"> * <table border="1" cellpadding="5" cellspacing="0" width="640">
* <tbody><tr valign="top"> * <tbody>
* <td colspan="2" bgcolor="#dddddd" valign="top"> <font size="-1"><b><a name="delivery_radius"></a>delivery_radius</b></font></td> * <tr valign="top">
* * <td colspan="2" bgcolor="#dddddd" valign="top"><font size="-1"><b><a name="delivery_radius"></a>delivery_radius</b></font></td>
* </tr> *
* <tr valign="top"> * </tr>
* <td width="120"> <font size="-1"><b>Details</b></font></td> * <tr valign="top">
* <td> <font size="-1">The maximum * <td width="120"><font size="-1"><b>Details</b></font></td>
* distance you will deliver an item in any direction. </font></td> * <td><font size="-1">The maximum distance you will deliver an item in any direction. </font></td>
* </tr> * </tr>
* <tr valign="top"> * <tr valign="top">
* <td width="120"><font size="-1"><b>Example</b></font></td> * <td width="120"><font size="-1"><b>Example</b></font></td>
* *
* <td> * <td>
* <font size="-1">&lt;g:delivery_radius&gt;10&lt;g:/delivery_radius&gt; * <font size="-1">&lt;g:delivery_radius&gt;10&lt;g:/delivery_radius&gt; </font> <br>
* </font> * <font size="-1">&lt;g:delivery_radius&gt;10km&lt;/g:delivery_radius&gt;</font></td>
* <br><font size="-1">&lt;g:delivery_radius&gt;10km&lt;/g:delivery_radius&gt;</font></td> * </tr>
* </tr> * <tr valign="top">
* <tr valign="top"> * <td width="120"><font size="-1"><b>Attribute of</b></font></td>
* <td width="120"> <font size="-1"><b>Attribute *
* of</b></font></td> * <td>
* * <font size="-1">Events, Products, Reviews, Services, Travel, Vehicles, Wanted Ads. </font></td>
* <td> * </tr>
* <font size="-1">Events, Products, Reviews, Services, Travel, Vehicles, Wanted * <tr valign="top">
* Ads. </font></td> * <td width="120"><font size="-1"><b>Content type</b></font></td>
* </tr> * <td><font size="-1">floatUnit</font></td>
* <tr valign="top"> * </tr>
* <td width="120"> <font size="-1"><b>Content *
* type</b></font></td> * </tbody>
* <td> <font size="-1">floatUnit</font></td> * </table>
* </tr> *
*
* </tbody></table>
* @param deliveryRadius The maximum distance you will deliver an item in any direction. * @param deliveryRadius The maximum distance you will deliver an item in any direction.
*/ */
public void setDeliveryRadius(FloatUnit deliveryRadius); public void setDeliveryRadius(FloatUnit deliveryRadius);
/** /**
* The maximum distance you will deliver an item in any direction. * The maximum distance you will deliver an item in any direction.
* <table border="1" cellpadding="5" cellspacing="0" width="640"> * <table border="1" cellpadding="5" cellspacing="0" width="640">
* <tbody><tr valign="top"> * <tbody>
* <td colspan="2" bgcolor="#dddddd" valign="top"> <font size="-1"><b><a name="delivery_radius"></a>delivery_radius</b></font></td> * <tr valign="top">
* * <td colspan="2" bgcolor="#dddddd" valign="top"><font size="-1"><b><a name="delivery_radius"></a>delivery_radius</b></font></td>
* </tr> *
* <tr valign="top"> * </tr>
* <td width="120"> <font size="-1"><b>Details</b></font></td> * <tr valign="top">
* <td> <font size="-1">The maximum * <td width="120"><font size="-1"><b>Details</b></font></td>
* distance you will deliver an item in any direction. </font></td> * <td><font size="-1">The maximum distance you will deliver an item in any direction. </font></td>
* </tr> * </tr>
* <tr valign="top"> * <tr valign="top">
* <td width="120"><font size="-1"><b>Example</b></font></td> * <td width="120"><font size="-1"><b>Example</b></font></td>
* *
* <td> * <td>
* <font size="-1">&lt;g:delivery_radius&gt;10&lt;g:/delivery_radius&gt; * <font size="-1">&lt;g:delivery_radius&gt;10&lt;g:/delivery_radius&gt; </font> <br>
* </font> * <font size="-1">&lt;g:delivery_radius&gt;10km&lt;/g:delivery_radius&gt;</font></td>
* <br><font size="-1">&lt;g:delivery_radius&gt;10km&lt;/g:delivery_radius&gt;</font></td> * </tr>
* </tr> * <tr valign="top">
* <tr valign="top"> * <td width="120"><font size="-1"><b>Attribute of</b></font></td>
* <td width="120"> <font size="-1"><b>Attribute *
* of</b></font></td> * <td>
* * <font size="-1">Events, Products, Reviews, Services, Travel, Vehicles, Wanted Ads. </font></td>
* <td> * </tr>
* <font size="-1">Events, Products, Reviews, Services, Travel, Vehicles, Wanted * <tr valign="top">
* Ads. </font></td> * <td width="120"><font size="-1"><b>Content type</b></font></td>
* </tr> * <td><font size="-1">floatUnit</font></td>
* <tr valign="top"> * </tr>
* <td width="120"> <font size="-1"><b>Content *
* type</b></font></td> * </tbody>
* <td> <font size="-1">floatUnit</font></td> * </table>
* </tr> *
*
* </tbody></table>
* @return The maximum distance you will deliver an item in any direction. * @return The maximum distance you will deliver an item in any direction.
*/ */
public FloatUnit getDeliveryRadius(); public FloatUnit getDeliveryRadius();
/** /**
* Location of the property. * Location of the property.
* <table border="1" cellpadding="5" cellspacing="0" width="640"> * <table border="1" cellpadding="5" cellspacing="0" width="640">
* <tbody><tr valign="top"> * <tbody>
* * <tr valign="top">
* <td colspan="2" bgcolor="#dddddd" valign="top"><font size="-1"> *
* <b><a name="location"></a>location</b></font></td> * <td colspan="2" bgcolor="#dddddd" valign="top"><font size="-1"> <b><a name="location"></a>location</b></font></td>
* </tr> * </tr>
* <tr valign="top"> * <tr valign="top">
* *
* <td width="120"><font size="-1"> * <td width="120"><font size="-1"> <b>Details</b></font></td>
* <b>Details</b></font></td> * <td><font size="-1"> Location of a property. Should include street, city, state, postal code, and country, in that order. </font></td>
* <td><font size="-1"> Location of a property. Should *
* include street, city, state, postal code, and country, in that order. </font></td>
*
* </tr> * </tr>
* <tr valign="top"> * <tr valign="top">
* <td width="120"><font size="-1"> * <td width="120"><font size="-1"> <b>Example</b></font></td>
* <b>Example</b></font></td> *
* * <td><font size="-1"> <em>Acceptable:</em><br>
* <td><font size="-1"> * &lt;g:location&gt;<st1:place>123 Main St, <st1:city>Anytown</st1:city>, <st1:state>CA</st1:state>, <st1:postalcode>12345</st1:postalcode>,
* <em>Acceptable:</em><br> * <st1:country-region>USA</st1:country-region></st1:place>&lt;/g:location&gt;<br>
* &lt;g:location&gt;<st1:place>123 Main St, <st1:city>Anytown</st1:city>, <st1:state>CA</st1:state>, <st1:postalcode>12345</st1:postalcode>, <st1:country-region>USA</st1:country-region></st1:place>&lt;/g:location&gt;<br> *
*
* <em>Not acceptable:</em><br> * <em>Not acceptable:</em><br>
* &lt;g:location&gt;<st1:place><st1:city>123</st1:city> Main St,, <st1:state>CA</st1:state>, <st1:postalcode>12345</st1:postalcode>, <st1:country-region>USA</st1:country-region></st1:place>&lt;/g:location&gt;<br> * &lt;g:location&gt;<st1:place><st1:city>123</st1:city> Main St,, <st1:state>CA</st1:state>, <st1:postalcode>12345</st1:postalcode>,
* &lt;g:location&gt; * <st1:country-region>USA</st1:country-region></st1:place>&lt;/g:location&gt;<br>
* <st1:place><st1:city>Anytown</st1:city>, <st1:state>CA</st1:state>, <st1:postalcode>12345</st1:postalcode>, <st1:country-region>USA</st1:country-region></st1:place>&lt;/g:location&gt;</font></td> * &lt;g:location&gt; <st1:place><st1:city>Anytown</st1:city>, <st1:state>CA</st1:state>, <st1:postalcode>12345</st1:postalcode>,
* * <st1:country-region>USA</st1:country-region></st1:place>&lt;/g:location&gt;</font></td>
*
* </tr> * </tr>
* <tr valign="top"> * <tr valign="top">
* <td width="120"><font size="-1"> * <td width="120"><font size="-1"> <b>Attribute of</b></font></td>
* <b>Attribute of</b></font></td> * <td><font size="-1"> Reference Items, Events, Housing, Jobs, News and Articles, People profiles, Products, Reviews, Services, Travel, Vehicles, Wanted
* <td><font size="-1"> * Ads.</font></td>
* Reference Items, Events, Housing, Jobs, News and Articles,
* People profiles, Products, Reviews, Services, Travel, Vehicles, Wanted Ads.</font></td>
* </tr> * </tr>
* *
* <tr valign="top"> * <tr valign="top">
* *
* <td width="120"><font size="-1"> * <td width="120"><font size="-1"> <b>Content type</b></font></td>
* <b>Content type</b></font></td> * <td><font size="-1"> locationType</font></td>
* <td><font size="-1">
* locationType</font></td>
* </tr> * </tr>
* </tbody></table> * </tbody>
* </table>
*
* @param location Location of the property. * @param location Location of the property.
*/ */
public void setLocation(String location); public void setLocation(String location);
@ -256,49 +247,45 @@ public interface Wanted extends GlobalInterface {
/** /**
* Location of the property. * Location of the property.
* <table border="1" cellpadding="5" cellspacing="0" width="640"> * <table border="1" cellpadding="5" cellspacing="0" width="640">
* <tbody><tr valign="top"> * <tbody>
* * <tr valign="top">
* <td colspan="2" bgcolor="#dddddd" valign="top"><font size="-1"> *
* <b><a name="location"></a>location</b></font></td> * <td colspan="2" bgcolor="#dddddd" valign="top"><font size="-1"> <b><a name="location"></a>location</b></font></td>
* </tr> * </tr>
* <tr valign="top"> * <tr valign="top">
* *
* <td width="120"><font size="-1"> * <td width="120"><font size="-1"> <b>Details</b></font></td>
* <b>Details</b></font></td> * <td><font size="-1"> Location of a property. Should include street, city, state, postal code, and country, in that order. </font></td>
* <td><font size="-1"> Location of a property. Should *
* include street, city, state, postal code, and country, in that order. </font></td>
*
* </tr> * </tr>
* <tr valign="top"> * <tr valign="top">
* <td width="120"><font size="-1"> * <td width="120"><font size="-1"> <b>Example</b></font></td>
* <b>Example</b></font></td> *
* * <td><font size="-1"> <em>Acceptable:</em><br>
* <td><font size="-1"> * &lt;g:location&gt;<st1:place>123 Main St, <st1:city>Anytown</st1:city>, <st1:state>CA</st1:state>, <st1:postalcode>12345</st1:postalcode>,
* <em>Acceptable:</em><br> * <st1:country-region>USA</st1:country-region></st1:place>&lt;/g:location&gt;<br>
* &lt;g:location&gt;<st1:place>123 Main St, <st1:city>Anytown</st1:city>, <st1:state>CA</st1:state>, <st1:postalcode>12345</st1:postalcode>, <st1:country-region>USA</st1:country-region></st1:place>&lt;/g:location&gt;<br> *
*
* <em>Not acceptable:</em><br> * <em>Not acceptable:</em><br>
* &lt;g:location&gt;<st1:place><st1:city>123</st1:city> Main St,, <st1:state>CA</st1:state>, <st1:postalcode>12345</st1:postalcode>, <st1:country-region>USA</st1:country-region></st1:place>&lt;/g:location&gt;<br> * &lt;g:location&gt;<st1:place><st1:city>123</st1:city> Main St,, <st1:state>CA</st1:state>, <st1:postalcode>12345</st1:postalcode>,
* &lt;g:location&gt; * <st1:country-region>USA</st1:country-region></st1:place>&lt;/g:location&gt;<br>
* <st1:place><st1:city>Anytown</st1:city>, <st1:state>CA</st1:state>, <st1:postalcode>12345</st1:postalcode>, <st1:country-region>USA</st1:country-region></st1:place>&lt;/g:location&gt;</font></td> * &lt;g:location&gt; <st1:place><st1:city>Anytown</st1:city>, <st1:state>CA</st1:state>, <st1:postalcode>12345</st1:postalcode>,
* * <st1:country-region>USA</st1:country-region></st1:place>&lt;/g:location&gt;</font></td>
*
* </tr> * </tr>
* <tr valign="top"> * <tr valign="top">
* <td width="120"><font size="-1"> * <td width="120"><font size="-1"> <b>Attribute of</b></font></td>
* <b>Attribute of</b></font></td> * <td><font size="-1"> Reference Items, Events, Housing, Jobs, News and Articles, People profiles, Products, Reviews, Services, Travel, Vehicles, Wanted
* <td><font size="-1"> * Ads.</font></td>
* Reference Items, Events, Housing, Jobs, News and Articles,
* People profiles, Products, Reviews, Services, Travel, Vehicles, Wanted Ads.</font></td>
* </tr> * </tr>
* *
* <tr valign="top"> * <tr valign="top">
* *
* <td width="120"><font size="-1"> * <td width="120"><font size="-1"> <b>Content type</b></font></td>
* <b>Content type</b></font></td> * <td><font size="-1"> locationType</font></td>
* <td><font size="-1">
* locationType</font></td>
* </tr> * </tr>
* </tbody></table> * </tbody>
* </table>
*
* @return Location of the property. * @return Location of the property.
*/ */
public String getLocation(); public String getLocation();

View file

@ -19,7 +19,13 @@
*/ */
package org.rometools.feed.module.base.io; package org.rometools.feed.module.base.io;
import com.sun.syndication.feed.module.Module; import java.net.URL;
import java.util.Date;
import java.util.HashSet;
import java.util.Iterator;
import java.util.List;
import org.jdom2.Element;
import org.rometools.feed.module.base.CustomTag; import org.rometools.feed.module.base.CustomTag;
import org.rometools.feed.module.base.CustomTagImpl; import org.rometools.feed.module.base.CustomTagImpl;
import org.rometools.feed.module.base.CustomTags; import org.rometools.feed.module.base.CustomTags;
@ -27,18 +33,10 @@ import org.rometools.feed.module.base.types.DateTimeRange;
import org.rometools.feed.module.base.types.FloatUnit; import org.rometools.feed.module.base.types.FloatUnit;
import org.rometools.feed.module.base.types.IntUnit; import org.rometools.feed.module.base.types.IntUnit;
import org.rometools.feed.module.base.types.ShortDate; import org.rometools.feed.module.base.types.ShortDate;
import com.sun.syndication.feed.module.Module;
import com.sun.syndication.io.ModuleGenerator; import com.sun.syndication.io.ModuleGenerator;
import org.jdom.Element;
import java.net.URL;
import java.util.Date;
import java.util.HashSet;
import java.util.Iterator;
import java.util.List;
/** /**
* @version $Revision: 1.1 $ * @version $Revision: 1.1 $
* @author <a href="mailto:cooper@screaming-penguin.com">Robert "kebernet" Cooper</a> * @author <a href="mailto:cooper@screaming-penguin.com">Robert "kebernet" Cooper</a>
@ -62,72 +60,72 @@ public class CustomTagGenerator implements ModuleGenerator {
return NAMESPACES; return NAMESPACES;
} }
public void generate(Module module,Element element) { public void generate(final Module module, final Element element) {
if(!(module instanceof CustomTags)) { if (!(module instanceof CustomTags)) {
return; return;
} }
List tags = ((CustomTags)module).getValues(); final List tags = ((CustomTags) module).getValues();
Iterator it = tags.iterator(); final Iterator it = tags.iterator();
while(it.hasNext()) { while (it.hasNext()) {
CustomTag tag = (CustomTag)it.next(); final CustomTag tag = (CustomTag) it.next();
if(tag.getValue() instanceof DateTimeRange) { if (tag.getValue() instanceof DateTimeRange) {
DateTimeRange dtr = (DateTimeRange)tag.getValue(); final DateTimeRange dtr = (DateTimeRange) tag.getValue();
Element newTag = new Element(tag.getName(),CustomTagParser.NS); final Element newTag = new Element(tag.getName(), CustomTagParser.NS);
newTag.setAttribute("type","dateTimeRange"); newTag.setAttribute("type", "dateTimeRange");
newTag.addContent(this.generateSimpleElement("start",GoogleBaseParser.LONG_DT_FMT.format(dtr.getStart()))); newTag.addContent(generateSimpleElement("start", GoogleBaseParser.LONG_DT_FMT.format(dtr.getStart())));
newTag.addContent(this.generateSimpleElement("end",GoogleBaseParser.LONG_DT_FMT.format(dtr.getEnd()))); newTag.addContent(generateSimpleElement("end", GoogleBaseParser.LONG_DT_FMT.format(dtr.getEnd())));
element.addContent(newTag); element.addContent(newTag);
} else if(tag.getValue() instanceof ShortDate) { } else if (tag.getValue() instanceof ShortDate) {
ShortDate sd = (ShortDate)tag.getValue(); final ShortDate sd = (ShortDate) tag.getValue();
Element newTag = this.generateSimpleElement(tag.getName(),GoogleBaseParser.SHORT_DT_FMT.format(sd)); final Element newTag = generateSimpleElement(tag.getName(), GoogleBaseParser.SHORT_DT_FMT.format(sd));
newTag.setAttribute("type","date"); newTag.setAttribute("type", "date");
element.addContent(newTag); element.addContent(newTag);
} else if(tag.getValue() instanceof Date) { } else if (tag.getValue() instanceof Date) {
Date d = (Date)tag.getValue(); final Date d = (Date) tag.getValue();
Element newTag = this.generateSimpleElement(tag.getName(),GoogleBaseParser.SHORT_DT_FMT.format(d)); final Element newTag = generateSimpleElement(tag.getName(), GoogleBaseParser.SHORT_DT_FMT.format(d));
newTag.setAttribute("type","dateTime"); newTag.setAttribute("type", "dateTime");
element.addContent(newTag); element.addContent(newTag);
} else if(tag.getValue() instanceof Integer) { } else if (tag.getValue() instanceof Integer) {
Element newTag = this.generateSimpleElement(tag.getName(),tag.getValue().toString()); final Element newTag = generateSimpleElement(tag.getName(), tag.getValue().toString());
newTag.setAttribute("type","int"); newTag.setAttribute("type", "int");
element.addContent(newTag); element.addContent(newTag);
} else if(tag.getValue() instanceof IntUnit) { } else if (tag.getValue() instanceof IntUnit) {
Element newTag = this.generateSimpleElement(tag.getName(),tag.getValue().toString()); final Element newTag = generateSimpleElement(tag.getName(), tag.getValue().toString());
newTag.setAttribute("type","intUnit"); newTag.setAttribute("type", "intUnit");
element.addContent(newTag); element.addContent(newTag);
} else if(tag.getValue() instanceof Float) { } else if (tag.getValue() instanceof Float) {
Element newTag = this.generateSimpleElement(tag.getName(),tag.getValue().toString()); final Element newTag = generateSimpleElement(tag.getName(), tag.getValue().toString());
newTag.setAttribute("type","float"); newTag.setAttribute("type", "float");
element.addContent(newTag); element.addContent(newTag);
} else if(tag.getValue() instanceof FloatUnit) { } else if (tag.getValue() instanceof FloatUnit) {
Element newTag = this.generateSimpleElement(tag.getName(),tag.getValue().toString()); final Element newTag = generateSimpleElement(tag.getName(), tag.getValue().toString());
newTag.setAttribute("type","floatUnit"); newTag.setAttribute("type", "floatUnit");
element.addContent(newTag); element.addContent(newTag);
} else if(tag.getValue() instanceof String) { } else if (tag.getValue() instanceof String) {
Element newTag = this.generateSimpleElement(tag.getName(),tag.getValue().toString()); final Element newTag = generateSimpleElement(tag.getName(), tag.getValue().toString());
newTag.setAttribute("type","string"); newTag.setAttribute("type", "string");
element.addContent(newTag); element.addContent(newTag);
} else if(tag.getValue() instanceof URL) { } else if (tag.getValue() instanceof URL) {
Element newTag = this.generateSimpleElement(tag.getName(),tag.getValue().toString()); final Element newTag = generateSimpleElement(tag.getName(), tag.getValue().toString());
newTag.setAttribute("type","url"); newTag.setAttribute("type", "url");
element.addContent(newTag); element.addContent(newTag);
} else if(tag.getValue() instanceof Boolean) { } else if (tag.getValue() instanceof Boolean) {
Element newTag = this.generateSimpleElement(tag.getName(),tag.getValue().toString()); final Element newTag = generateSimpleElement(tag.getName(), tag.getValue().toString());
newTag.setAttribute("type","boolean"); newTag.setAttribute("type", "boolean");
element.addContent(newTag); element.addContent(newTag);
} else if( tag.getValue() instanceof CustomTagImpl.Location ){ } else if (tag.getValue() instanceof CustomTagImpl.Location) {
Element newTag = this.generateSimpleElement(tag.getName(),tag.getValue().toString()); final Element newTag = generateSimpleElement(tag.getName(), tag.getValue().toString());
newTag.setAttribute("type","location"); newTag.setAttribute("type", "location");
element.addContent(newTag); element.addContent(newTag);
} }
} }
} }
protected Element generateSimpleElement(String name,String value) { protected Element generateSimpleElement(final String name, final String value) {
Element element = new Element(name,CustomTagParser.NS); final Element element = new Element(name, CustomTagParser.NS);
element.addContent(value); element.addContent(value);
return element; return element;

View file

@ -20,16 +20,6 @@
package org.rometools.feed.module.base.io; package org.rometools.feed.module.base.io;
import com.sun.syndication.feed.module.Module;
import org.rometools.feed.module.base.CustomTagImpl;
import org.rometools.feed.module.base.CustomTags;
import org.rometools.feed.module.base.CustomTagsImpl;
import org.rometools.feed.module.base.types.DateTimeRange;
import org.rometools.feed.module.base.types.FloatUnit;
import org.rometools.feed.module.base.types.IntUnit;
import org.rometools.feed.module.base.types.ShortDate;
import com.sun.syndication.io.ModuleParser;
import java.net.MalformedURLException; import java.net.MalformedURLException;
import java.net.URL; import java.net.URL;
import java.text.ParseException; import java.text.ParseException;
@ -38,85 +28,98 @@ import java.util.Iterator;
import java.util.List; import java.util.List;
import java.util.logging.Level; import java.util.logging.Level;
import java.util.logging.Logger; import java.util.logging.Logger;
import org.jdom.Element;
import org.jdom.Namespace; import org.jdom2.Element;
import org.jdom2.Namespace;
import org.rometools.feed.module.base.CustomTagImpl;
import org.rometools.feed.module.base.CustomTags;
import org.rometools.feed.module.base.CustomTagsImpl;
import org.rometools.feed.module.base.types.DateTimeRange;
import org.rometools.feed.module.base.types.FloatUnit;
import org.rometools.feed.module.base.types.IntUnit;
import org.rometools.feed.module.base.types.ShortDate;
import com.sun.syndication.feed.module.Module;
import com.sun.syndication.io.ModuleParser;
/** /**
* @version $Revision: 1.4 $ * @version $Revision: 1.4 $
* @author <a href="mailto:cooper@screaming-penguin.com">Robert "kebernet" Cooper</a> * @author <a href="mailto:cooper@screaming-penguin.com">Robert "kebernet" Cooper</a>
*/ */
public class CustomTagParser implements ModuleParser { public class CustomTagParser implements ModuleParser {
private static final Logger log = Logger.getAnonymousLogger(); private static final Logger log = Logger.getAnonymousLogger();
static final Namespace NS = Namespace.getNamespace( "g-custom", CustomTags.URI ); static final Namespace NS = Namespace.getNamespace("g-custom", CustomTags.URI);
/** Creates a new instance of CustomTagParser */ /** Creates a new instance of CustomTagParser */
public CustomTagParser() { public CustomTagParser() {
} }
public Module parse(Element element) { public Module parse(final Element element) {
CustomTags module = new CustomTagsImpl(); final CustomTags module = new CustomTagsImpl();
ArrayList tags = new ArrayList(); final ArrayList tags = new ArrayList();
List elements = element.getChildren(); final List elements = element.getChildren();
Iterator it = elements.iterator(); final Iterator it = elements.iterator();
while( it.hasNext() ){ while (it.hasNext()) {
Element child = (Element) it.next(); final Element child = (Element) it.next();
if( child.getNamespace().equals( NS ) ){ if (child.getNamespace().equals(NS)) {
String type = child.getAttributeValue( "type" ); final String type = child.getAttributeValue("type");
try{ try {
if( type == null ){ if (type == null) {
continue; continue;
} else if( type.equals( "string") ){ } else if (type.equals("string")) {
tags.add( new CustomTagImpl( child.getName(), child.getText() ) ); tags.add(new CustomTagImpl(child.getName(), child.getText()));
} else if( type.equals( "int") ){ } else if (type.equals("int")) {
tags.add( new CustomTagImpl( child.getName(), new Integer( child.getTextTrim() ))); tags.add(new CustomTagImpl(child.getName(), new Integer(child.getTextTrim())));
} else if( type.equals( "float") ){ } else if (type.equals("float")) {
tags.add( new CustomTagImpl( child.getName(), new Float( child.getTextTrim() ) ) ); tags.add(new CustomTagImpl(child.getName(), new Float(child.getTextTrim())));
} else if( type.equals("intUnit") ){ } else if (type.equals("intUnit")) {
tags.add( new CustomTagImpl( child.getName(), new IntUnit( child.getTextTrim()) ) ); tags.add(new CustomTagImpl(child.getName(), new IntUnit(child.getTextTrim())));
} else if( type.equals( "floatUnit") ){ } else if (type.equals("floatUnit")) {
tags.add( new CustomTagImpl( child.getName(), new FloatUnit( child.getTextTrim()) ) ); tags.add(new CustomTagImpl(child.getName(), new FloatUnit(child.getTextTrim())));
} else if( type.equals( "date") ){ } else if (type.equals("date")) {
try{ try {
tags.add( new CustomTagImpl( child.getName(), new ShortDate( GoogleBaseParser.SHORT_DT_FMT.parse( child.getTextTrim()))) ); tags.add(new CustomTagImpl(child.getName(), new ShortDate(GoogleBaseParser.SHORT_DT_FMT.parse(child.getTextTrim()))));
} catch( ParseException e ){ } catch (final ParseException e) {
log.log( Level.WARNING, "Unable to parse date type on "+child.getName(), e ); log.log(Level.WARNING, "Unable to parse date type on " + child.getName(), e);
} }
} else if( type.equals( "dateTime") ){ } else if (type.equals("dateTime")) {
try{ try {
tags.add( new CustomTagImpl( child.getName(), GoogleBaseParser.LONG_DT_FMT.parse( child.getTextTrim() ))); tags.add(new CustomTagImpl(child.getName(), GoogleBaseParser.LONG_DT_FMT.parse(child.getTextTrim())));
} catch(ParseException e){ } catch (final ParseException e) {
log.log( Level.WARNING, "Unable to parse date type on "+child.getName(), e ); log.log(Level.WARNING, "Unable to parse date type on " + child.getName(), e);
} }
} else if( type.equals( "dateTimeRange") ){ } else if (type.equals("dateTimeRange")) {
try{ try {
tags.add( new CustomTagImpl( child.getName(), new DateTimeRange(GoogleBaseParser.LONG_DT_FMT.parse(child.getChild("start",CustomTagParser.NS).getText().trim()),GoogleBaseParser.LONG_DT_FMT.parse(child.getChild("end",CustomTagParser.NS).getText().trim())))); tags.add(new CustomTagImpl(child.getName(), new DateTimeRange(GoogleBaseParser.LONG_DT_FMT.parse(child
} catch(Exception e){ .getChild("start", CustomTagParser.NS).getText().trim()), GoogleBaseParser.LONG_DT_FMT.parse(child
log.log( Level.WARNING, "Unable to parse date type on "+child.getName(), e ); .getChild("end", CustomTagParser.NS).getText().trim()))));
} } catch (final Exception e) {
} else if( type.equals( "url") ){ log.log(Level.WARNING, "Unable to parse date type on " + child.getName(), e);
try{ }
tags.add( new CustomTagImpl( child.getName(), new URL( child.getTextTrim() )) ); } else if (type.equals("url")) {
} catch( MalformedURLException e){ try {
log.log( Level.WARNING, "Unable to parse URL type on "+child.getName(), e ); tags.add(new CustomTagImpl(child.getName(), new URL(child.getTextTrim())));
} } catch (final MalformedURLException e) {
} else if( type.equals( "boolean") ){ log.log(Level.WARNING, "Unable to parse URL type on " + child.getName(), e);
tags.add( new CustomTagImpl( child.getName(), new Boolean( child.getTextTrim().toLowerCase()) )); }
} else if( type.equals( "location") ) { } else if (type.equals("boolean")) {
tags.add( new CustomTagImpl( child.getName(), new CustomTagImpl.Location( child.getText() ))); tags.add(new CustomTagImpl(child.getName(), new Boolean(child.getTextTrim().toLowerCase())));
} else { } else if (type.equals("location")) {
throw new Exception( "Unknown type: "+ type ); tags.add(new CustomTagImpl(child.getName(), new CustomTagImpl.Location(child.getText())));
} } else {
} catch(Exception e){ throw new Exception("Unknown type: " + type);
log.log( Level.WARNING, "Unable to parse type on "+child.getName(), e ); }
} } catch (final Exception e) {
} log.log(Level.WARNING, "Unable to parse type on " + child.getName(), e);
} }
module.setValues( tags ); }
return module; }
module.setValues(tags);
return module;
} }
public String getNamespaceUri() { public String getNamespaceUri() {
return CustomTags.URI; return CustomTags.URI;
} }
} }

View file

@ -39,9 +39,15 @@
*/ */
package org.rometools.feed.module.base.io; package org.rometools.feed.module.base.io;
import com.sun.syndication.feed.module.Module; import java.beans.PropertyDescriptor;
import com.sun.syndication.io.ModuleGenerator; import java.net.URL;
import java.util.Date;
import java.util.HashMap;
import java.util.HashSet;
import java.util.Set;
import org.jdom2.Element;
import org.jdom2.Namespace;
import org.rometools.feed.module.base.GoogleBase; import org.rometools.feed.module.base.GoogleBase;
import org.rometools.feed.module.base.GoogleBaseImpl; import org.rometools.feed.module.base.GoogleBaseImpl;
import org.rometools.feed.module.base.types.CurrencyEnumeration; import org.rometools.feed.module.base.types.CurrencyEnumeration;
@ -56,111 +62,101 @@ import org.rometools.feed.module.base.types.ShortDate;
import org.rometools.feed.module.base.types.Size; import org.rometools.feed.module.base.types.Size;
import org.rometools.feed.module.base.types.YearType; import org.rometools.feed.module.base.types.YearType;
import org.jdom.Element; import com.sun.syndication.feed.module.Module;
import org.jdom.Namespace; import com.sun.syndication.io.ModuleGenerator;
import java.beans.PropertyDescriptor;
import java.net.URL;
import java.util.Date;
import java.util.HashMap;
import java.util.HashSet;
import java.util.Set;
/** /**
* *
* @author <a href="mailto:cooper@screaming-penguin.com">Robert "kebernet" Cooper * @author <a href="mailto:cooper@screaming-penguin.com">Robert "kebernet" Cooper
* @version $Revision: 1.1 $ * @version $Revision: 1.1 $
*/ */
public class GoogleBaseGenerator implements ModuleGenerator { public class GoogleBaseGenerator implements ModuleGenerator {
private static final Namespace NS = Namespace.getNamespace("g-core",GoogleBase.URI); private static final Namespace NS = Namespace.getNamespace("g-core", GoogleBase.URI);
/** Creates a new instance of GoogleBaseGenerator */ /** Creates a new instance of GoogleBaseGenerator */
public GoogleBaseGenerator() { public GoogleBaseGenerator() {
super(); super();
} }
public String getNamespaceUri() { public String getNamespaceUri() {
return GoogleBase.URI; return GoogleBase.URI;
} }
public Set getNamespaces() { public Set getNamespaces() {
HashSet set = new HashSet(); final HashSet set = new HashSet();
set.add(GoogleBaseGenerator.NS); set.add(GoogleBaseGenerator.NS);
return set; return set;
} }
public void generate(Module module,Element element) { public void generate(final Module module, final Element element) {
GoogleBaseImpl mod = (GoogleBaseImpl)module; final GoogleBaseImpl mod = (GoogleBaseImpl) module;
HashMap props2tags = new HashMap(GoogleBaseParser.PROPS2TAGS); final HashMap props2tags = new HashMap(GoogleBaseParser.PROPS2TAGS);
PropertyDescriptor[] pds = GoogleBaseParser.pds; final PropertyDescriptor[] pds = GoogleBaseParser.pds;
for(int i = 0; i < pds.length; i++) { for (final PropertyDescriptor pd : pds) {
String tagName = (String)props2tags.get(pds[i].getName()); final String tagName = (String) props2tags.get(pd.getName());
if(tagName == null) { if (tagName == null) {
continue; continue;
} }
Object[] values = null; Object[] values = null;
try { try {
if(pds[i].getPropertyType().isArray()) { if (pd.getPropertyType().isArray()) {
values = (Object[])pds[i].getReadMethod().invoke(mod,(Object[])null); values = (Object[]) pd.getReadMethod().invoke(mod, (Object[]) null);
} else { } else {
values = new Object[] { values = new Object[] { pd.getReadMethod().invoke(mod, (Object[]) null) };
pds[i].getReadMethod().invoke(mod,(Object[])null) }
};
} for (int j = 0; values != null && j < values.length; j++) {
if (values[j] != null) {
for(int j = 0; (values != null)&&(j < values.length); j++) { element.addContent(generateTag(values[j], tagName));
if(values[j] != null) { }
element.addContent(this.generateTag(values[j],tagName)); }
} } catch (final Exception e) {
} e.printStackTrace();
} catch(Exception e) { }
e.printStackTrace(); }
}
}
} }
public Element generateTag(Object o,String tagName) { public Element generateTag(final Object o, final String tagName) {
if(o instanceof URL||o instanceof Float||o instanceof Boolean||o instanceof Integer||o instanceof String||o instanceof FloatUnit||o instanceof IntUnit||o instanceof GenderEnumeration||o instanceof PaymentTypeEnumeration||o instanceof PriceTypeEnumeration||o instanceof CurrencyEnumeration||o instanceof Size||o instanceof YearType) { if (o instanceof URL || o instanceof Float || o instanceof Boolean || o instanceof Integer || o instanceof String || o instanceof FloatUnit
return this.generateSimpleElement(tagName,o.toString()); || o instanceof IntUnit || o instanceof GenderEnumeration || o instanceof PaymentTypeEnumeration || o instanceof PriceTypeEnumeration
} else if(o instanceof ShortDate) { || o instanceof CurrencyEnumeration || o instanceof Size || o instanceof YearType) {
return this.generateSimpleElement(tagName,GoogleBaseParser.SHORT_DT_FMT.format(o)); return generateSimpleElement(tagName, o.toString());
} else if(o instanceof Date) { } else if (o instanceof ShortDate) {
return this.generateSimpleElement(tagName,GoogleBaseParser.LONG_DT_FMT.format(o)); return generateSimpleElement(tagName, GoogleBaseParser.SHORT_DT_FMT.format(o));
} else if(o instanceof ShippingType) { } else if (o instanceof Date) {
ShippingType st = (ShippingType)o; return generateSimpleElement(tagName, GoogleBaseParser.LONG_DT_FMT.format(o));
Element element = new Element(tagName,GoogleBaseGenerator.NS); } else if (o instanceof ShippingType) {
final ShippingType st = (ShippingType) o;
element.addContent(this.generateSimpleElement("country",st.getCountry())); final Element element = new Element(tagName, GoogleBaseGenerator.NS);
element.addContent(this.generateSimpleElement("service", st.getService().toString() )); element.addContent(generateSimpleElement("country", st.getCountry()));
element.addContent(this.generateSimpleElement("price",st.getPrice().toString())); element.addContent(generateSimpleElement("service", st.getService().toString()));
return element; element.addContent(generateSimpleElement("price", st.getPrice().toString()));
} else if(o instanceof DateTimeRange) {
DateTimeRange dtr = (DateTimeRange)o; return element;
Element element = new Element(tagName,GoogleBaseGenerator.NS); } else if (o instanceof DateTimeRange) {
element.addContent(this.generateSimpleElement("start",GoogleBaseParser.LONG_DT_FMT.format(dtr.getStart()))); final DateTimeRange dtr = (DateTimeRange) o;
element.addContent(this.generateSimpleElement("end",GoogleBaseParser.LONG_DT_FMT.format(dtr.getEnd()))); final Element element = new Element(tagName, GoogleBaseGenerator.NS);
element.addContent(generateSimpleElement("start", GoogleBaseParser.LONG_DT_FMT.format(dtr.getStart())));
return element; element.addContent(generateSimpleElement("end", GoogleBaseParser.LONG_DT_FMT.format(dtr.getEnd())));
}
return element;
throw new RuntimeException("Unknown class type to handle: " + o.getClass().getName()); }
throw new RuntimeException("Unknown class type to handle: " + o.getClass().getName());
} }
protected Element generateSimpleElement(String name,String value) { protected Element generateSimpleElement(final String name, final String value) {
Element element = new Element(name,GoogleBaseGenerator.NS); final Element element = new Element(name, GoogleBaseGenerator.NS);
element.addContent(value); element.addContent(value);
return element; return element;
} }
} }

View file

@ -39,10 +39,25 @@
*/ */
package org.rometools.feed.module.base.io; package org.rometools.feed.module.base.io;
import com.sun.syndication.feed.module.Module; import java.beans.IntrospectionException;
import java.beans.Introspector;
import java.beans.PropertyDescriptor;
import java.io.IOException;
import java.lang.reflect.Array;
import java.net.URL;
import java.text.SimpleDateFormat;
import java.util.Date;
import java.util.HashMap;
import java.util.Iterator;
import java.util.List;
import java.util.Properties;
import java.util.logging.Level;
import java.util.logging.Logger;
import org.jdom2.Element;
import org.jdom2.Namespace;
import org.rometools.feed.module.base.GoogleBase; import org.rometools.feed.module.base.GoogleBase;
import org.rometools.feed.module.base.GoogleBaseImpl; import org.rometools.feed.module.base.GoogleBaseImpl;
import com.sun.syndication.io.ModuleParser;
import org.rometools.feed.module.base.types.CurrencyEnumeration; import org.rometools.feed.module.base.types.CurrencyEnumeration;
import org.rometools.feed.module.base.types.DateTimeRange; import org.rometools.feed.module.base.types.DateTimeRange;
import org.rometools.feed.module.base.types.FloatUnit; import org.rometools.feed.module.base.types.FloatUnit;
@ -54,34 +69,13 @@ import org.rometools.feed.module.base.types.ShippingType;
import org.rometools.feed.module.base.types.Size; import org.rometools.feed.module.base.types.Size;
import org.rometools.feed.module.base.types.YearType; import org.rometools.feed.module.base.types.YearType;
import org.jdom.Element; import com.sun.syndication.feed.module.Module;
import org.jdom.Namespace; import com.sun.syndication.io.ModuleParser;
import java.beans.IntrospectionException;
import java.beans.Introspector;
import java.beans.PropertyDescriptor;
import java.io.IOException;
import java.lang.reflect.Array;
import java.net.URL;
import java.text.SimpleDateFormat;
import java.util.Date;
import java.util.HashMap;
import java.util.Iterator;
import java.util.List;
import java.util.Properties;
import java.util.logging.Level;
import java.util.logging.Logger;
/** /**
* DOCUMENT ME! * DOCUMENT ME!
* *
* @author <a href="mailto:cooper@screaming-penguin.com">Robert "kebernet" * @author <a href="mailto:cooper@screaming-penguin.com">Robert "kebernet" Cooper</a>
* Cooper</a>
* @version $Revision: 1.3 $ * @version $Revision: 1.3 $
*/ */
public class GoogleBaseParser implements ModuleParser { public class GoogleBaseParser implements ModuleParser {
@ -98,12 +92,12 @@ public class GoogleBaseParser implements ModuleParser {
try { try {
pds = Introspector.getBeanInfo(GoogleBaseImpl.class).getPropertyDescriptors(); pds = Introspector.getBeanInfo(GoogleBaseImpl.class).getPropertyDescriptors();
PROPS2TAGS.load(GoogleBaseParser.class.getResourceAsStream("/org/rometools/feed/module/base/io/tags.properties")); PROPS2TAGS.load(GoogleBaseParser.class.getResourceAsStream("/org/rometools/feed/module/base/io/tags.properties"));
} catch(IOException e) { } catch (final IOException e) {
e.printStackTrace(); e.printStackTrace();
log.log(Level.SEVERE,"Unable to read properties file for Google Base tags!",e); log.log(Level.SEVERE, "Unable to read properties file for Google Base tags!", e);
} catch(IntrospectionException e) { } catch (final IntrospectionException e) {
e.printStackTrace(); e.printStackTrace();
log.log(Level.SEVERE,"Unable to get property descriptors for GoogleBaseImpl!",e); log.log(Level.SEVERE, "Unable to get property descriptors for GoogleBaseImpl!", e);
} }
} }
@ -114,39 +108,38 @@ public class GoogleBaseParser implements ModuleParser {
super(); super();
} }
public Module parse(Element element) { public Module parse(final Element element) {
HashMap tag2pd = new HashMap(); final HashMap tag2pd = new HashMap();
GoogleBaseImpl module = new GoogleBaseImpl(); final GoogleBaseImpl module = new GoogleBaseImpl();
try { try {
for(int i = 0; i < pds.length; i++) { for (final PropertyDescriptor pd : pds) {
PropertyDescriptor pd = pds[i]; final String tagName = GoogleBaseParser.PROPS2TAGS.getProperty(pd.getName());
String tagName = GoogleBaseParser.PROPS2TAGS.getProperty(pd.getName());
if(tagName == null) { if (tagName == null) {
log.log(Level.FINE,"Property: " + pd.getName() + " doesn't have a tag mapping. "); log.log(Level.FINE, "Property: " + pd.getName() + " doesn't have a tag mapping. ");
} else { } else {
tag2pd.put(tagName,pd); tag2pd.put(tagName, pd);
} }
} }
} catch(Exception e) { } catch (final Exception e) {
throw new RuntimeException("Exception building tag to property mapping. ",e); throw new RuntimeException("Exception building tag to property mapping. ", e);
} }
List children = element.getChildren(); final List children = element.getChildren();
Iterator it = children.iterator(); final Iterator it = children.iterator();
while(it.hasNext()) { while (it.hasNext()) {
Element child = (Element)it.next(); final Element child = (Element) it.next();
if(child.getNamespace().equals(GoogleBaseParser.NS)) { if (child.getNamespace().equals(GoogleBaseParser.NS)) {
PropertyDescriptor pd = (PropertyDescriptor)tag2pd.get(child.getName()); final PropertyDescriptor pd = (PropertyDescriptor) tag2pd.get(child.getName());
if(pd != null) { if (pd != null) {
try { try {
this.handleTag(child,pd,module); handleTag(child, pd, module);
} catch(Exception e) { } catch (final Exception e) {
log.log(Level.WARNING,"Unable to handle tag: " + child.getName(),e); log.log(Level.WARNING, "Unable to handle tag: " + child.getName(), e);
e.printStackTrace(); e.printStackTrace();
} }
} }
@ -156,13 +149,13 @@ public class GoogleBaseParser implements ModuleParser {
return module; return module;
} }
public static String stripNonValidCharacters(char[] validCharacters,String input) { public static String stripNonValidCharacters(final char[] validCharacters, final String input) {
StringBuffer newString = new StringBuffer(); final StringBuffer newString = new StringBuffer();
for(int i = 0; i < input.length(); i++) { for (int i = 0; i < input.length(); i++) {
for(int j = 0; j < validCharacters.length; j++) { for (final char validCharacter : validCharacters) {
if(input.charAt(i) == validCharacters[j]) { if (input.charAt(i) == validCharacter) {
newString.append(validCharacters[j]); newString.append(validCharacter);
} }
} }
} }
@ -174,72 +167,74 @@ public class GoogleBaseParser implements ModuleParser {
return GoogleBase.URI; return GoogleBase.URI;
} }
private void handleTag(Element tag,PropertyDescriptor pd,GoogleBase module) throws Exception { private void handleTag(final Element tag, final PropertyDescriptor pd, final GoogleBase module) throws Exception {
Object tagValue = null; Object tagValue = null;
if((pd.getPropertyType() == Integer.class)||(pd.getPropertyType().getComponentType() == Integer.class)) { if (pd.getPropertyType() == Integer.class || pd.getPropertyType().getComponentType() == Integer.class) {
tagValue = new Integer(GoogleBaseParser.stripNonValidCharacters(GoogleBaseParser.INTEGER_CHARS,tag.getText())); tagValue = new Integer(GoogleBaseParser.stripNonValidCharacters(GoogleBaseParser.INTEGER_CHARS, tag.getText()));
} else if((pd.getPropertyType() == Float.class)||(pd.getPropertyType().getComponentType() == Float.class)) { } else if (pd.getPropertyType() == Float.class || pd.getPropertyType().getComponentType() == Float.class) {
tagValue = new Float(GoogleBaseParser.stripNonValidCharacters(GoogleBaseParser.FLOAT_CHARS,tag.getText())); tagValue = new Float(GoogleBaseParser.stripNonValidCharacters(GoogleBaseParser.FLOAT_CHARS, tag.getText()));
} else if((pd.getPropertyType() == String.class)||(pd.getPropertyType().getComponentType() == String.class)) { } else if (pd.getPropertyType() == String.class || pd.getPropertyType().getComponentType() == String.class) {
tagValue = tag.getText(); tagValue = tag.getText();
} else if((pd.getPropertyType() == URL.class)||(pd.getPropertyType().getComponentType() == URL.class)) { } else if (pd.getPropertyType() == URL.class || pd.getPropertyType().getComponentType() == URL.class) {
tagValue = new URL(tag.getText().trim()); tagValue = new URL(tag.getText().trim());
} else if((pd.getPropertyType() == Boolean.class)||(pd.getPropertyType().getComponentType() == Boolean.class)) { } else if (pd.getPropertyType() == Boolean.class || pd.getPropertyType().getComponentType() == Boolean.class) {
tagValue = new Boolean(tag.getText().trim()); tagValue = new Boolean(tag.getText().trim());
} else if((pd.getPropertyType() == Date.class)||(pd.getPropertyType().getComponentType() == Date.class)) { } else if (pd.getPropertyType() == Date.class || pd.getPropertyType().getComponentType() == Date.class) {
String text = tag.getText().trim(); final String text = tag.getText().trim();
if(text.length() > 10) { if (text.length() > 10) {
tagValue = GoogleBaseParser.LONG_DT_FMT.parse(text); tagValue = GoogleBaseParser.LONG_DT_FMT.parse(text);
} else { } else {
tagValue = GoogleBaseParser.SHORT_DT_FMT.parse(text); tagValue = GoogleBaseParser.SHORT_DT_FMT.parse(text);
} }
} else if((pd.getPropertyType() == IntUnit.class)||(pd.getPropertyType().getComponentType() == IntUnit.class)) { } else if (pd.getPropertyType() == IntUnit.class || pd.getPropertyType().getComponentType() == IntUnit.class) {
tagValue = new IntUnit(tag.getText()); tagValue = new IntUnit(tag.getText());
} else if((pd.getPropertyType() == FloatUnit.class)||(pd.getPropertyType().getComponentType() == FloatUnit.class)) { } else if (pd.getPropertyType() == FloatUnit.class || pd.getPropertyType().getComponentType() == FloatUnit.class) {
tagValue = new FloatUnit(tag.getText()); tagValue = new FloatUnit(tag.getText());
} else if((pd.getPropertyType() == DateTimeRange.class)||(pd.getPropertyType().getComponentType() == DateTimeRange.class)) { } else if (pd.getPropertyType() == DateTimeRange.class || pd.getPropertyType().getComponentType() == DateTimeRange.class) {
tagValue = new DateTimeRange(LONG_DT_FMT.parse(tag.getChild("start",GoogleBaseParser.NS).getText().trim()),LONG_DT_FMT.parse(tag.getChild("end",GoogleBaseParser.NS).getText().trim())); tagValue = new DateTimeRange(LONG_DT_FMT.parse(tag.getChild("start", GoogleBaseParser.NS).getText().trim()), LONG_DT_FMT.parse(tag
} else if((pd.getPropertyType() == ShippingType.class)||(pd.getPropertyType().getComponentType() == ShippingType.class)) { .getChild("end", GoogleBaseParser.NS).getText().trim()));
FloatUnit price = new FloatUnit(tag.getChild("price",GoogleBaseParser.NS).getText().trim()); } else if (pd.getPropertyType() == ShippingType.class || pd.getPropertyType().getComponentType() == ShippingType.class) {
ShippingType.ServiceEnumeration service = ShippingType.ServiceEnumeration.findByValue(tag.getChild("service",GoogleBaseParser.NS).getText().trim()); final FloatUnit price = new FloatUnit(tag.getChild("price", GoogleBaseParser.NS).getText().trim());
ShippingType.ServiceEnumeration service = ShippingType.ServiceEnumeration
.findByValue(tag.getChild("service", GoogleBaseParser.NS).getText().trim());
if(service == null) { if (service == null) {
service = ShippingType.ServiceEnumeration.STANDARD; service = ShippingType.ServiceEnumeration.STANDARD;
} }
String country = tag.getChild("country",GoogleBaseParser.NS).getText().trim(); final String country = tag.getChild("country", GoogleBaseParser.NS).getText().trim();
tagValue = new ShippingType(price,service,country); tagValue = new ShippingType(price, service, country);
} else if((pd.getPropertyType() == PaymentTypeEnumeration.class)||(pd.getPropertyType().getComponentType() == PaymentTypeEnumeration.class)) { } else if (pd.getPropertyType() == PaymentTypeEnumeration.class || pd.getPropertyType().getComponentType() == PaymentTypeEnumeration.class) {
tagValue = PaymentTypeEnumeration.findByValue(tag.getText().trim()); tagValue = PaymentTypeEnumeration.findByValue(tag.getText().trim());
} else if((pd.getPropertyType() == PriceTypeEnumeration.class)||(pd.getPropertyType().getComponentType() == PriceTypeEnumeration.class)) { } else if (pd.getPropertyType() == PriceTypeEnumeration.class || pd.getPropertyType().getComponentType() == PriceTypeEnumeration.class) {
tagValue = PriceTypeEnumeration.findByValue(tag.getText().trim()); tagValue = PriceTypeEnumeration.findByValue(tag.getText().trim());
} else if((pd.getPropertyType() == CurrencyEnumeration.class)||(pd.getPropertyType().getComponentType() == CurrencyEnumeration.class)) { } else if (pd.getPropertyType() == CurrencyEnumeration.class || pd.getPropertyType().getComponentType() == CurrencyEnumeration.class) {
tagValue = CurrencyEnumeration.findByValue(tag.getText().trim()); tagValue = CurrencyEnumeration.findByValue(tag.getText().trim());
} else if((pd.getPropertyType() == GenderEnumeration.class)||(pd.getPropertyType().getComponentType() == GenderEnumeration.class)) { } else if (pd.getPropertyType() == GenderEnumeration.class || pd.getPropertyType().getComponentType() == GenderEnumeration.class) {
tagValue = GenderEnumeration.findByValue(tag.getText().trim()); tagValue = GenderEnumeration.findByValue(tag.getText().trim());
} else if((pd.getPropertyType() == YearType.class)||(pd.getPropertyType().getComponentType() == YearType.class)) { } else if (pd.getPropertyType() == YearType.class || pd.getPropertyType().getComponentType() == YearType.class) {
tagValue = new YearType(tag.getText().trim()); tagValue = new YearType(tag.getText().trim());
} else if((pd.getPropertyType() == Size.class)||(pd.getPropertyType().getComponentType() == Size.class)) { } else if (pd.getPropertyType() == Size.class || pd.getPropertyType().getComponentType() == Size.class) {
tagValue = new Size(tag.getText().trim()); tagValue = new Size(tag.getText().trim());
} }
if(!pd.getPropertyType().isArray()) { if (!pd.getPropertyType().isArray()) {
pd.getWriteMethod().invoke(module,new Object[] {tagValue}); pd.getWriteMethod().invoke(module, new Object[] { tagValue });
} else { } else {
Object[] current = (Object[])pd.getReadMethod().invoke(module,(Object[])null); final Object[] current = (Object[]) pd.getReadMethod().invoke(module, (Object[]) null);
int newSize = (current == null) ? 1 : (current.length + 1); final int newSize = current == null ? 1 : current.length + 1;
Object setValue = Array.newInstance(pd.getPropertyType().getComponentType(),newSize); final Object setValue = Array.newInstance(pd.getPropertyType().getComponentType(), newSize);
int i = 0; int i = 0;
for(; (current != null)&&(i < current.length); i++) { for (; current != null && i < current.length; i++) {
Array.set(setValue,i,current[i]); Array.set(setValue, i, current[i]);
} }
Array.set(setValue,i,tagValue); Array.set(setValue, i, tagValue);
pd.getWriteMethod().invoke(module,new Object[] {setValue}); pd.getWriteMethod().invoke(module, new Object[] { setValue });
} }
} }
} }

View file

@ -39,9 +39,9 @@
*/ */
package org.rometools.feed.module.base.types; package org.rometools.feed.module.base.types;
/** /**
* This is just a holder interface for cloneable elements. * This is just a holder interface for cloneable elements.
*
* @author <a href="mailto:cooper@screaming-penguin.com">Robert "kebernet" Cooper</a> * @author <a href="mailto:cooper@screaming-penguin.com">Robert "kebernet" Cooper</a>
* @version $Revision: 1.1 $ * @version $Revision: 1.1 $
*/ */

View file

@ -41,558 +41,559 @@ package org.rometools.feed.module.base.types;
import java.util.HashMap; import java.util.HashMap;
/** /**
* An Enumeration of valid currency types. * An Enumeration of valid currency types.
* *
* @author <a href="mailto:cooper@screaming-penguin.com">Robert "kebernet" Cooper</a> * @author <a href="mailto:cooper@screaming-penguin.com">Robert "kebernet" Cooper</a>
* @version $Revision: 1.1 $ * @version $Revision: 1.1 $
*/ */
public class CurrencyEnumeration { public class CurrencyEnumeration {
private static final HashMap lookup = new HashMap(); private static final HashMap lookup = new HashMap();
//<xs:restriction base="xs:string"> // <xs:restriction base="xs:string">
// <xs:enumeration value="AED"/> // <xs:enumeration value="AED"/>
public static final CurrencyEnumeration AED = new CurrencyEnumeration("AED"); public static final CurrencyEnumeration AED = new CurrencyEnumeration("AED");
// <xs:enumeration value="AFA"/> // <xs:enumeration value="AFA"/>
public static final CurrencyEnumeration AFA = new CurrencyEnumeration("AFA"); public static final CurrencyEnumeration AFA = new CurrencyEnumeration("AFA");
// <xs:enumeration value="ALL"/> // <xs:enumeration value="ALL"/>
public static final CurrencyEnumeration ALL = new CurrencyEnumeration("ALL"); public static final CurrencyEnumeration ALL = new CurrencyEnumeration("ALL");
// <xs:enumeration value="AMD"/> // <xs:enumeration value="AMD"/>
public static final CurrencyEnumeration AMD = new CurrencyEnumeration("AMD"); public static final CurrencyEnumeration AMD = new CurrencyEnumeration("AMD");
// <xs:enumeration value="ANG"/> // <xs:enumeration value="ANG"/>
public static final CurrencyEnumeration ANG = new CurrencyEnumeration("ANG"); public static final CurrencyEnumeration ANG = new CurrencyEnumeration("ANG");
// <xs:enumeration value="AOA"/> // <xs:enumeration value="AOA"/>
public static final CurrencyEnumeration AOA = new CurrencyEnumeration("AOA"); public static final CurrencyEnumeration AOA = new CurrencyEnumeration("AOA");
// <xs:enumeration value="ARS"/> // <xs:enumeration value="ARS"/>
public static final CurrencyEnumeration ARS = new CurrencyEnumeration("ARS"); public static final CurrencyEnumeration ARS = new CurrencyEnumeration("ARS");
// <xs:enumeration value="AUD"/> // <xs:enumeration value="AUD"/>
public static final CurrencyEnumeration AUD = new CurrencyEnumeration("AUD"); public static final CurrencyEnumeration AUD = new CurrencyEnumeration("AUD");
// <xs:enumeration value="AWG"/> // <xs:enumeration value="AWG"/>
public static final CurrencyEnumeration AWG = new CurrencyEnumeration("AWG"); public static final CurrencyEnumeration AWG = new CurrencyEnumeration("AWG");
// <xs:enumeration value="AZM"/> // <xs:enumeration value="AZM"/>
public static final CurrencyEnumeration AZM = new CurrencyEnumeration("AZM"); public static final CurrencyEnumeration AZM = new CurrencyEnumeration("AZM");
// <xs:enumeration value="BAM"/> // <xs:enumeration value="BAM"/>
public static final CurrencyEnumeration BAM = new CurrencyEnumeration("BAM"); public static final CurrencyEnumeration BAM = new CurrencyEnumeration("BAM");
// <xs:enumeration value="BBD"/> // <xs:enumeration value="BBD"/>
public static final CurrencyEnumeration BBD = new CurrencyEnumeration("BBD"); public static final CurrencyEnumeration BBD = new CurrencyEnumeration("BBD");
// <xs:enumeration value="BDT"/> // <xs:enumeration value="BDT"/>
public static final CurrencyEnumeration BDT = new CurrencyEnumeration("BDT"); public static final CurrencyEnumeration BDT = new CurrencyEnumeration("BDT");
// <xs:enumeration value="BGN"/> // <xs:enumeration value="BGN"/>
public static final CurrencyEnumeration BGN = new CurrencyEnumeration("BGN"); public static final CurrencyEnumeration BGN = new CurrencyEnumeration("BGN");
// <xs:enumeration value="BHD"/> // <xs:enumeration value="BHD"/>
public static final CurrencyEnumeration BHD = new CurrencyEnumeration("BHD"); public static final CurrencyEnumeration BHD = new CurrencyEnumeration("BHD");
// <xs:enumeration value="BIF"/> // <xs:enumeration value="BIF"/>
public static final CurrencyEnumeration BIF = new CurrencyEnumeration("BIF"); public static final CurrencyEnumeration BIF = new CurrencyEnumeration("BIF");
// <xs:enumeration value="BMD"/> // <xs:enumeration value="BMD"/>
public static final CurrencyEnumeration BMD = new CurrencyEnumeration("BMD"); public static final CurrencyEnumeration BMD = new CurrencyEnumeration("BMD");
// <xs:enumeration value="BND"/> // <xs:enumeration value="BND"/>
public static final CurrencyEnumeration BND = new CurrencyEnumeration("BND"); public static final CurrencyEnumeration BND = new CurrencyEnumeration("BND");
// <xs:enumeration value="BOB"/> // <xs:enumeration value="BOB"/>
public static final CurrencyEnumeration BOB = new CurrencyEnumeration("BOB"); public static final CurrencyEnumeration BOB = new CurrencyEnumeration("BOB");
// <xs:enumeration value="BRL"/> // <xs:enumeration value="BRL"/>
public static final CurrencyEnumeration BRL = new CurrencyEnumeration("BRL"); public static final CurrencyEnumeration BRL = new CurrencyEnumeration("BRL");
// <xs:enumeration value="BSD"/> // <xs:enumeration value="BSD"/>
public static final CurrencyEnumeration BSD = new CurrencyEnumeration("BSD"); public static final CurrencyEnumeration BSD = new CurrencyEnumeration("BSD");
// <xs:enumeration value="BTN"/> // <xs:enumeration value="BTN"/>
public static final CurrencyEnumeration BTN = new CurrencyEnumeration("BTN"); public static final CurrencyEnumeration BTN = new CurrencyEnumeration("BTN");
// <xs:enumeration value="BWP"/> // <xs:enumeration value="BWP"/>
public static final CurrencyEnumeration BWP = new CurrencyEnumeration("BWP"); public static final CurrencyEnumeration BWP = new CurrencyEnumeration("BWP");
// <xs:enumeration value="BYR"/> // <xs:enumeration value="BYR"/>
public static final CurrencyEnumeration BYR = new CurrencyEnumeration("BYR"); public static final CurrencyEnumeration BYR = new CurrencyEnumeration("BYR");
// <xs:enumeration value="BZD"/> // <xs:enumeration value="BZD"/>
public static final CurrencyEnumeration BZD = new CurrencyEnumeration("BZD"); public static final CurrencyEnumeration BZD = new CurrencyEnumeration("BZD");
// <xs:enumeration value="CAD"/> // <xs:enumeration value="CAD"/>
public static final CurrencyEnumeration CAD = new CurrencyEnumeration("CAD"); public static final CurrencyEnumeration CAD = new CurrencyEnumeration("CAD");
// <xs:enumeration value="CDF"/> // <xs:enumeration value="CDF"/>
public static final CurrencyEnumeration CDF = new CurrencyEnumeration("CDF"); public static final CurrencyEnumeration CDF = new CurrencyEnumeration("CDF");
// <xs:enumeration value="CHF"/> // <xs:enumeration value="CHF"/>
public static final CurrencyEnumeration CHF = new CurrencyEnumeration("CHF"); public static final CurrencyEnumeration CHF = new CurrencyEnumeration("CHF");
// <xs:enumeration value="CLP"/> // <xs:enumeration value="CLP"/>
public static final CurrencyEnumeration CLP = new CurrencyEnumeration("CLP"); public static final CurrencyEnumeration CLP = new CurrencyEnumeration("CLP");
// <xs:enumeration value="CNY"/> // <xs:enumeration value="CNY"/>
public static final CurrencyEnumeration CNY = new CurrencyEnumeration("CNY"); public static final CurrencyEnumeration CNY = new CurrencyEnumeration("CNY");
// <xs:enumeration value="CRC"/> // <xs:enumeration value="CRC"/>
public static final CurrencyEnumeration CRC = new CurrencyEnumeration("CRC"); public static final CurrencyEnumeration CRC = new CurrencyEnumeration("CRC");
// <xs:enumeration value="CSD"/> // <xs:enumeration value="CSD"/>
public static final CurrencyEnumeration CSD = new CurrencyEnumeration("CSD"); public static final CurrencyEnumeration CSD = new CurrencyEnumeration("CSD");
// <xs:enumeration value="CUP"/> // <xs:enumeration value="CUP"/>
public static final CurrencyEnumeration CUP = new CurrencyEnumeration("CUP"); public static final CurrencyEnumeration CUP = new CurrencyEnumeration("CUP");
// <xs:enumeration value="CVE"/> // <xs:enumeration value="CVE"/>
public static final CurrencyEnumeration CVE = new CurrencyEnumeration("CVE"); public static final CurrencyEnumeration CVE = new CurrencyEnumeration("CVE");
// <xs:enumeration value="CYP"/> // <xs:enumeration value="CYP"/>
public static final CurrencyEnumeration CYP = new CurrencyEnumeration("CYP"); public static final CurrencyEnumeration CYP = new CurrencyEnumeration("CYP");
// <xs:enumeration value="CZK"/> // <xs:enumeration value="CZK"/>
public static final CurrencyEnumeration CZK = new CurrencyEnumeration("CZK"); public static final CurrencyEnumeration CZK = new CurrencyEnumeration("CZK");
// <xs:enumeration value="DJF"/> // <xs:enumeration value="DJF"/>
public static final CurrencyEnumeration DJF = new CurrencyEnumeration("DJF"); public static final CurrencyEnumeration DJF = new CurrencyEnumeration("DJF");
// <xs:enumeration value="DKK"/> // <xs:enumeration value="DKK"/>
public static final CurrencyEnumeration DKK = new CurrencyEnumeration("DKK"); public static final CurrencyEnumeration DKK = new CurrencyEnumeration("DKK");
// <xs:enumeration value="DOP"/> // <xs:enumeration value="DOP"/>
public static final CurrencyEnumeration DOP = new CurrencyEnumeration("DOP"); public static final CurrencyEnumeration DOP = new CurrencyEnumeration("DOP");
// <xs:enumeration value="DZD"/> // <xs:enumeration value="DZD"/>
public static final CurrencyEnumeration DZD = new CurrencyEnumeration("DZD"); public static final CurrencyEnumeration DZD = new CurrencyEnumeration("DZD");
// <xs:enumeration value="EEK"/> // <xs:enumeration value="EEK"/>
public static final CurrencyEnumeration EEK = new CurrencyEnumeration("EEK"); public static final CurrencyEnumeration EEK = new CurrencyEnumeration("EEK");
// <xs:enumeration value="EGP"/> // <xs:enumeration value="EGP"/>
public static final CurrencyEnumeration EGP = new CurrencyEnumeration("EGP"); public static final CurrencyEnumeration EGP = new CurrencyEnumeration("EGP");
// <xs:enumeration value="ERN"/> // <xs:enumeration value="ERN"/>
public static final CurrencyEnumeration ERN = new CurrencyEnumeration("ERN"); public static final CurrencyEnumeration ERN = new CurrencyEnumeration("ERN");
// <xs:enumeration value="ETB"/> // <xs:enumeration value="ETB"/>
public static final CurrencyEnumeration ETB = new CurrencyEnumeration("ETB"); public static final CurrencyEnumeration ETB = new CurrencyEnumeration("ETB");
// <xs:enumeration value="EUR"/> // <xs:enumeration value="EUR"/>
public static final CurrencyEnumeration EUR = new CurrencyEnumeration("EUR"); public static final CurrencyEnumeration EUR = new CurrencyEnumeration("EUR");
// <xs:enumeration value="FJD"/> // <xs:enumeration value="FJD"/>
public static final CurrencyEnumeration FJD = new CurrencyEnumeration("FJD"); public static final CurrencyEnumeration FJD = new CurrencyEnumeration("FJD");
// <xs:enumeration value="FKP"/> // <xs:enumeration value="FKP"/>
public static final CurrencyEnumeration FKP = new CurrencyEnumeration("FKP"); public static final CurrencyEnumeration FKP = new CurrencyEnumeration("FKP");
// <xs:enumeration value="GBP"/> // <xs:enumeration value="GBP"/>
public static final CurrencyEnumeration GBP = new CurrencyEnumeration("GBP"); public static final CurrencyEnumeration GBP = new CurrencyEnumeration("GBP");
// <xs:enumeration value="GEL"/> // <xs:enumeration value="GEL"/>
public static final CurrencyEnumeration GEL = new CurrencyEnumeration("GEL"); public static final CurrencyEnumeration GEL = new CurrencyEnumeration("GEL");
// <xs:enumeration value="GGP"/> // <xs:enumeration value="GGP"/>
public static final CurrencyEnumeration GGP = new CurrencyEnumeration("GGP"); public static final CurrencyEnumeration GGP = new CurrencyEnumeration("GGP");
// <xs:enumeration value="GHC"/> // <xs:enumeration value="GHC"/>
public static final CurrencyEnumeration GHC = new CurrencyEnumeration("GHC"); public static final CurrencyEnumeration GHC = new CurrencyEnumeration("GHC");
// <xs:enumeration value="GIP"/> // <xs:enumeration value="GIP"/>
public static final CurrencyEnumeration GIP = new CurrencyEnumeration("GIP"); public static final CurrencyEnumeration GIP = new CurrencyEnumeration("GIP");
// <xs:enumeration value="GMD"/> // <xs:enumeration value="GMD"/>
public static final CurrencyEnumeration GMD = new CurrencyEnumeration("GMD"); public static final CurrencyEnumeration GMD = new CurrencyEnumeration("GMD");
// <xs:enumeration value="GNF"/> // <xs:enumeration value="GNF"/>
public static final CurrencyEnumeration GNF = new CurrencyEnumeration("GNF"); public static final CurrencyEnumeration GNF = new CurrencyEnumeration("GNF");
// <xs:enumeration value="GTQ"/> // <xs:enumeration value="GTQ"/>
public static final CurrencyEnumeration GTQ = new CurrencyEnumeration("GTQ"); public static final CurrencyEnumeration GTQ = new CurrencyEnumeration("GTQ");
// <xs:enumeration value="GYD"/> // <xs:enumeration value="GYD"/>
public static final CurrencyEnumeration GYD = new CurrencyEnumeration("GYD"); public static final CurrencyEnumeration GYD = new CurrencyEnumeration("GYD");
// <xs:enumeration value="HKD"/> // <xs:enumeration value="HKD"/>
public static final CurrencyEnumeration HKD = new CurrencyEnumeration("HKD"); public static final CurrencyEnumeration HKD = new CurrencyEnumeration("HKD");
// <xs:enumeration value="HNL"/> // <xs:enumeration value="HNL"/>
public static final CurrencyEnumeration HNL = new CurrencyEnumeration("HNL"); public static final CurrencyEnumeration HNL = new CurrencyEnumeration("HNL");
// <xs:enumeration value="HRK"/> // <xs:enumeration value="HRK"/>
public static final CurrencyEnumeration HRK = new CurrencyEnumeration("HRK"); public static final CurrencyEnumeration HRK = new CurrencyEnumeration("HRK");
// <xs:enumeration value="HTG"/> // <xs:enumeration value="HTG"/>
public static final CurrencyEnumeration HTG = new CurrencyEnumeration("HTG"); public static final CurrencyEnumeration HTG = new CurrencyEnumeration("HTG");
// <xs:enumeration value="HUF"/> // <xs:enumeration value="HUF"/>
public static final CurrencyEnumeration HUF = new CurrencyEnumeration("HUF"); public static final CurrencyEnumeration HUF = new CurrencyEnumeration("HUF");
// <xs:enumeration value="IDR"/> // <xs:enumeration value="IDR"/>
public static final CurrencyEnumeration IDR = new CurrencyEnumeration("IDR"); public static final CurrencyEnumeration IDR = new CurrencyEnumeration("IDR");
// <xs:enumeration value="ILS"/> // <xs:enumeration value="ILS"/>
public static final CurrencyEnumeration ILS = new CurrencyEnumeration("ILS"); public static final CurrencyEnumeration ILS = new CurrencyEnumeration("ILS");
// <xs:enumeration value="IMP"/> // <xs:enumeration value="IMP"/>
public static final CurrencyEnumeration IMP = new CurrencyEnumeration("IMP"); public static final CurrencyEnumeration IMP = new CurrencyEnumeration("IMP");
// <xs:enumeration value="INR"/> // <xs:enumeration value="INR"/>
public static final CurrencyEnumeration INR = new CurrencyEnumeration("INR"); public static final CurrencyEnumeration INR = new CurrencyEnumeration("INR");
// <xs:enumeration value="IQD"/> // <xs:enumeration value="IQD"/>
public static final CurrencyEnumeration IQD = new CurrencyEnumeration("IQD"); public static final CurrencyEnumeration IQD = new CurrencyEnumeration("IQD");
// <xs:enumeration value="IRR"/> // <xs:enumeration value="IRR"/>
public static final CurrencyEnumeration IRR = new CurrencyEnumeration("IRR"); public static final CurrencyEnumeration IRR = new CurrencyEnumeration("IRR");
// <xs:enumeration value="ISK"/> // <xs:enumeration value="ISK"/>
public static final CurrencyEnumeration ISK = new CurrencyEnumeration("ISK"); public static final CurrencyEnumeration ISK = new CurrencyEnumeration("ISK");
// <xs:enumeration value="JEP"/> // <xs:enumeration value="JEP"/>
public static final CurrencyEnumeration JEP = new CurrencyEnumeration("JEP"); public static final CurrencyEnumeration JEP = new CurrencyEnumeration("JEP");
// <xs:enumeration value="JMD"/> // <xs:enumeration value="JMD"/>
public static final CurrencyEnumeration JMD = new CurrencyEnumeration("JMD"); public static final CurrencyEnumeration JMD = new CurrencyEnumeration("JMD");
// <xs:enumeration value="JOD"/> // <xs:enumeration value="JOD"/>
public static final CurrencyEnumeration JOD = new CurrencyEnumeration("JOD"); public static final CurrencyEnumeration JOD = new CurrencyEnumeration("JOD");
// <xs:enumeration value="JPY"/> // <xs:enumeration value="JPY"/>
public static final CurrencyEnumeration JPY = new CurrencyEnumeration("JPY"); public static final CurrencyEnumeration JPY = new CurrencyEnumeration("JPY");
// <xs:enumeration value="KES"/> // <xs:enumeration value="KES"/>
public static final CurrencyEnumeration KES = new CurrencyEnumeration("KES"); public static final CurrencyEnumeration KES = new CurrencyEnumeration("KES");
// <xs:enumeration value="KGS"/> // <xs:enumeration value="KGS"/>
public static final CurrencyEnumeration KGS = new CurrencyEnumeration("KGS"); public static final CurrencyEnumeration KGS = new CurrencyEnumeration("KGS");
// <xs:enumeration value="KHR"/> // <xs:enumeration value="KHR"/>
public static final CurrencyEnumeration KHR = new CurrencyEnumeration("KHR"); public static final CurrencyEnumeration KHR = new CurrencyEnumeration("KHR");
// <xs:enumeration value="KMF"/> // <xs:enumeration value="KMF"/>
public static final CurrencyEnumeration KMF = new CurrencyEnumeration("KMF"); public static final CurrencyEnumeration KMF = new CurrencyEnumeration("KMF");
// <xs:enumeration value="KPW"/> // <xs:enumeration value="KPW"/>
public static final CurrencyEnumeration KPW = new CurrencyEnumeration("KPW"); public static final CurrencyEnumeration KPW = new CurrencyEnumeration("KPW");
// <xs:enumeration value="KRW"/> // <xs:enumeration value="KRW"/>
public static final CurrencyEnumeration KRW = new CurrencyEnumeration("KRW"); public static final CurrencyEnumeration KRW = new CurrencyEnumeration("KRW");
// <xs:enumeration value="KWD"/> // <xs:enumeration value="KWD"/>
public static final CurrencyEnumeration KWD = new CurrencyEnumeration("KWD"); public static final CurrencyEnumeration KWD = new CurrencyEnumeration("KWD");
// <xs:enumeration value="KYD"/> // <xs:enumeration value="KYD"/>
public static final CurrencyEnumeration KYD = new CurrencyEnumeration("KYD"); public static final CurrencyEnumeration KYD = new CurrencyEnumeration("KYD");
// <xs:enumeration value="KZT"/> // <xs:enumeration value="KZT"/>
public static final CurrencyEnumeration KZT = new CurrencyEnumeration("KZT"); public static final CurrencyEnumeration KZT = new CurrencyEnumeration("KZT");
// <xs:enumeration value="LAK"/> // <xs:enumeration value="LAK"/>
public static final CurrencyEnumeration LAK = new CurrencyEnumeration("LAK"); public static final CurrencyEnumeration LAK = new CurrencyEnumeration("LAK");
// <xs:enumeration value="LBP"/> // <xs:enumeration value="LBP"/>
public static final CurrencyEnumeration LBP = new CurrencyEnumeration("LBP"); public static final CurrencyEnumeration LBP = new CurrencyEnumeration("LBP");
// <xs:enumeration value="LKR"/> // <xs:enumeration value="LKR"/>
public static final CurrencyEnumeration LKR = new CurrencyEnumeration("LKR"); public static final CurrencyEnumeration LKR = new CurrencyEnumeration("LKR");
// <xs:enumeration value="LRD"/> // <xs:enumeration value="LRD"/>
public static final CurrencyEnumeration LRD = new CurrencyEnumeration("LRD"); public static final CurrencyEnumeration LRD = new CurrencyEnumeration("LRD");
// <xs:enumeration value="LSL"/> // <xs:enumeration value="LSL"/>
public static final CurrencyEnumeration LSL = new CurrencyEnumeration("LSL"); public static final CurrencyEnumeration LSL = new CurrencyEnumeration("LSL");
// <xs:enumeration value="LTL"/> // <xs:enumeration value="LTL"/>
public static final CurrencyEnumeration LTL = new CurrencyEnumeration("LTL"); public static final CurrencyEnumeration LTL = new CurrencyEnumeration("LTL");
// <xs:enumeration value="LVL"/> // <xs:enumeration value="LVL"/>
public static final CurrencyEnumeration LVL = new CurrencyEnumeration("LVL"); public static final CurrencyEnumeration LVL = new CurrencyEnumeration("LVL");
// <xs:enumeration value="LYD"/> // <xs:enumeration value="LYD"/>
public static final CurrencyEnumeration LYD = new CurrencyEnumeration("LYD"); public static final CurrencyEnumeration LYD = new CurrencyEnumeration("LYD");
// <xs:enumeration value="MAD"/> // <xs:enumeration value="MAD"/>
public static final CurrencyEnumeration MAD = new CurrencyEnumeration("MAD"); public static final CurrencyEnumeration MAD = new CurrencyEnumeration("MAD");
// <xs:enumeration value="MDL"/> // <xs:enumeration value="MDL"/>
public static final CurrencyEnumeration MDL = new CurrencyEnumeration("MDL"); public static final CurrencyEnumeration MDL = new CurrencyEnumeration("MDL");
// <xs:enumeration value="MGA"/> // <xs:enumeration value="MGA"/>
public static final CurrencyEnumeration MGA = new CurrencyEnumeration("MGA"); public static final CurrencyEnumeration MGA = new CurrencyEnumeration("MGA");
// <xs:enumeration value="MKD"/> // <xs:enumeration value="MKD"/>
public static final CurrencyEnumeration MKD = new CurrencyEnumeration("MKD"); public static final CurrencyEnumeration MKD = new CurrencyEnumeration("MKD");
// <xs:enumeration value="MMK"/> // <xs:enumeration value="MMK"/>
public static final CurrencyEnumeration MMK = new CurrencyEnumeration("MMK"); public static final CurrencyEnumeration MMK = new CurrencyEnumeration("MMK");
// <xs:enumeration value="MNT"/> // <xs:enumeration value="MNT"/>
public static final CurrencyEnumeration MNT = new CurrencyEnumeration("MNT"); public static final CurrencyEnumeration MNT = new CurrencyEnumeration("MNT");
// <xs:enumeration value="MOP"/> // <xs:enumeration value="MOP"/>
public static final CurrencyEnumeration MOP = new CurrencyEnumeration("MOP"); public static final CurrencyEnumeration MOP = new CurrencyEnumeration("MOP");
// <xs:enumeration value="MRO"/> // <xs:enumeration value="MRO"/>
public static final CurrencyEnumeration MRO = new CurrencyEnumeration("MRO"); public static final CurrencyEnumeration MRO = new CurrencyEnumeration("MRO");
// <xs:enumeration value="MTL"/> // <xs:enumeration value="MTL"/>
public static final CurrencyEnumeration MTL = new CurrencyEnumeration("MTL"); public static final CurrencyEnumeration MTL = new CurrencyEnumeration("MTL");
// <xs:enumeration value="MUR"/> // <xs:enumeration value="MUR"/>
public static final CurrencyEnumeration MUR = new CurrencyEnumeration("MUR"); public static final CurrencyEnumeration MUR = new CurrencyEnumeration("MUR");
// <xs:enumeration value="MVR"/> // <xs:enumeration value="MVR"/>
public static final CurrencyEnumeration MVR = new CurrencyEnumeration("MVR"); public static final CurrencyEnumeration MVR = new CurrencyEnumeration("MVR");
// <xs:enumeration value="MWK"/> // <xs:enumeration value="MWK"/>
public static final CurrencyEnumeration MWK = new CurrencyEnumeration("MWK"); public static final CurrencyEnumeration MWK = new CurrencyEnumeration("MWK");
// <xs:enumeration value="MXN"/> // <xs:enumeration value="MXN"/>
public static final CurrencyEnumeration MXN = new CurrencyEnumeration("MXN"); public static final CurrencyEnumeration MXN = new CurrencyEnumeration("MXN");
// <xs:enumeration value="MYR"/> // <xs:enumeration value="MYR"/>
public static final CurrencyEnumeration MYR = new CurrencyEnumeration("MYR"); public static final CurrencyEnumeration MYR = new CurrencyEnumeration("MYR");
// <xs:enumeration value="MZM"/> // <xs:enumeration value="MZM"/>
public static final CurrencyEnumeration MZM = new CurrencyEnumeration("MZM"); public static final CurrencyEnumeration MZM = new CurrencyEnumeration("MZM");
// <xs:enumeration value="NAD"/> // <xs:enumeration value="NAD"/>
public static final CurrencyEnumeration NAD = new CurrencyEnumeration("NAD"); public static final CurrencyEnumeration NAD = new CurrencyEnumeration("NAD");
// <xs:enumeration value="NGN"/> // <xs:enumeration value="NGN"/>
public static final CurrencyEnumeration NGN = new CurrencyEnumeration("NGN"); public static final CurrencyEnumeration NGN = new CurrencyEnumeration("NGN");
// <xs:enumeration value="NIO"/> // <xs:enumeration value="NIO"/>
public static final CurrencyEnumeration NIO = new CurrencyEnumeration("NIO"); public static final CurrencyEnumeration NIO = new CurrencyEnumeration("NIO");
// <xs:enumeration value="NOK"/> // <xs:enumeration value="NOK"/>
public static final CurrencyEnumeration NOK = new CurrencyEnumeration("NOK"); public static final CurrencyEnumeration NOK = new CurrencyEnumeration("NOK");
// <xs:enumeration value="NPR"/> // <xs:enumeration value="NPR"/>
public static final CurrencyEnumeration NPR = new CurrencyEnumeration("NPR"); public static final CurrencyEnumeration NPR = new CurrencyEnumeration("NPR");
// <xs:enumeration value="NZD"/> // <xs:enumeration value="NZD"/>
public static final CurrencyEnumeration NZD = new CurrencyEnumeration("NZD"); public static final CurrencyEnumeration NZD = new CurrencyEnumeration("NZD");
// <xs:enumeration value="OMR"/> // <xs:enumeration value="OMR"/>
public static final CurrencyEnumeration OMR = new CurrencyEnumeration("OMR"); public static final CurrencyEnumeration OMR = new CurrencyEnumeration("OMR");
// <xs:enumeration value="PAB"/> // <xs:enumeration value="PAB"/>
public static final CurrencyEnumeration PAB = new CurrencyEnumeration("PAB"); public static final CurrencyEnumeration PAB = new CurrencyEnumeration("PAB");
// <xs:enumeration value="PEN"/> // <xs:enumeration value="PEN"/>
public static final CurrencyEnumeration PEN = new CurrencyEnumeration("PEN"); public static final CurrencyEnumeration PEN = new CurrencyEnumeration("PEN");
// <xs:enumeration value="PGK"/> // <xs:enumeration value="PGK"/>
public static final CurrencyEnumeration PGK = new CurrencyEnumeration("PGK"); public static final CurrencyEnumeration PGK = new CurrencyEnumeration("PGK");
// <xs:enumeration value="PHP"/> // <xs:enumeration value="PHP"/>
public static final CurrencyEnumeration PHP = new CurrencyEnumeration("PHP"); public static final CurrencyEnumeration PHP = new CurrencyEnumeration("PHP");
// <xs:enumeration value="PKR"/> // <xs:enumeration value="PKR"/>
public static final CurrencyEnumeration PKR = new CurrencyEnumeration("PKR"); public static final CurrencyEnumeration PKR = new CurrencyEnumeration("PKR");
// <xs:enumeration value="PLN"/> // <xs:enumeration value="PLN"/>
public static final CurrencyEnumeration PLN = new CurrencyEnumeration("PLN"); public static final CurrencyEnumeration PLN = new CurrencyEnumeration("PLN");
// <xs:enumeration value="PYG"/> // <xs:enumeration value="PYG"/>
public static final CurrencyEnumeration PYG = new CurrencyEnumeration("PYG"); public static final CurrencyEnumeration PYG = new CurrencyEnumeration("PYG");
// <xs:enumeration value="QAR"/> // <xs:enumeration value="QAR"/>
public static final CurrencyEnumeration QAR = new CurrencyEnumeration("QAR"); public static final CurrencyEnumeration QAR = new CurrencyEnumeration("QAR");
// <xs:enumeration value="RON"/> // <xs:enumeration value="RON"/>
public static final CurrencyEnumeration RON = new CurrencyEnumeration("RON"); public static final CurrencyEnumeration RON = new CurrencyEnumeration("RON");
// <xs:enumeration value="RUB"/> // <xs:enumeration value="RUB"/>
public static final CurrencyEnumeration RUB = new CurrencyEnumeration("RUB"); public static final CurrencyEnumeration RUB = new CurrencyEnumeration("RUB");
// <xs:enumeration value="RWF"/> // <xs:enumeration value="RWF"/>
public static final CurrencyEnumeration RWF = new CurrencyEnumeration("MOP"); public static final CurrencyEnumeration RWF = new CurrencyEnumeration("MOP");
// <xs:enumeration value="SAR"/> // <xs:enumeration value="SAR"/>
public static final CurrencyEnumeration SAR = new CurrencyEnumeration("SAR"); public static final CurrencyEnumeration SAR = new CurrencyEnumeration("SAR");
// <xs:enumeration value="SBD"/> // <xs:enumeration value="SBD"/>
public static final CurrencyEnumeration SBD = new CurrencyEnumeration("SBD"); public static final CurrencyEnumeration SBD = new CurrencyEnumeration("SBD");
// <xs:enumeration value="SCR"/> // <xs:enumeration value="SCR"/>
public static final CurrencyEnumeration SCR = new CurrencyEnumeration("SCR"); public static final CurrencyEnumeration SCR = new CurrencyEnumeration("SCR");
// <xs:enumeration value="SDD"/> // <xs:enumeration value="SDD"/>
public static final CurrencyEnumeration SDD = new CurrencyEnumeration("SDD"); public static final CurrencyEnumeration SDD = new CurrencyEnumeration("SDD");
// <xs:enumeration value="SEK"/> // <xs:enumeration value="SEK"/>
public static final CurrencyEnumeration SEK = new CurrencyEnumeration("SEK"); public static final CurrencyEnumeration SEK = new CurrencyEnumeration("SEK");
// <xs:enumeration value="SGD"/> // <xs:enumeration value="SGD"/>
public static final CurrencyEnumeration SGD = new CurrencyEnumeration("SGD"); public static final CurrencyEnumeration SGD = new CurrencyEnumeration("SGD");
// <xs:enumeration value="SHP"/> // <xs:enumeration value="SHP"/>
public static final CurrencyEnumeration SHP = new CurrencyEnumeration("SHP"); public static final CurrencyEnumeration SHP = new CurrencyEnumeration("SHP");
// <xs:enumeration value="SIT"/> // <xs:enumeration value="SIT"/>
public static final CurrencyEnumeration SIT = new CurrencyEnumeration("SIT"); public static final CurrencyEnumeration SIT = new CurrencyEnumeration("SIT");
// <xs:enumeration value="SKK"/> // <xs:enumeration value="SKK"/>
public static final CurrencyEnumeration SKK = new CurrencyEnumeration("SKK"); public static final CurrencyEnumeration SKK = new CurrencyEnumeration("SKK");
// <xs:enumeration value="SLL"/> // <xs:enumeration value="SLL"/>
public static final CurrencyEnumeration SLL = new CurrencyEnumeration("SLL"); public static final CurrencyEnumeration SLL = new CurrencyEnumeration("SLL");
// <xs:enumeration value="SOS"/> // <xs:enumeration value="SOS"/>
public static final CurrencyEnumeration SOS = new CurrencyEnumeration("SOS"); public static final CurrencyEnumeration SOS = new CurrencyEnumeration("SOS");
// <xs:enumeration value="SPL"/> // <xs:enumeration value="SPL"/>
public static final CurrencyEnumeration SPL = new CurrencyEnumeration("SPL"); public static final CurrencyEnumeration SPL = new CurrencyEnumeration("SPL");
// <xs:enumeration value="SRD"/> // <xs:enumeration value="SRD"/>
public static final CurrencyEnumeration SRD = new CurrencyEnumeration("SRD"); public static final CurrencyEnumeration SRD = new CurrencyEnumeration("SRD");
// <xs:enumeration value="STD"/> // <xs:enumeration value="STD"/>
public static final CurrencyEnumeration STD = new CurrencyEnumeration("STD"); public static final CurrencyEnumeration STD = new CurrencyEnumeration("STD");
// <xs:enumeration value="SVC"/> // <xs:enumeration value="SVC"/>
public static final CurrencyEnumeration SVC = new CurrencyEnumeration("SVC"); public static final CurrencyEnumeration SVC = new CurrencyEnumeration("SVC");
// <xs:enumeration value="SYP"/> // <xs:enumeration value="SYP"/>
public static final CurrencyEnumeration SYP = new CurrencyEnumeration("SYP"); public static final CurrencyEnumeration SYP = new CurrencyEnumeration("SYP");
// <xs:enumeration value="SZL"/> // <xs:enumeration value="SZL"/>
public static final CurrencyEnumeration SZL = new CurrencyEnumeration("SZL"); public static final CurrencyEnumeration SZL = new CurrencyEnumeration("SZL");
// <xs:enumeration value="THB"/> // <xs:enumeration value="THB"/>
public static final CurrencyEnumeration THB = new CurrencyEnumeration("THB"); public static final CurrencyEnumeration THB = new CurrencyEnumeration("THB");
// <xs:enumeration value="TJS"/> // <xs:enumeration value="TJS"/>
public static final CurrencyEnumeration TJS = new CurrencyEnumeration("TJS"); public static final CurrencyEnumeration TJS = new CurrencyEnumeration("TJS");
// <xs:enumeration value="TMM"/> // <xs:enumeration value="TMM"/>
public static final CurrencyEnumeration TMM = new CurrencyEnumeration("TMM"); public static final CurrencyEnumeration TMM = new CurrencyEnumeration("TMM");
// <xs:enumeration value="TND"/> // <xs:enumeration value="TND"/>
public static final CurrencyEnumeration TND = new CurrencyEnumeration("TND"); public static final CurrencyEnumeration TND = new CurrencyEnumeration("TND");
// <xs:enumeration value="TOP"/> // <xs:enumeration value="TOP"/>
public static final CurrencyEnumeration TOP = new CurrencyEnumeration("TOP"); public static final CurrencyEnumeration TOP = new CurrencyEnumeration("TOP");
// <xs:enumeration value="TRL"/> // <xs:enumeration value="TRL"/>
public static final CurrencyEnumeration TRL = new CurrencyEnumeration("TRL"); public static final CurrencyEnumeration TRL = new CurrencyEnumeration("TRL");
// <xs:enumeration value="TRY"/> // <xs:enumeration value="TRY"/>
public static final CurrencyEnumeration TRY = new CurrencyEnumeration("TRY"); public static final CurrencyEnumeration TRY = new CurrencyEnumeration("TRY");
// <xs:enumeration value="TTD"/> // <xs:enumeration value="TTD"/>
public static final CurrencyEnumeration TTD = new CurrencyEnumeration("TTD"); public static final CurrencyEnumeration TTD = new CurrencyEnumeration("TTD");
// <xs:enumeration value="TVD"/> // <xs:enumeration value="TVD"/>
public static final CurrencyEnumeration TVD = new CurrencyEnumeration("TVD"); public static final CurrencyEnumeration TVD = new CurrencyEnumeration("TVD");
// <xs:enumeration value="TWD"/> // <xs:enumeration value="TWD"/>
public static final CurrencyEnumeration TWD = new CurrencyEnumeration("TWD"); public static final CurrencyEnumeration TWD = new CurrencyEnumeration("TWD");
// <xs:enumeration value="TZS"/> // <xs:enumeration value="TZS"/>
public static final CurrencyEnumeration TZS = new CurrencyEnumeration("TZS"); public static final CurrencyEnumeration TZS = new CurrencyEnumeration("TZS");
// <xs:enumeration value="UAH"/> // <xs:enumeration value="UAH"/>
public static final CurrencyEnumeration UAH = new CurrencyEnumeration("UAH"); public static final CurrencyEnumeration UAH = new CurrencyEnumeration("UAH");
// <xs:enumeration value="UGX"/> // <xs:enumeration value="UGX"/>
public static final CurrencyEnumeration UGX = new CurrencyEnumeration("UGX"); public static final CurrencyEnumeration UGX = new CurrencyEnumeration("UGX");
// <xs:enumeration value="USD"/> // <xs:enumeration value="USD"/>
public static final CurrencyEnumeration USD = new CurrencyEnumeration("USD"); public static final CurrencyEnumeration USD = new CurrencyEnumeration("USD");
// <xs:enumeration value="UYU"/> // <xs:enumeration value="UYU"/>
public static final CurrencyEnumeration UYU = new CurrencyEnumeration("UYU"); public static final CurrencyEnumeration UYU = new CurrencyEnumeration("UYU");
// <xs:enumeration value="UZS"/> // <xs:enumeration value="UZS"/>
public static final CurrencyEnumeration UZS = new CurrencyEnumeration("UZS"); public static final CurrencyEnumeration UZS = new CurrencyEnumeration("UZS");
// <xs:enumeration value="VEB"/> // <xs:enumeration value="VEB"/>
public static final CurrencyEnumeration VEB = new CurrencyEnumeration("VEB"); public static final CurrencyEnumeration VEB = new CurrencyEnumeration("VEB");
// <xs:enumeration value="VND"/> // <xs:enumeration value="VND"/>
public static final CurrencyEnumeration VND = new CurrencyEnumeration("VND"); public static final CurrencyEnumeration VND = new CurrencyEnumeration("VND");
// <xs:enumeration value="VUV"/> // <xs:enumeration value="VUV"/>
public static final CurrencyEnumeration VUV = new CurrencyEnumeration("VUV"); public static final CurrencyEnumeration VUV = new CurrencyEnumeration("VUV");
// <xs:enumeration value="WST"/> // <xs:enumeration value="WST"/>
public static final CurrencyEnumeration WST = new CurrencyEnumeration("WST"); public static final CurrencyEnumeration WST = new CurrencyEnumeration("WST");
// <xs:enumeration value="XAF"/> // <xs:enumeration value="XAF"/>
public static final CurrencyEnumeration XAF = new CurrencyEnumeration("XAF"); public static final CurrencyEnumeration XAF = new CurrencyEnumeration("XAF");
// <xs:enumeration value="XAG"/> // <xs:enumeration value="XAG"/>
public static final CurrencyEnumeration XAG = new CurrencyEnumeration("XAG"); public static final CurrencyEnumeration XAG = new CurrencyEnumeration("XAG");
// <xs:enumeration value="XAU"/> // <xs:enumeration value="XAU"/>
public static final CurrencyEnumeration XAU = new CurrencyEnumeration("XAU"); public static final CurrencyEnumeration XAU = new CurrencyEnumeration("XAU");
// <xs:enumeration value="XCD"/> // <xs:enumeration value="XCD"/>
public static final CurrencyEnumeration XCD = new CurrencyEnumeration("XCD"); public static final CurrencyEnumeration XCD = new CurrencyEnumeration("XCD");
// <xs:enumeration value="XDR"/> // <xs:enumeration value="XDR"/>
public static final CurrencyEnumeration XDR = new CurrencyEnumeration("XDR"); public static final CurrencyEnumeration XDR = new CurrencyEnumeration("XDR");
// <xs:enumeration value="XOF"/> // <xs:enumeration value="XOF"/>
public static final CurrencyEnumeration XOF = new CurrencyEnumeration("XOF"); public static final CurrencyEnumeration XOF = new CurrencyEnumeration("XOF");
// <xs:enumeration value="XPD"/> // <xs:enumeration value="XPD"/>
public static final CurrencyEnumeration XPD = new CurrencyEnumeration("XPD"); public static final CurrencyEnumeration XPD = new CurrencyEnumeration("XPD");
// <xs:enumeration value="XPF"/> // <xs:enumeration value="XPF"/>
public static final CurrencyEnumeration XPF = new CurrencyEnumeration("XPF"); public static final CurrencyEnumeration XPF = new CurrencyEnumeration("XPF");
// <xs:enumeration value="XPT"/> // <xs:enumeration value="XPT"/>
public static final CurrencyEnumeration XPT = new CurrencyEnumeration("XPT"); public static final CurrencyEnumeration XPT = new CurrencyEnumeration("XPT");
// <xs:enumeration value="YER"/> // <xs:enumeration value="YER"/>
public static final CurrencyEnumeration YER = new CurrencyEnumeration("YER"); public static final CurrencyEnumeration YER = new CurrencyEnumeration("YER");
// <xs:enumeration value="ZAR"/> // <xs:enumeration value="ZAR"/>
public static final CurrencyEnumeration ZAR = new CurrencyEnumeration("ZAR"); public static final CurrencyEnumeration ZAR = new CurrencyEnumeration("ZAR");
// <xs:enumeration value="ZMK"/> // <xs:enumeration value="ZMK"/>
public static final CurrencyEnumeration ZMK = new CurrencyEnumeration("ZMK"); public static final CurrencyEnumeration ZMK = new CurrencyEnumeration("ZMK");
// <xs:enumeration value="ZWD"/> // <xs:enumeration value="ZWD"/>
public static final CurrencyEnumeration ZWD = new CurrencyEnumeration("ZWD"); public static final CurrencyEnumeration ZWD = new CurrencyEnumeration("ZWD");
//</xs:restriction> // </xs:restriction>
private String value; private final String value;
/** /**
* Creates a new instance of CurrencyEnumeration * Creates a new instance of CurrencyEnumeration
* *
* @param value DOCUMENT ME! * @param value DOCUMENT ME!
*/ */
private CurrencyEnumeration(String value) { private CurrencyEnumeration(final String value) {
this.value = value; this.value = value;
lookup.put(value,this); lookup.put(value, this);
} }
public String getValue() { public String getValue() {
return this.value; return value;
} }
@Override
public Object clone() { public Object clone() {
return this; return this;
} }
public static CurrencyEnumeration findByValue(String value) { public static CurrencyEnumeration findByValue(final String value) {
return (CurrencyEnumeration)lookup.get(value.trim().toUpperCase()); return (CurrencyEnumeration) lookup.get(value.trim().toUpperCase());
} }
@Override
public String toString() { public String toString() {
return value; return value;
} }

View file

@ -41,9 +41,9 @@ package org.rometools.feed.module.base.types;
import java.util.Date; import java.util.Date;
/**
/** Represents a time range. * Represents a time range.
* *
* @author <a href="mailto:cooper@screaming-penguin.com">Robert "kebernet" Cooper</a> * @author <a href="mailto:cooper@screaming-penguin.com">Robert "kebernet" Cooper</a>
* @version $Revision: 1.2 $ * @version $Revision: 1.2 $
*/ */
@ -59,26 +59,27 @@ public class DateTimeRange implements CloneableType {
/** /**
* Creates a new instance of DateTimeRange * Creates a new instance of DateTimeRange
*
* @param start Beginning of the timeframe. * @param start Beginning of the timeframe.
* @param end End of the Timeframe. * @param end End of the Timeframe.
*/ */
public DateTimeRange(Date start, Date end) { public DateTimeRange(final Date start, final Date end) {
this.start= start; this.start = start;
this.end = end ; this.end = end;
} }
/** /**
* The end of the timeframe. * The end of the timeframe.
*
* @return The end of the timeframe. * @return The end of the timeframe.
*/ */
public Date getEnd() { public Date getEnd() {
return end; return end;
} }
/** /**
* The beginning of the timeframe. * The beginning of the timeframe.
*
* @return The beginning of the timeframe. * @return The beginning of the timeframe.
*/ */
public Date getStart() { public Date getStart() {
@ -87,17 +88,19 @@ public class DateTimeRange implements CloneableType {
/** /**
* Clones the object * Clones the object
*
* @return Duplicate of this object. * @return Duplicate of this object.
*/ */
@Override
public Object clone() { public Object clone() {
DateTimeRange retValue = new DateTimeRange(null, null); final DateTimeRange retValue = new DateTimeRange(null, null);
if (this.getStart() != null) { if (getStart() != null) {
retValue.start = ((Date) this.getStart().clone()); retValue.start = (Date) getStart().clone();
} }
if (this.getEnd() != null) { if (getEnd() != null) {
retValue.end = ((Date) this.getEnd().clone()); retValue.end = (Date) getEnd().clone();
} }
return retValue; return retValue;
@ -105,23 +108,29 @@ public class DateTimeRange implements CloneableType {
/** /**
* String representation of the object. * String representation of the object.
*
* @return String representation of the object. * @return String representation of the object.
*/ */
@Override
public String toString() { public String toString() {
return "Start: " + this.start + " End: " + this.end; return "Start: " + start + " End: " + end;
} }
public boolean equals( Object o ){ @Override
if( !(o instanceof DateTimeRange ) || o == null ) public boolean equals(final Object o) {
return false; if (!(o instanceof DateTimeRange) || o == null) {
DateTimeRange d = (DateTimeRange) o; return false;
if( this.start == d.getStart() && this.end == d.getEnd() ){ }
return true; final DateTimeRange d = (DateTimeRange) o;
} if (start == d.getStart() && end == d.getEnd()) {
if( this.start != null && !this.start.equals( d.getStart()) ) return true;
return false; }
if( this.end != null && !this.end.equals( d.getEnd()) ) if (start != null && !start.equals(d.getStart())) {
return false; return false;
return true; }
if (end != null && !end.equals(d.getEnd())) {
return false;
}
return true;
} }
} }

View file

@ -41,10 +41,9 @@ package org.rometools.feed.module.base.types;
import org.rometools.feed.module.base.io.GoogleBaseParser; import org.rometools.feed.module.base.io.GoogleBaseParser;
/**
/** This class represents a quantity consisting of a float value and an optional * This class represents a quantity consisting of a float value and an optional units specification.
* units specification. *
*
* @author <a href="mailto:cooper@screaming-penguin.com">Robert "kebernet" Cooper</a> * @author <a href="mailto:cooper@screaming-penguin.com">Robert "kebernet" Cooper</a>
* @version $Revision: 1.1 $ * @version $Revision: 1.1 $
*/ */
@ -56,31 +55,34 @@ public class FloatUnit implements CloneableType {
/** /**
* Float value * Float value
*/ */
private float value; private final float value;
/** /**
* Looks for a char in an array * Looks for a char in an array
*
* @param find char to search for * @param find char to search for
* @param array array to search * @param array array to search
* @return boolean indicating presence. * @return boolean indicating presence.
*/ */
private boolean inCharArray( char find, char[] array ){ private boolean inCharArray(final char find, final char[] array) {
for( int i=0; i < array.length; i++ ){ for (final char element : array) {
if( find == array[i]) if (find == element) {
return true; return true;
}
} }
return false; return false;
} }
/** /**
* Creates a new float unit by parsing a String value * Creates a new float unit by parsing a String value
*
* @param source String value to parse * @param source String value to parse
*/ */
public FloatUnit(String source) { public FloatUnit(final String source) {
String parse = source.trim(); final String parse = source.trim();
int space = -1; int space = -1;
for( int i=0; i < parse.length(); i++ ){ for (int i = 0; i < parse.length(); i++) {
if( !inCharArray( parse.charAt(i), GoogleBaseParser.FLOAT_CHARS ) ){ if (!inCharArray(parse.charAt(i), GoogleBaseParser.FLOAT_CHARS)) {
space = i; space = i;
break; break;
} }
@ -90,26 +92,27 @@ public class FloatUnit implements CloneableType {
space = parse.length(); space = parse.length();
} }
this.value = Float.parseFloat( value = Float.parseFloat(GoogleBaseParser.stripNonValidCharacters(GoogleBaseParser.FLOAT_CHARS, parse.substring(0, space)));
GoogleBaseParser.stripNonValidCharacters(GoogleBaseParser.FLOAT_CHARS, parse.substring(0, space)));
if (space != parse.length()) { if (space != parse.length()) {
this.units = parse.substring(space, parse.length()).trim(); units = parse.substring(space, parse.length()).trim();
} }
} }
/** /**
* Creates a new instance of FloatUnit * Creates a new instance of FloatUnit
*
* @param value float value * @param value float value
* @param units Units represented, or null. * @param units Units represented, or null.
*/ */
public FloatUnit(float value, String units) { public FloatUnit(final float value, final String units) {
this.value = value; this.value = value;
this.units = units; this.units = units;
} }
/** /**
* Returns the units. * Returns the units.
*
* @return Returns the units. * @return Returns the units.
*/ */
public String getUnits() { public String getUnits() {
@ -118,6 +121,7 @@ public class FloatUnit implements CloneableType {
/** /**
* Returns the float value. * Returns the float value.
*
* @return Returns the float value. * @return Returns the float value.
*/ */
public float getValue() { public float getValue() {
@ -126,34 +130,40 @@ public class FloatUnit implements CloneableType {
/** /**
* Duplicates the object. * Duplicates the object.
*
* @return Duplicate FloatUnit * @return Duplicate FloatUnit
*/ */
@Override
public Object clone() { public Object clone() {
return new FloatUnit(0 + this.value, this.units); return new FloatUnit(0 + value, units);
} }
/** /**
* Returns a String representation of the object. * Returns a String representation of the object.
*
* @return Returns a String representation of the object. * @return Returns a String representation of the object.
*/ */
@Override
public String toString() { public String toString() {
if ((this.units != null) && (this.units.trim().length() > 0)) { if (units != null && units.trim().length() > 0) {
return this.value + " " + this.units; return value + " " + units;
} else { } else {
return Float.toString(value); return Float.toString(value);
} }
} }
public boolean equals( Object o ){ @Override
if(!(o instanceof FloatUnit) ) public boolean equals(final Object o) {
return false; if (!(o instanceof FloatUnit)) {
FloatUnit f = (FloatUnit) o; return false;
if( f.getValue() != this.value ){ }
return false; final FloatUnit f = (FloatUnit) o;
} if (f.getValue() != value) {
if( this.units == f.getUnits() || ( this.units != null && this.units.equals( f.getUnits() )) ){ return false;
return true; }
} if (units == f.getUnits() || units != null && units.equals(f.getUnits())) {
return false; return true;
}
return false;
} }
} }

View file

@ -39,8 +39,9 @@
*/ */
package org.rometools.feed.module.base.types; package org.rometools.feed.module.base.types;
/** Simple enumeration for Genders. /**
* * Simple enumeration for Genders.
*
* @author <a href="mailto:cooper@screaming-penguin.com">Robert "kebernet" Cooper</a> * @author <a href="mailto:cooper@screaming-penguin.com">Robert "kebernet" Cooper</a>
* @version $Revision: 1.1 $ * @version $Revision: 1.1 $
*/ */
@ -49,19 +50,19 @@ public class GenderEnumeration implements CloneableType {
public static final GenderEnumeration MALE = new GenderEnumeration("Male"); public static final GenderEnumeration MALE = new GenderEnumeration("Male");
/** Women */ /** Women */
public static final GenderEnumeration FEMALE = new GenderEnumeration("Female"); public static final GenderEnumeration FEMALE = new GenderEnumeration("Female");
private String value; private final String value;
private GenderEnumeration(String value) { private GenderEnumeration(final String value) {
this.value = value; this.value = value;
} }
/** Returns the proper instance based on the string value */ /** Returns the proper instance based on the string value */
public static GenderEnumeration findByValue(String value) { public static GenderEnumeration findByValue(final String value) {
if (value == null) { if (value == null) {
return null; return null;
} }
String gender = value.toUpperCase(); final String gender = value.toUpperCase();
if (gender.charAt(0) == 'M') { if (gender.charAt(0) == 'M') {
return GenderEnumeration.MALE; return GenderEnumeration.MALE;
@ -74,14 +75,16 @@ public class GenderEnumeration implements CloneableType {
/** Returns the value of the instance */ /** Returns the value of the instance */
public String getValue() { public String getValue() {
return this.value; return value;
} }
/** Returns a reference to the same object. :P */ /** Returns a reference to the same object. :P */
@Override
public Object clone() { public Object clone() {
return this; return this;
} }
@Override
public String toString() { public String toString() {
return value; return value;
} }

View file

@ -41,27 +41,29 @@ package org.rometools.feed.module.base.types;
import org.rometools.feed.module.base.io.GoogleBaseParser; import org.rometools.feed.module.base.io.GoogleBaseParser;
/** /**
* *
* @author <a href="mailto:cooper@screaming-penguin.com">Robert "kebernet" Cooper</a> * @author <a href="mailto:cooper@screaming-penguin.com">Robert "kebernet" Cooper</a>
* @version $Revision: 1.1 $ * @version $Revision: 1.1 $
*/ */
public class IntUnit implements CloneableType { public class IntUnit implements CloneableType {
private String units; private String units;
private int value; private final int value;
private boolean inCharArray( char find, char[] array ){
for( int i=0; i < array.length; i++ ){ private boolean inCharArray(final char find, final char[] array) {
if( find == array[i]) for (final char element : array) {
if (find == element) {
return true; return true;
}
} }
return false; return false;
} }
public IntUnit(String source) {
String parse = source.trim(); public IntUnit(final String source) {
final String parse = source.trim();
int space = -1; int space = -1;
for( int i=0; i < parse.length(); i++ ){ for (int i = 0; i < parse.length(); i++) {
if( !inCharArray( parse.charAt(i), GoogleBaseParser.INTEGER_CHARS ) ){ if (!inCharArray(parse.charAt(i), GoogleBaseParser.INTEGER_CHARS)) {
space = i; space = i;
break; break;
} }
@ -70,16 +72,15 @@ public class IntUnit implements CloneableType {
space = parse.length(); space = parse.length();
} }
this.value = Integer.parseInt( value = Integer.parseInt(GoogleBaseParser.stripNonValidCharacters(GoogleBaseParser.INTEGER_CHARS, parse.substring(0, space)));
GoogleBaseParser.stripNonValidCharacters(GoogleBaseParser.INTEGER_CHARS, parse.substring(0, space)));
if (space != parse.length()) { if (space != parse.length()) {
this.units = parse.substring(space, parse.length()).trim(); units = parse.substring(space, parse.length()).trim();
} }
} }
/** Creates a new instance of IntUnit */ /** Creates a new instance of IntUnit */
public IntUnit(int value, String units) { public IntUnit(final int value, final String units) {
this.value = value; this.value = value;
this.units = units; this.units = units;
} }
@ -92,28 +93,32 @@ public class IntUnit implements CloneableType {
return value; return value;
} }
@Override
public Object clone() { public Object clone() {
return new IntUnit(this.value, this.units); return new IntUnit(value, units);
} }
@Override
public String toString() { public String toString() {
if ((this.units != null) && (this.units.trim().length() > 0)) { if (units != null && units.trim().length() > 0) {
return this.value + " " + this.units; return value + " " + units;
} else { } else {
return Integer.toString(value); return Integer.toString(value);
} }
} }
public boolean equals( Object o ){ @Override
if(!(o instanceof IntUnit) ) public boolean equals(final Object o) {
return false; if (!(o instanceof IntUnit)) {
IntUnit f = (IntUnit) o; return false;
if( f.getValue() != this.value ){ }
return false; final IntUnit f = (IntUnit) o;
} if (f.getValue() != value) {
if( this.units == f.getUnits() || ( this.units != null && this.units.equals( f.getUnits() )) ){ return false;
return true; }
} if (units == f.getUnits() || units != null && units.equals(f.getUnits())) {
return false; return true;
}
return false;
} }
} }

View file

@ -42,7 +42,7 @@ package org.rometools.feed.module.base.types;
import java.util.HashMap; import java.util.HashMap;
/** /**
* *
* @author <a href="mailto:cooper@screaming-penguin.com">Robert "kebernet" Cooper</a> * @author <a href="mailto:cooper@screaming-penguin.com">Robert "kebernet" Cooper</a>
* @version $Revision: 1.1 $ * @version $Revision: 1.1 $
*/ */
@ -57,10 +57,10 @@ public class PaymentTypeEnumeration {
public static final PaymentTypeEnumeration DISCOVER = new PaymentTypeEnumeration("Discover"); public static final PaymentTypeEnumeration DISCOVER = new PaymentTypeEnumeration("Discover");
public static final PaymentTypeEnumeration WIRE_TRANSFER = new PaymentTypeEnumeration("Wire transfer"); public static final PaymentTypeEnumeration WIRE_TRANSFER = new PaymentTypeEnumeration("Wire transfer");
public static final PaymentTypeEnumeration PAYPAL = new PaymentTypeEnumeration("Paypal"); public static final PaymentTypeEnumeration PAYPAL = new PaymentTypeEnumeration("Paypal");
private String value; private final String value;
/** Creates a new instance of PaymentTypeEnumeration */ /** Creates a new instance of PaymentTypeEnumeration */
private PaymentTypeEnumeration(String value) { private PaymentTypeEnumeration(final String value) {
this.value = value; this.value = value;
lookup.put(this.value.toUpperCase(), this); lookup.put(this.value.toUpperCase(), this);
} }
@ -69,14 +69,16 @@ public class PaymentTypeEnumeration {
return value; return value;
} }
public static PaymentTypeEnumeration findByValue(String value) { public static PaymentTypeEnumeration findByValue(final String value) {
return (PaymentTypeEnumeration) lookup.get(value.toUpperCase()); return (PaymentTypeEnumeration) lookup.get(value.toUpperCase());
} }
@Override
public Object clone() { public Object clone() {
return this; return this;
} }
@Override
public String toString() { public String toString() {
return value; return value;
} }

View file

@ -39,10 +39,9 @@
*/ */
package org.rometools.feed.module.base.types; package org.rometools.feed.module.base.types;
/** /**
* Enumeration of values suitable for "price_type" or "salary_type". * Enumeration of values suitable for "price_type" or "salary_type".
*
* @author <a href="mailto:cooper@screaming-penguin.com">Robert "kebernet" Cooper</a> * @author <a href="mailto:cooper@screaming-penguin.com">Robert "kebernet" Cooper</a>
* @version $Revision: 1.1 $ * @version $Revision: 1.1 $
*/ */
@ -58,18 +57,20 @@ public class PriceTypeEnumeration implements CloneableType {
/** /**
* String value encapsulated * String value encapsulated
*/ */
private String value; private final String value;
/** /**
* Creates a new instance of PriceTypeEnumeration * Creates a new instance of PriceTypeEnumeration
*
* @param value Value to encapsulate * @param value Value to encapsulate
*/ */
private PriceTypeEnumeration(String value) { private PriceTypeEnumeration(final String value) {
this.value = value; this.value = value;
} }
/** /**
* Returns the string value of this instance. * Returns the string value of this instance.
*
* @return Returns the string value of this instance. * @return Returns the string value of this instance.
*/ */
public String getValue() { public String getValue() {
@ -78,10 +79,11 @@ public class PriceTypeEnumeration implements CloneableType {
/** /**
* Returns a PriceTypeEnumeration based on the String value or null. * Returns a PriceTypeEnumeration based on the String value or null.
*
* @param value Value to search for. * @param value Value to search for.
* @return PriceTypeEnumeration or null. * @return PriceTypeEnumeration or null.
*/ */
public static PriceTypeEnumeration findByValue(String value) { public static PriceTypeEnumeration findByValue(final String value) {
if (value.equalsIgnoreCase("negotiable")) { if (value.equalsIgnoreCase("negotiable")) {
return PriceTypeEnumeration.NEGOTIABLE; return PriceTypeEnumeration.NEGOTIABLE;
} else { } else {
@ -91,16 +93,20 @@ public class PriceTypeEnumeration implements CloneableType {
/** /**
* Returns a duplicate of this instance * Returns a duplicate of this instance
*
* @return The same instance. * @return The same instance.
*/ */
@Override
public Object clone() { public Object clone() {
return this; return this;
} }
/** /**
* Returns the string value of this instance. * Returns the string value of this instance.
*
* @return Returns the string value of this instance. * @return Returns the string value of this instance.
*/ */
@Override
public String toString() { public String toString() {
return value; return value;
} }

View file

@ -43,6 +43,7 @@ import java.util.HashMap;
/** /**
* This class represents a specific shipping option for an item. * This class represents a specific shipping option for an item.
*
* @author <a href="mailto:cooper@screaming-penguin.com">Robert "kebernet" Cooper</a> * @author <a href="mailto:cooper@screaming-penguin.com">Robert "kebernet" Cooper</a>
* @version $Revision: 1.1 $ * @version $Revision: 1.1 $
*/ */
@ -50,23 +51,24 @@ public class ShippingType implements CloneableType {
/** /**
* price of the shipping. * price of the shipping.
*/ */
private FloatUnit price; private final FloatUnit price;
/** /**
* Service used. * Service used.
*/ */
private ServiceEnumeration service; private final ServiceEnumeration service;
/** /**
* Country to ship to * Country to ship to
*/ */
private String country; private final String country;
/** /**
* Creates a new instance of ShippingType * Creates a new instance of ShippingType
*
* @param price The price of the shipping option * @param price The price of the shipping option
* @param service Shipping service used. * @param service Shipping service used.
* @param country Country shipped to. * @param country Country shipped to.
*/ */
public ShippingType(FloatUnit price, ServiceEnumeration service, String country) { public ShippingType(final FloatUnit price, final ServiceEnumeration service, final String country) {
this.price = price; this.price = price;
this.service = service; this.service = service;
this.country = country; this.country = country;
@ -74,6 +76,7 @@ public class ShippingType implements CloneableType {
/** /**
* Returns the destination country. * Returns the destination country.
*
* @return Returns the destination country. * @return Returns the destination country.
*/ */
public String getCountry() { public String getCountry() {
@ -82,6 +85,7 @@ public class ShippingType implements CloneableType {
/** /**
* Returns the price of this shipping option. * Returns the price of this shipping option.
*
* @return Returns the price of this shipping option. * @return Returns the price of this shipping option.
*/ */
public FloatUnit getPrice() { public FloatUnit getPrice() {
@ -90,6 +94,7 @@ public class ShippingType implements CloneableType {
/** /**
* Returns the ServiceEnumeration instance for the shipping service used. * Returns the ServiceEnumeration instance for the shipping service used.
*
* @return Returns the ServiceEnumeration instance for the shipping service used. * @return Returns the ServiceEnumeration instance for the shipping service used.
*/ */
public ServiceEnumeration getService() { public ServiceEnumeration getService() {
@ -98,32 +103,40 @@ public class ShippingType implements CloneableType {
/** /**
* Clones this object. * Clones this object.
*
* @return Duplicate ShippingType object. * @return Duplicate ShippingType object.
*/ */
@Override
public Object clone() { public Object clone() {
return new ShippingType(this.price, this.service, this.country); return new ShippingType(price, service, country);
} }
/** /**
* Returns a String representation of this object. * Returns a String representation of this object.
*
* @return String representation of this object. * @return String representation of this object.
*/ */
@Override
public String toString() { public String toString() {
return this.country + " " + this.price + " " + this.service; return country + " " + price + " " + service;
} }
public boolean equals( Object o ){ @Override
if( !(o instanceof ShippingType)) public boolean equals(final Object o) {
return false; if (!(o instanceof ShippingType)) {
if( this.toString().equals( o.toString() ) ) return false;
return true; }
return false; if (toString().equals(o.toString())) {
return true;
}
return false;
} }
/** /**
* Enumeration class of valid options for ServiceType. * Enumeration class of valid options for ServiceType.
*/ */
public static class ServiceEnumeration { public static class ServiceEnumeration {
/** /**
* Looks up a ServiceEnumeration based on the string value. * Looks up a ServiceEnumeration based on the string value.
*/ */
private static final HashMap lookup = new HashMap(); private static final HashMap lookup = new HashMap();
@ -139,44 +152,49 @@ public class ShippingType implements CloneableType {
* Overnight * Overnight
*/ */
public static final ServiceEnumeration OVERNIGHT = new ServiceEnumeration("Overnight"); public static final ServiceEnumeration OVERNIGHT = new ServiceEnumeration("Overnight");
/** /**
* String value * String value
*/ */
private String value; private final String value;
/** /**
* Creates a new instance of ServiceEnumeration. * Creates a new instance of ServiceEnumeration.
*
* @param value String value to encapsulate. * @param value String value to encapsulate.
*/ */
private ServiceEnumeration(String value) { private ServiceEnumeration(final String value) {
this.value = value; this.value = value;
lookup.put(this.value.toUpperCase(), this); lookup.put(this.value.toUpperCase(), this);
} }
/** /**
* String value of this Service. * String value of this Service.
*
* @return String value of this Service. * @return String value of this Service.
*/ */
public String getValue() { public String getValue() {
return this.value; return value;
} }
/** /**
* Looks up a ServiceEnumeration based on the string value. * Looks up a ServiceEnumeration based on the string value.
*
* @param value String value to search for. * @param value String value to search for.
* @return ServiceEnumeration or null. * @return ServiceEnumeration or null.
*/ */
public static ServiceEnumeration findByValue(String value) { public static ServiceEnumeration findByValue(final String value) {
return (ServiceEnumeration) lookup.get(value.toUpperCase()); return (ServiceEnumeration) lookup.get(value.toUpperCase());
} }
/** /**
* String value of this Service. * String value of this Service.
*
* @return String value of this Service. * @return String value of this Service.
*/ */
@Override
public String toString() { public String toString() {
return this.value; return value;
} }
} }
} }

View file

@ -41,13 +41,12 @@ package org.rometools.feed.module.base.types;
import java.util.Date; import java.util.Date;
/** /**
* This is a simple wrapper for java.util.Date that indicates it should be * This is a simple wrapper for java.util.Date that indicates it should be formatted without time of day for Google Base. It should be transparent to module
* formatted without time of day for Google Base. It should be transparent to * developers.
* module developers.
* *
* Move along. Nothing to see here. * Move along. Nothing to see here.
*
* @author <a href="mailto:cooper@screaming-penguin.com">Robert "kebernet" Cooper</a> * @author <a href="mailto:cooper@screaming-penguin.com">Robert "kebernet" Cooper</a>
* @version $Revision: 1.1 $ * @version $Revision: 1.1 $
*/ */
@ -59,25 +58,29 @@ public class ShortDate extends Date implements CloneableType {
/** /**
* Creates a new Short Date based on a Date value. * Creates a new Short Date based on a Date value.
*
* @param date Date value to read from. * @param date Date value to read from.
*/ */
public ShortDate(Date date) { public ShortDate(final Date date) {
super(date.getTime()); super(date.getTime());
} }
/** /**
* Creates a new ShortDate based on a millisecond time. * Creates a new ShortDate based on a millisecond time.
*
* @param time Millisecond time to start with. * @param time Millisecond time to start with.
*/ */
public ShortDate(long time) { public ShortDate(final long time) {
super(time); super(time);
} }
/** /**
* Returns a duplicate of this object. * Returns a duplicate of this object.
*
* @return Duplicate of the object. * @return Duplicate of the object.
*/ */
@Override
public Object clone() { public Object clone() {
return new ShortDate(this.getTime()); return new ShortDate(getTime());
} }
} }

View file

@ -41,9 +41,9 @@ package org.rometools.feed.module.base.types;
import java.util.StringTokenizer; import java.util.StringTokenizer;
/**
/** Represents the size on an item in 2 or 3 dimensions. * Represents the size on an item in 2 or 3 dimensions.
* *
* @author <a href="mailto:cooper@screaming-penguin.com">Robert "kebernet" Cooper</a> * @author <a href="mailto:cooper@screaming-penguin.com">Robert "kebernet" Cooper</a>
* @version $Revision: 1.2 $ * @version $Revision: 1.2 $
*/ */
@ -55,43 +55,46 @@ public class Size implements CloneableType {
/** /**
* length * length
*/ */
private FloatUnit length; private final FloatUnit length;
/** /**
* width * width
*/ */
private FloatUnit width; private final FloatUnit width;
/** /**
* Creates a new Size object parsing a string value. * Creates a new Size object parsing a string value.
*
* @param source String value to parse * @param source String value to parse
*/ */
public Size(String source) { public Size(final String source) {
StringTokenizer tok = new StringTokenizer(source, "Xx"); final StringTokenizer tok = new StringTokenizer(source, "Xx");
this.length = new FloatUnit( tok.nextToken()); length = new FloatUnit(tok.nextToken());
this.width = new FloatUnit( tok.nextToken()); width = new FloatUnit(tok.nextToken());
if (tok.hasMoreTokens()) { if (tok.hasMoreTokens()) {
this.height = new FloatUnit( tok.nextToken()); height = new FloatUnit(tok.nextToken());
} }
} }
/** /**
* Creates a new instance of Size * Creates a new instance of Size
*
* @param length lenght value * @param length lenght value
* @param width width value * @param width width value
*/ */
public Size(FloatUnit length, FloatUnit width) { public Size(final FloatUnit length, final FloatUnit width) {
this.length = length; this.length = length;
this.width = width; this.width = width;
} }
/** /**
* Creates a new instance of Size. * Creates a new instance of Size.
*
* @param length Length value. * @param length Length value.
* @param width Width value. * @param width Width value.
* @param height Height value. * @param height Height value.
*/ */
public Size(FloatUnit length, FloatUnit width, FloatUnit height) { public Size(final FloatUnit length, final FloatUnit width, final FloatUnit height) {
this.length = length; this.length = length;
this.width = width; this.width = width;
this.height = height; this.height = height;
@ -99,6 +102,7 @@ public class Size implements CloneableType {
/** /**
* Height value. * Height value.
*
* @return Height value. * @return Height value.
*/ */
public FloatUnit getHeight() { public FloatUnit getHeight() {
@ -107,6 +111,7 @@ public class Size implements CloneableType {
/** /**
* Length value. * Length value.
*
* @return Length value. * @return Length value.
*/ */
public FloatUnit getLength() { public FloatUnit getLength() {
@ -115,6 +120,7 @@ public class Size implements CloneableType {
/** /**
* Width value. * Width value.
*
* @return Width value. * @return Width value.
*/ */
public FloatUnit getWidth() { public FloatUnit getWidth() {
@ -123,20 +129,24 @@ public class Size implements CloneableType {
/** /**
* Duplicates this object. * Duplicates this object.
*
* @return A duplicate Size object. * @return A duplicate Size object.
*/ */
@Override
public Object clone() { public Object clone() {
if (this.height != null) { if (height != null) {
return new Size(this.length, this.width, this.height); return new Size(length, width, height);
} else { } else {
return new Size(this.length, this.width); return new Size(length, width);
} }
} }
/** /**
* Returns a string representation of this object. * Returns a string representation of this object.
*
* @return A string representation of this object. * @return A string representation of this object.
*/ */
@Override
public String toString() { public String toString() {
if (height != null) { if (height != null) {
return length + "x" + width + "x" + height; return length + "x" + width + "x" + height;
@ -144,11 +154,15 @@ public class Size implements CloneableType {
return length + "x" + width; return length + "x" + width;
} }
} }
public boolean equals( Object o ){
if( !(o instanceof Size)) @Override
return false; public boolean equals(final Object o) {
if( this.toString().equals( o.toString() ) ) if (!(o instanceof Size)) {
return true; return false;
return false; }
if (toString().equals(o.toString())) {
return true;
}
return false;
} }
} }

View file

@ -42,9 +42,9 @@ package org.rometools.feed.module.base.types;
import java.util.Calendar; import java.util.Calendar;
import java.util.Date; import java.util.Date;
/**
/** This class represents a simple 4 digit year. * This class represents a simple 4 digit year.
* *
* @author <a href="mailto:cooper@screaming-penguin.com">Robert "kebernet" Cooper</a> * @author <a href="mailto:cooper@screaming-penguin.com">Robert "kebernet" Cooper</a>
* @version $Revision: 1.1 $ * @version $Revision: 1.1 $
*/ */
@ -56,43 +56,52 @@ public class YearType implements CloneableType {
/** /**
* Creates a new year from a string value. * Creates a new year from a string value.
*
* @param year String to parse. * @param year String to parse.
*/ */
public YearType(String year) { public YearType(final String year) {
this.year = Integer.parseInt(year.trim()); this.year = Integer.parseInt(year.trim());
} }
/** /**
* Creates a new instance of YearType * Creates a new instance of YearType
*
* @param date Date to get the year from. * @param date Date to get the year from.
*/ */
public YearType(Date date) { public YearType(final Date date) {
Calendar cal = Calendar.getInstance(); final Calendar cal = Calendar.getInstance();
cal.setTime(date); cal.setTime(date);
this.year = cal.get( Calendar.YEAR ); year = cal.get(Calendar.YEAR);
} }
/** /**
* Duplicates this object. * Duplicates this object.
*
* @return Cloned Year. * @return Cloned Year.
*/ */
@Override
public Object clone() { public Object clone() {
return new YearType(Integer.toString(this.year)); return new YearType(Integer.toString(year));
} }
/** /**
* Returns a String representation of this object. * Returns a String representation of this object.
*
* @return Returns a String representation of this object. * @return Returns a String representation of this object.
*/ */
@Override
public String toString() { public String toString() {
return Integer.toString(year); return Integer.toString(year);
} }
public boolean equals( Object o ){ @Override
if( !(o instanceof YearType)) public boolean equals(final Object o) {
return false; if (!(o instanceof YearType)) {
if( this.toString().equals( o.toString() ) ) return false;
return true; }
return false; if (toString().equals(o.toString())) {
return true;
}
return false;
} }
} }

View file

@ -40,20 +40,23 @@
package org.rometools.feed.module.cc; package org.rometools.feed.module.cc;
import com.sun.syndication.feed.module.Module;
import org.rometools.feed.module.cc.types.License; import org.rometools.feed.module.cc.types.License;
import com.sun.syndication.feed.module.Module;
/** /**
* *
* @author <a href="mailto:cooper@screaming-penguin.com">Robert "kebernet" Cooper</a> * @author <a href="mailto:cooper@screaming-penguin.com">Robert "kebernet" Cooper</a>
*/ */
public interface CreativeCommons extends Module { public interface CreativeCommons extends Module {
public static final String URI = "rome:CreativeCommons"; public static final String URI = "rome:CreativeCommons";
public License[] getAllLicenses(); public License[] getAllLicenses();
public void setAllLicenses(License[] licenses); public void setAllLicenses(License[] licenses);
public License[] getLicenses(); public License[] getLicenses();
public void setLicenses(License[] license );
public void setLicenses(License[] license);
} }

View file

@ -40,86 +40,89 @@
package org.rometools.feed.module.cc; package org.rometools.feed.module.cc;
import java.lang.reflect.Array;
import org.rometools.feed.module.cc.types.License;
import com.sun.syndication.feed.CopyFrom; import com.sun.syndication.feed.CopyFrom;
import com.sun.syndication.feed.impl.EqualsBean; import com.sun.syndication.feed.impl.EqualsBean;
import com.sun.syndication.feed.impl.ToStringBean; import com.sun.syndication.feed.impl.ToStringBean;
import org.rometools.feed.module.cc.types.License;
import java.lang.reflect.Array;
/** /**
* @version $Revision: 1.1 $ * @version $Revision: 1.1 $
* @author <a href="mailto:cooper@screaming-penguin.com">Robert "kebernet" Cooper</a> * @author <a href="mailto:cooper@screaming-penguin.com">Robert "kebernet" Cooper</a>
*/ */
public class CreativeCommonsImpl implements CreativeCommons { public class CreativeCommonsImpl implements CreativeCommons {
public static final String RDF_URI = "http://www.w3.org/1999/02/22-rdf-syntax-ns#"; public static final String RDF_URI = "http://www.w3.org/1999/02/22-rdf-syntax-ns#";
public static final String RSS2_URI ="http://backend.userland.com/creativeCommonsRssModule"; public static final String RSS2_URI = "http://backend.userland.com/creativeCommonsRssModule";
public static final String RSS1_URI = "http://web.resource.org/cc/"; public static final String RSS1_URI = "http://web.resource.org/cc/";
private License[] allLicenses; private License[] allLicenses;
private License[] licenses; private License[] licenses;
protected Object arrayCopy(Object[] source) { protected Object arrayCopy(final Object[] source) {
if(source == null) { if (source == null) {
return null; return null;
} }
Object[] array = (Object[])Array.newInstance(source.getClass().getComponentType(),source.length); final Object[] array = (Object[]) Array.newInstance(source.getClass().getComponentType(), source.length);
for(int i = 0; i < source.length; i++) { for (int i = 0; i < source.length; i++) {
array[i] = source[i]; array[i] = source[i];
} }
return array; return array;
} }
public License[] getAllLicenses() { public License[] getAllLicenses() {
return allLicenses; return allLicenses;
} }
public void setAllLicenses(License[] allLicenses) { public void setAllLicenses(final License[] allLicenses) {
this.allLicenses = allLicenses; this.allLicenses = allLicenses;
} }
public Class getInterface() {
return CreativeCommons.class;
}
public Class getInterface() {
return CreativeCommons.class;
}
public String getUri() { public String getUri() {
return CreativeCommons.URI; return CreativeCommons.URI;
} }
public Object clone() { @Override
CreativeCommonsImpl clone = new CreativeCommonsImpl(); public Object clone() {
clone.copyFrom( this ); final CreativeCommonsImpl clone = new CreativeCommonsImpl();
return clone; clone.copyFrom(this);
return clone;
} }
public void copyFrom(CopyFrom object) { public void copyFrom(final CopyFrom object) {
CreativeCommons source = (CreativeCommons) object; final CreativeCommons source = (CreativeCommons) object;
this.setAllLicenses( (License[]) arrayCopy( source.getAllLicenses() )); setAllLicenses((License[]) arrayCopy(source.getAllLicenses()));
this.setLicenses( source.getLicenses() ); setLicenses(source.getLicenses());
} }
public boolean equals(Object obj) { @Override
EqualsBean eBean = new EqualsBean(this.getClass(),this); public boolean equals(final Object obj) {
final EqualsBean eBean = new EqualsBean(this.getClass(), this);
return eBean.beanEquals(obj); return eBean.beanEquals(obj);
} }
public License[] getLicenses() { public License[] getLicenses() {
return licenses; return licenses;
} }
public void setLicenses(License[] licenses) { public void setLicenses(final License[] licenses) {
this.licenses = licenses; this.licenses = licenses;
} }
@Override
public String toString() { public String toString() {
ToStringBean tsb = new ToStringBean( CreativeCommonsImpl.class, this ); final ToStringBean tsb = new ToStringBean(CreativeCommonsImpl.class, this);
return tsb.toString(); return tsb.toString();
} }
} }

View file

@ -40,103 +40,105 @@
package org.rometools.feed.module.cc.io; package org.rometools.feed.module.cc.io;
import com.sun.syndication.feed.module.Module; import java.util.HashSet;
import com.sun.syndication.io.ModuleGenerator; import java.util.Set;
import org.jdom2.Element;
import org.jdom2.Namespace;
import org.rometools.feed.module.cc.CreativeCommons; import org.rometools.feed.module.cc.CreativeCommons;
import org.rometools.feed.module.cc.CreativeCommonsImpl; import org.rometools.feed.module.cc.CreativeCommonsImpl;
import org.rometools.feed.module.cc.types.License; import org.rometools.feed.module.cc.types.License;
import java.util.HashSet;
import java.util.Set; import com.sun.syndication.feed.module.Module;
import org.jdom.Element; import com.sun.syndication.io.ModuleGenerator;
import org.jdom.Namespace;
/** /**
* @version $Revision: 1.1 $ * @version $Revision: 1.1 $
* @author <a href="mailto:cooper@screaming-penguin.com">Robert "kebernet" Cooper</a> * @author <a href="mailto:cooper@screaming-penguin.com">Robert "kebernet" Cooper</a>
*/ */
public class CCModuleGenerator implements ModuleGenerator{ public class CCModuleGenerator implements ModuleGenerator {
private static final Namespace RSS1 = Namespace.getNamespace( "cc", CreativeCommonsImpl.RSS1_URI ); private static final Namespace RSS1 = Namespace.getNamespace("cc", CreativeCommonsImpl.RSS1_URI);
private static final Namespace RSS2 = Namespace.getNamespace( "creativeCommons", CreativeCommonsImpl.RSS2_URI); private static final Namespace RSS2 = Namespace.getNamespace("creativeCommons", CreativeCommonsImpl.RSS2_URI);
private static final Namespace RSS = Namespace.getNamespace("http://purl.org/rss/1.0/"); private static final Namespace RSS = Namespace.getNamespace("http://purl.org/rss/1.0/");
private static final Namespace RDF = Namespace.getNamespace("rdf", "http://www.w3.org/1999/02/22-rdf-syntax-ns#"); private static final Namespace RDF = Namespace.getNamespace("rdf", "http://www.w3.org/1999/02/22-rdf-syntax-ns#");
private static final HashSet NAMESPACES = new HashSet(); private static final HashSet NAMESPACES = new HashSet();
static{ static {
NAMESPACES.add( RSS1 ); NAMESPACES.add(RSS1);
NAMESPACES.add( RSS2 ); NAMESPACES.add(RSS2);
NAMESPACES.add( RDF ); NAMESPACES.add(RDF);
} }
/** /**
* Creates a new instance of CCModuleGenerator * Creates a new instance of CCModuleGenerator
*/ */
public CCModuleGenerator() { public CCModuleGenerator() {
super(); super();
} }
public void generate(Module module, Element element) { public void generate(final Module module, final Element element) {
Element root = element; Element root = element;
while( root.getParentElement() != null ){ while (root.getParentElement() != null) {
root = root.getParentElement(); root = root.getParentElement();
} }
if( root.getNamespace().equals( RDF )|| root.getNamespace().equals( RSS )){ if (root.getNamespace().equals(RDF) || root.getNamespace().equals(RSS)) {
generateRSS1( (CreativeCommons) module, element); generateRSS1((CreativeCommons) module, element);
} else { } else {
generateRSS2( (CreativeCommons) module, element); generateRSS2((CreativeCommons) module, element);
} }
} }
public Set getNamespaces() { public Set getNamespaces() {
return NAMESPACES; return NAMESPACES;
} }
public String getNamespaceUri() { public String getNamespaceUri() {
return CreativeCommons.URI; return CreativeCommons.URI;
} }
private void generateRSS1( CreativeCommons module, Element element ){ private void generateRSS1(final CreativeCommons module, final Element element) {
//throw new RuntimeException( "Generating RSS1 Feeds not currently Supported."); // throw new RuntimeException( "Generating RSS1 Feeds not currently Supported.");
System.out.println(element.getName()); System.out.println(element.getName());
if( element.getName().equals("channel")){ if (element.getName().equals("channel")) {
// Do all licenses list. // Do all licenses list.
License[] all = module.getAllLicenses(); final License[] all = module.getAllLicenses();
for( int i=0; i < all.length ; i++){ for (final License element2 : all) {
Element license = new Element( "License", RSS1 ); final Element license = new Element("License", RSS1);
license.setAttribute( "about", all[i].getValue(), RDF ); license.setAttribute("about", element2.getValue(), RDF);
License.Behaviour[] permits = all[i].getPermits(); final License.Behaviour[] permits = element2.getPermits();
for( int j=0; permits != null && j < permits.length; j++ ){ for (int j = 0; permits != null && j < permits.length; j++) {
Element permit = new Element( "permits", RSS1 ); final Element permit = new Element("permits", RSS1);
permit.setAttribute( "resource", permits[j].toString(), RDF); permit.setAttribute("resource", permits[j].toString(), RDF);
license.addContent( permit ); license.addContent(permit);
} }
License.Behaviour[] requires = all[i].getPermits(); final License.Behaviour[] requires = element2.getPermits();
for( int j=0; requires != null && j < requires.length; j++ ){ for (int j = 0; requires != null && j < requires.length; j++) {
Element permit = new Element( "requires", RSS1 ); final Element permit = new Element("requires", RSS1);
permit.setAttribute( "resource", permits[j].toString(), RDF); permit.setAttribute("resource", permits[j].toString(), RDF);
license.addContent( permit ); license.addContent(permit);
} }
System.out.println("Is Root?"+element.getParentElement()); System.out.println("Is Root?" + element.getParentElement());
element.getParentElement().addContent( license ); element.getParentElement().addContent(license);
} }
} }
//Do local licenses // Do local licenses
License[] licenses = module.getLicenses(); final License[] licenses = module.getLicenses();
for( int i=0; i < licenses.length; i++ ){ for (final License license2 : licenses) {
Element license = new Element( "license", RSS1 ); final Element license = new Element("license", RSS1);
license.setAttribute( "resource", licenses[i].getValue(), RDF); license.setAttribute("resource", license2.getValue(), RDF);
element.addContent( license ); element.addContent(license);
} }
} }
private void generateRSS2( CreativeCommons module, Element element ){ private void generateRSS2(final CreativeCommons module, final Element element) {
License[] licenses = module.getLicenses(); final License[] licenses = module.getLicenses();
for( int i=0; licenses != null && i < licenses.length; i++ ){ for (int i = 0; licenses != null && i < licenses.length; i++) {
Element license = new Element( "license", RSS2 ); final Element license = new Element("license", RSS2);
license.setText( licenses[i].getValue() ); license.setText(licenses[i].getValue());
element.addContent( license ); element.addContent(license);
} }
} }
} }

View file

@ -40,94 +40,96 @@
package org.rometools.feed.module.cc.io; package org.rometools.feed.module.cc.io;
import com.sun.syndication.feed.module.Module;
import com.sun.syndication.io.ModuleParser;
import org.rometools.feed.module.cc.CreativeCommonsImpl;
import org.rometools.feed.module.cc.types.License;
import java.util.ArrayList; import java.util.ArrayList;
import java.util.Iterator; import java.util.Iterator;
import java.util.List; import java.util.List;
import org.jdom.Element;
import org.jdom.Namespace;
import org.jdom2.Element;
import org.jdom2.Namespace;
import org.rometools.feed.module.cc.CreativeCommonsImpl;
import org.rometools.feed.module.cc.types.License;
import com.sun.syndication.feed.module.Module;
import com.sun.syndication.io.ModuleParser;
/** /**
* @version $Revision: 1.3 $ * @version $Revision: 1.3 $
* @author <a href="mailto:cooper@screaming-penguin.com">Robert "kebernet" Cooper</a> * @author <a href="mailto:cooper@screaming-penguin.com">Robert "kebernet" Cooper</a>
*/ */
public class ModuleParserRSS1 implements ModuleParser { public class ModuleParserRSS1 implements ModuleParser {
private static final Namespace NS = Namespace.getNamespace( CreativeCommonsImpl.RSS1_URI ); private static final Namespace NS = Namespace.getNamespace(CreativeCommonsImpl.RSS1_URI);
static final Namespace RDF = Namespace.getNamespace( CreativeCommonsImpl.RDF_URI ); static final Namespace RDF = Namespace.getNamespace(CreativeCommonsImpl.RDF_URI);
/** /**
* Creates a new instance of ModuleParserRSS1 * Creates a new instance of ModuleParserRSS1
*/ */
public ModuleParserRSS1() { public ModuleParserRSS1() {
} }
public Module parse(Element element) { public Module parse(final Element element) {
CreativeCommonsImpl module = new CreativeCommonsImpl(); final CreativeCommonsImpl module = new CreativeCommonsImpl();
{ {
// Parsing Channel level. // Parsing Channel level.
Element root =element; Element root = element;
while(root.getParentElement() != null ) while (root.getParentElement() != null) {
root = root.getParentElement(); root = root.getParentElement();
List licenseList = root.getChildren( "License", NS ); }
ArrayList licenses = new ArrayList(); final List licenseList = root.getChildren("License", NS);
Iterator it = licenseList.iterator(); final ArrayList licenses = new ArrayList();
while( it.hasNext() ){ final Iterator it = licenseList.iterator();
Element licenseTag = (Element) it.next(); while (it.hasNext()) {
String licenseURI = licenseTag.getAttributeValue("about", RDF); final Element licenseTag = (Element) it.next();
if( licenseURI == null ) final String licenseURI = licenseTag.getAttributeValue("about", RDF);
continue; if (licenseURI == null) {
License license = License.findByValue( licenseURI ); continue;
{ }
ArrayList permitsValues = new ArrayList(); License license = License.findByValue(licenseURI);
ArrayList requiresValues = new ArrayList(); {
List permitsTags = licenseTag.getChildren("permits", NS ); final ArrayList permitsValues = new ArrayList();
Iterator sit = permitsTags.iterator(); final ArrayList requiresValues = new ArrayList();
while(sit.hasNext() ){ final List permitsTags = licenseTag.getChildren("permits", NS);
Element permitTag = (Element) sit.next(); Iterator sit = permitsTags.iterator();
permitsValues.add( License.Behaviour.findByValue( permitTag.getAttributeValue( "resource", RDF) )); while (sit.hasNext()) {
} final Element permitTag = (Element) sit.next();
List requiresTags = licenseTag.getChildren( "requires", NS); permitsValues.add(License.Behaviour.findByValue(permitTag.getAttributeValue("resource", RDF)));
sit = requiresTags.iterator(); }
while(sit.hasNext()){ final List requiresTags = licenseTag.getChildren("requires", NS);
Element requireTag = (Element) sit.next(); sit = requiresTags.iterator();
requiresValues.add( License.Behaviour.findByValue(requireTag.getAttributeValue("resource", RDF))); while (sit.hasNext()) {
} final Element requireTag = (Element) sit.next();
license = new License( licenseURI, requiresValues.add(License.Behaviour.findByValue(requireTag.getAttributeValue("resource", RDF)));
(License.Behaviour[]) requiresValues.toArray( new License.Behaviour[requiresValues.size()]), }
(License.Behaviour[]) permitsValues.toArray( new License.Behaviour[permitsValues.size()]) ); license = new License(licenseURI, (License.Behaviour[]) requiresValues.toArray(new License.Behaviour[requiresValues.size()]),
(License.Behaviour[]) permitsValues.toArray(new License.Behaviour[permitsValues.size()]));
}
}
licenses.add( license );
} licenses.add(license);
module.setAllLicenses( (License[]) licenses.toArray( new License[0] ) ); }
} module.setAllLicenses((License[]) licenses.toArray(new License[0]));
ArrayList licenses = new ArrayList(); }
List licenseTags = element.getChildren( "license", NS ); final ArrayList licenses = new ArrayList();
Iterator lit = licenseTags.iterator(); final List licenseTags = element.getChildren("license", NS);
while( lit.hasNext() ){ final Iterator lit = licenseTags.iterator();
Element licenseTag = (Element) lit.next(); while (lit.hasNext()) {
licenses.add( License.findByValue( licenseTag.getAttributeValue( "resource", RDF))); final Element licenseTag = (Element) lit.next();
} licenses.add(License.findByValue(licenseTag.getAttributeValue("resource", RDF)));
}
if( licenses.size() > 0 ){
module.setLicenses( (License[]) licenses.toArray( new License[licenses.size()])); if (licenses.size() > 0) {
} module.setLicenses((License[]) licenses.toArray(new License[licenses.size()]));
}
if( module.getLicenses() != null || module.getAllLicenses() != null ){
return module; if (module.getLicenses() != null || module.getAllLicenses() != null) {
} else { return module;
return null; } else {
} return null;
}
} }
public String getNamespaceUri() { public String getNamespaceUri() {
return CreativeCommonsImpl.RSS1_URI; return CreativeCommonsImpl.RSS1_URI;
} }
} }

View file

@ -40,80 +40,85 @@
package org.rometools.feed.module.cc.io; package org.rometools.feed.module.cc.io;
import com.sun.syndication.feed.module.Module;
import com.sun.syndication.io.ModuleParser;
import org.rometools.feed.module.cc.CreativeCommonsImpl;
import org.rometools.feed.module.cc.types.License;
import java.util.ArrayList; import java.util.ArrayList;
import java.util.Iterator; import java.util.Iterator;
import java.util.List; import java.util.List;
import org.jdom.Element;
import org.jdom.Namespace; import org.jdom2.Element;
import org.jdom2.Namespace;
import org.rometools.feed.module.cc.CreativeCommonsImpl;
import org.rometools.feed.module.cc.types.License;
import com.sun.syndication.feed.module.Module;
import com.sun.syndication.io.ModuleParser;
/** /**
* *
* @version $Revision: 1.3 $ * @version $Revision: 1.3 $
* @author <a href="mailto:cooper@screaming-penguin.com">Robert "kebernet" Cooper</a> * @author <a href="mailto:cooper@screaming-penguin.com">Robert "kebernet" Cooper</a>
*/ */
public class ModuleParserRSS2 implements ModuleParser { public class ModuleParserRSS2 implements ModuleParser {
private static final Namespace NS = Namespace.getNamespace( CreativeCommonsImpl.RSS2_URI ); private static final Namespace NS = Namespace.getNamespace(CreativeCommonsImpl.RSS2_URI);
/** Creates a new instance of ModuleParserRSS2 */ /** Creates a new instance of ModuleParserRSS2 */
public ModuleParserRSS2() { public ModuleParserRSS2() {
} }
public Module parse(Element element) { public Module parse(final Element element) {
CreativeCommonsImpl module = new CreativeCommonsImpl(); final CreativeCommonsImpl module = new CreativeCommonsImpl();
//Do channel global // Do channel global
{ {
Element root = element; Element root = element;
while( !root.getName().equals("channel") && !root.getName().equals("feed") ) while (!root.getName().equals("channel") && !root.getName().equals("feed")) {
root = root.getParentElement(); root = root.getParentElement();
ArrayList licenses = new ArrayList(); }
List items = null; final ArrayList licenses = new ArrayList();
if( root.getName().equals("channel")) List items = null;
items = root.getChildren("item"); if (root.getName().equals("channel")) {
else items = root.getChildren("item");
items = root.getChildren("entry"); } else {
items = root.getChildren("entry");
Iterator iit = items.iterator(); }
while( iit.hasNext() ){
Element item = (Element) iit.next(); final Iterator iit = items.iterator();
List licenseTags = item.getChildren( "license", NS ); while (iit.hasNext()) {
Iterator lit = licenseTags.iterator(); final Element item = (Element) iit.next();
while(lit.hasNext() ){ final List licenseTags = item.getChildren("license", NS);
Element licenseTag = (Element) lit.next(); final Iterator lit = licenseTags.iterator();
License license = License.findByValue( licenseTag.getTextTrim() ); while (lit.hasNext()) {
if( !licenses.contains( license )); final Element licenseTag = (Element) lit.next();
licenses.add( license ); final License license = License.findByValue(licenseTag.getTextTrim());
} if (!licenses.contains(license)) {
} ;
if( licenses.size() > 0 ){ }
module.setAllLicenses( (License[]) licenses.toArray( new License[0] ) ); licenses.add(license);
} }
} }
// do element local if (licenses.size() > 0) {
ArrayList licenses = new ArrayList(); module.setAllLicenses((License[]) licenses.toArray(new License[0]));
List licenseTags = element.getChildren( "license", NS ); }
Iterator it = licenseTags.iterator(); }
while( it.hasNext() ){ // do element local
Element licenseTag = (Element) it.next(); final ArrayList licenses = new ArrayList();
licenses.add( License.findByValue(licenseTag.getTextTrim() )); final List licenseTags = element.getChildren("license", NS);
} final Iterator it = licenseTags.iterator();
if( licenses.size() > 0 ){ while (it.hasNext()) {
module.setLicenses( (License[]) licenses.toArray( new License[0])); final Element licenseTag = (Element) it.next();
} licenses.add(License.findByValue(licenseTag.getTextTrim()));
}
if( module.getLicenses() != null && module.getAllLicenses() != null ){ if (licenses.size() > 0) {
return module; module.setLicenses((License[]) licenses.toArray(new License[0]));
} else { }
return null;
} if (module.getLicenses() != null && module.getAllLicenses() != null) {
return module;
} else {
return null;
}
} }
public String getNamespaceUri() { public String getNamespaceUri() {
return CreativeCommonsImpl.RSS2_URI; return CreativeCommonsImpl.RSS2_URI;
} }
} }

View file

@ -3,7 +3,7 @@
* *
* Created on November 20, 2005, 3:20 PM * Created on November 20, 2005, 3:20 PM
* *
* This library is provided under dual licenses. * This library is provided under dual licenses.
* You may choose the terms of the Lesser General Public License or the Apache * You may choose the terms of the Lesser General Public License or the Apache
* License at your discretion. * License at your discretion.
* *
@ -39,12 +39,13 @@
*/ */
package org.rometools.feed.module.cc.types; package org.rometools.feed.module.cc.types;
import com.sun.syndication.feed.impl.EqualsBean;
import com.sun.syndication.feed.impl.ToStringBean;
import java.util.HashMap; import java.util.HashMap;
import java.util.Iterator; import java.util.Iterator;
import java.util.StringTokenizer; import java.util.StringTokenizer;
import com.sun.syndication.feed.impl.EqualsBean;
import com.sun.syndication.feed.impl.ToStringBean;
/** /**
* @version $Revision: 1.1 $ * @version $Revision: 1.1 $
* @author <a href="mailto:cooper@screaming-penguin.com">Robert "kebernet" Cooper</a> * @author <a href="mailto:cooper@screaming-penguin.com">Robert "kebernet" Cooper</a>
@ -52,151 +53,135 @@ import java.util.StringTokenizer;
public class License { public class License {
private static final String CC_START = "http://creativecommons.org/licenses/"; private static final String CC_START = "http://creativecommons.org/licenses/";
private static final HashMap lookupLicense = new HashMap(); private static final HashMap lookupLicense = new HashMap();
public static final License NO_DERIVS = new License("http://creativecommons.org/licenses/nd/1.0/",new Behaviour[0],new Behaviour[] { public static final License NO_DERIVS = new License("http://creativecommons.org/licenses/nd/1.0/", new Behaviour[0], new Behaviour[] {
Behaviour.DISTRIBUTION,Behaviour.REPRODUCTION Behaviour.DISTRIBUTION, Behaviour.REPRODUCTION });
}); public static final License NO_DERIVS_NONCOMMERCIAL = new License("http://creativecommons.org/licenses/nd-nc/1.0/",
public static final License NO_DERIVS_NONCOMMERCIAL = new License("http://creativecommons.org/licenses/nd-nc/1.0/",new Behaviour[] { new Behaviour[] { Behaviour.NONCOMMERCIAL }, new Behaviour[] { Behaviour.DISTRIBUTION, Behaviour.REPRODUCTION });
Behaviour.NONCOMMERCIAL public static final License NONCOMMERCIAL = new License("http://creativecommons.org/licenses/nc/1.0/", new Behaviour[] { Behaviour.NONCOMMERCIAL },
},new Behaviour[] {Behaviour.DISTRIBUTION,Behaviour.REPRODUCTION}); new Behaviour[] { Behaviour.DERIVATIVE, Behaviour.DISTRIBUTION, Behaviour.REPRODUCTION });
public static final License NONCOMMERCIAL = new License("http://creativecommons.org/licenses/nc/1.0/",new Behaviour[] { public static final License SHARE_ALIKE = new License("http://creativecommons.org/licenses/sa/1.0/", new Behaviour[] { Behaviour.COPYLEFT },
Behaviour.NONCOMMERCIAL new Behaviour[] { Behaviour.DERIVATIVE, Behaviour.DISTRIBUTION, Behaviour.REPRODUCTION });
},new Behaviour[] { public static final License SHARE_ALIKE_NONCOMMERCIAL = new License("http://creativecommons.org/licenses/nc-sa/1.0/", new Behaviour[] { Behaviour.COPYLEFT,
Behaviour.DERIVATIVE,Behaviour.DISTRIBUTION,Behaviour.REPRODUCTION Behaviour.NONCOMMERCIAL }, new Behaviour[] { Behaviour.DERIVATIVE, Behaviour.DISTRIBUTION, Behaviour.REPRODUCTION });
}); public static final License SHARE_ALIKE_ATTRIBUTION = new License("http://creativecommons.org/licenses/by-sa/2.5/", new Behaviour[] { Behaviour.COPYLEFT,
public static final License SHARE_ALIKE = new License("http://creativecommons.org/licenses/sa/1.0/",new Behaviour[] { Behaviour.ATTRIBUTION }, new Behaviour[] { Behaviour.DERIVATIVE, Behaviour.DISTRIBUTION, Behaviour.REPRODUCTION });
Behaviour.COPYLEFT public static final License SHARE_ALIKE_NONCOMMERCIAL_ATTRIBUTION = new License("http://creativecommons.org/licenses/by-nc-sa/2.5/", new Behaviour[] {
},new Behaviour[] { Behaviour.COPYLEFT, Behaviour.ATTRIBUTION, Behaviour.NONCOMMERCIAL }, new Behaviour[] { Behaviour.DERIVATIVE, Behaviour.DISTRIBUTION,
Behaviour.DERIVATIVE,Behaviour.DISTRIBUTION,Behaviour.REPRODUCTION Behaviour.REPRODUCTION });
}); public static final License NONCOMMERCIAL_ATTRIBUTION = new License("http://creativecommons.org/licenses/by-nc/2.5/", new Behaviour[] {
public static final License SHARE_ALIKE_NONCOMMERCIAL = new License("http://creativecommons.org/licenses/nc-sa/1.0/",new Behaviour[] { Behaviour.ATTRIBUTION, Behaviour.NONCOMMERCIAL }, new Behaviour[] { Behaviour.DERIVATIVE, Behaviour.DISTRIBUTION, Behaviour.REPRODUCTION });
Behaviour.COPYLEFT,Behaviour.NONCOMMERCIAL public static final License NONCOMMERCIAL_ATTRIBUTION_NO_DERIVS = new License("http://creativecommons.org/licenses/by-nc-nd/2.5/", new Behaviour[] {
},new Behaviour[] { Behaviour.ATTRIBUTION, Behaviour.NONCOMMERCIAL }, new Behaviour[] { Behaviour.DISTRIBUTION, Behaviour.REPRODUCTION });
Behaviour.DERIVATIVE,Behaviour.DISTRIBUTION,Behaviour.REPRODUCTION public static final License ATTRIBUTION_NO_DERIVS = new License("http://creativecommons.org/licenses/by-nd/2.5/",
}); new Behaviour[] { Behaviour.ATTRIBUTION }, new Behaviour[] { Behaviour.DISTRIBUTION, Behaviour.REPRODUCTION });
public static final License SHARE_ALIKE_ATTRIBUTION = new License("http://creativecommons.org/licenses/by-sa/2.5/",new Behaviour[] { public static final License ATTRIBUTION = new License("http://creativecommons.org/licenses/by/2.5/", new Behaviour[] { Behaviour.ATTRIBUTION },
Behaviour.COPYLEFT,Behaviour.ATTRIBUTION new Behaviour[] { Behaviour.DERIVATIVE, Behaviour.DISTRIBUTION, Behaviour.REPRODUCTION });
},new Behaviour[] { private final String uri;
Behaviour.DERIVATIVE,Behaviour.DISTRIBUTION,Behaviour.REPRODUCTION private final Behaviour[] permits;
}); private final Behaviour[] requires;
public static final License SHARE_ALIKE_NONCOMMERCIAL_ATTRIBUTION = new License("http://creativecommons.org/licenses/by-nc-sa/2.5/",new Behaviour[] {
Behaviour.COPYLEFT,Behaviour.ATTRIBUTION,Behaviour.NONCOMMERCIAL
},new Behaviour[] {
Behaviour.DERIVATIVE,Behaviour.DISTRIBUTION,Behaviour.REPRODUCTION
});
public static final License NONCOMMERCIAL_ATTRIBUTION = new License("http://creativecommons.org/licenses/by-nc/2.5/",new Behaviour[] {
Behaviour.ATTRIBUTION,Behaviour.NONCOMMERCIAL
},new Behaviour[] {
Behaviour.DERIVATIVE,Behaviour.DISTRIBUTION,Behaviour.REPRODUCTION
});
public static final License NONCOMMERCIAL_ATTRIBUTION_NO_DERIVS = new License("http://creativecommons.org/licenses/by-nc-nd/2.5/",new Behaviour[] {
Behaviour.ATTRIBUTION,Behaviour.NONCOMMERCIAL
},new Behaviour[] {Behaviour.DISTRIBUTION,Behaviour.REPRODUCTION});
public static final License ATTRIBUTION_NO_DERIVS = new License("http://creativecommons.org/licenses/by-nd/2.5/",new Behaviour[] {
Behaviour.ATTRIBUTION
},new Behaviour[] {Behaviour.DISTRIBUTION,Behaviour.REPRODUCTION});
public static final License ATTRIBUTION = new License("http://creativecommons.org/licenses/by/2.5/",new Behaviour[] {
Behaviour.ATTRIBUTION
},new Behaviour[] {
Behaviour.DERIVATIVE,Behaviour.DISTRIBUTION,Behaviour.REPRODUCTION
});
private String uri;
private Behaviour[] permits;
private Behaviour[] requires;
/** /**
* Creates a new instance of License * Creates a new instance of License
*/ */
public License(String uri,Behaviour[] requires,Behaviour[] permits) { public License(final String uri, final Behaviour[] requires, final Behaviour[] permits) {
this.requires = requires; this.requires = requires;
this.permits = permits; this.permits = permits;
this.uri = uri; this.uri = uri;
License.lookupLicense.put(uri,this); License.lookupLicense.put(uri, this);
if(this.uri.endsWith("/")) { if (this.uri.endsWith("/")) {
//System.out.println(uri.substring(0,this.uri.lastIndexOf("/"))); // System.out.println(uri.substring(0,this.uri.lastIndexOf("/")));
License.lookupLicense.put(uri.substring(0,this.uri.lastIndexOf("/")),this); License.lookupLicense.put(uri.substring(0, this.uri.lastIndexOf("/")), this);
} }
} }
public static License findByValue(String uri) { public static License findByValue(final String uri) {
License found = (License)License.lookupLicense.get(uri); License found = (License) License.lookupLicense.get(uri);
//No I am going to try an guess about unknown licenses // No I am going to try an guess about unknown licenses
// This is try and match known CC licenses of other versions or various URLs to // This is try and match known CC licenses of other versions or various URLs to
// current licenses, then make a new one with the same permissions. // current licenses, then make a new one with the same permissions.
if(found == null && uri.startsWith("http://") && uri.toLowerCase().indexOf("creativecommons.org") != -1) { if (found == null && uri.startsWith("http://") && uri.toLowerCase().indexOf("creativecommons.org") != -1) {
Iterator it = License.lookupLicense.keySet().iterator(); final Iterator it = License.lookupLicense.keySet().iterator();
while(it.hasNext()&&(found == null)) { while (it.hasNext() && found == null) {
try{ try {
String key = (String)it.next(); final String key = (String) it.next();
if(key.startsWith( CC_START ) ){ if (key.startsWith(CC_START)) {
String licensePath = key.substring( CC_START.length(), key.length() ); final String licensePath = key.substring(CC_START.length(), key.length());
StringTokenizer tok = new StringTokenizer( licensePath, "/"); final StringTokenizer tok = new StringTokenizer(licensePath, "/");
String license = tok.nextToken(); final String license = tok.nextToken();
String version = tok.nextToken(); final String version = tok.nextToken();
if( uri.toLowerCase().indexOf("creativecommons.org/licenses/"+license) != -1){ if (uri.toLowerCase().indexOf("creativecommons.org/licenses/" + license) != -1) {
License current = (License) lookupLicense.get( key ); final License current = (License) lookupLicense.get(key);
found = new License( uri, current.getRequires(), current.getPermits() ); found = new License(uri, current.getRequires(), current.getPermits());
} }
} }
} catch(Exception e){ } catch (final Exception e) {
e.printStackTrace(); e.printStackTrace();
} }
} }
} }
//OK, we got here. If we haven't found a match, return a new License with unknown permissions. // OK, we got here. If we haven't found a match, return a new License with unknown permissions.
if( found == null ){ if (found == null) {
found = new License( uri, null, null ); found = new License(uri, null, null);
} }
return found; return found;
} }
public Behaviour[] getPermits() { public Behaviour[] getPermits() {
return this.permits; return permits;
} }
public Behaviour[] getRequires() { public Behaviour[] getRequires() {
return this.requires; return requires;
} }
@Override
public String toString() { public String toString() {
ToStringBean tsb = new ToStringBean( License.class, this ); final ToStringBean tsb = new ToStringBean(License.class, this);
return tsb.toString(); return tsb.toString();
} }
public String getValue() { public String getValue() {
return this.uri; return uri;
} }
public boolean equals(Object obj) {
EqualsBean eBean = new EqualsBean(License.class,this); @Override
return eBean.beanEquals(obj); public boolean equals(final Object obj) {
final EqualsBean eBean = new EqualsBean(License.class, this);
return eBean.beanEquals(obj);
} }
@Override
public int hashCode() { public int hashCode() {
EqualsBean equals = new EqualsBean(License.class,this); final EqualsBean equals = new EqualsBean(License.class, this);
return equals.beanHashCode(); return equals.beanHashCode();
} }
public static class Behaviour { public static class Behaviour {
private static final HashMap lookup = new HashMap(); private static final HashMap lookup = new HashMap();
public static final Behaviour REPRODUCTION = new Behaviour("http://web.resource.org/cc/Reproduction"); public static final Behaviour REPRODUCTION = new Behaviour("http://web.resource.org/cc/Reproduction");
public static final Behaviour DISTRIBUTION = new Behaviour("http://web.resource.org/cc/Distribution"); public static final Behaviour DISTRIBUTION = new Behaviour("http://web.resource.org/cc/Distribution");
public static final Behaviour DERIVATIVE = new Behaviour("http://web.resource.org/cc/DerivativeWorks"); public static final Behaviour DERIVATIVE = new Behaviour("http://web.resource.org/cc/DerivativeWorks");
public static final Behaviour NOTICE = new Behaviour("http://web.resource.org/cc/Notice"); public static final Behaviour NOTICE = new Behaviour("http://web.resource.org/cc/Notice");
public static final Behaviour ATTRIBUTION = new Behaviour("http://web.resource.org/cc/Attribution"); public static final Behaviour ATTRIBUTION = new Behaviour("http://web.resource.org/cc/Attribution");
public static final Behaviour COPYLEFT = new Behaviour("http://web.resource.org/cc/Copyleft"); public static final Behaviour COPYLEFT = new Behaviour("http://web.resource.org/cc/Copyleft");
public static final Behaviour NONCOMMERCIAL = new Behaviour("http://web.resource.org/cc/Noncommercial"); public static final Behaviour NONCOMMERCIAL = new Behaviour("http://web.resource.org/cc/Noncommercial");
private String uri; private final String uri;
private Behaviour(String uri) { private Behaviour(final String uri) {
this.uri = uri; this.uri = uri;
Behaviour.lookup.put(uri,this); Behaviour.lookup.put(uri, this);
} }
public static Behaviour findByValue(String uri) { public static Behaviour findByValue(final String uri) {
return (Behaviour)Behaviour.lookup.get(uri); return (Behaviour) Behaviour.lookup.get(uri);
} }
public String toString() { @Override
return this.uri; public String toString() {
} return uri;
}
} }
} }

View file

@ -43,11 +43,11 @@ package org.rometools.feed.module.content;
import java.util.List; import java.util.List;
/**
/** This class represents a content item per the "Original Syntax". * This class represents a content item per the "Original Syntax". http://purl.org/rss/1.0/modules/content/
* http://purl.org/rss/1.0/modules/content/ *
* @version $Revision: 1.1 $ * @version $Revision: 1.1 $
* @author <a href="mailto:cooper@screaming-penguin.com">Robert "kebernet" Cooper</a> * @author <a href="mailto:cooper@screaming-penguin.com">Robert "kebernet" Cooper</a>
*/ */
public class ContentItem implements Cloneable { public class ContentItem implements Cloneable {
private String contentFormat; private String contentFormat;
@ -64,70 +64,71 @@ public class ContentItem implements Cloneable {
} }
public String getContentFormat() { public String getContentFormat() {
return this.contentFormat; return contentFormat;
} }
public void setContentFormat(String contentFormat) { public void setContentFormat(final String contentFormat) {
this.contentFormat = contentFormat; this.contentFormat = contentFormat;
} }
public String getContentEncoding() { public String getContentEncoding() {
return this.contentEncoding; return contentEncoding;
} }
public void setContentEncoding(String contentEncoding) { public void setContentEncoding(final String contentEncoding) {
this.contentEncoding = contentEncoding; this.contentEncoding = contentEncoding;
} }
public String getContentValue() { public String getContentValue() {
return this.contentValue; return contentValue;
} }
public void setContentValue(String contentValue) { public void setContentValue(final String contentValue) {
this.contentValue = contentValue; this.contentValue = contentValue;
} }
public List getContentValueDOM() { public List getContentValueDOM() {
return this.contentValueDOM; return contentValueDOM;
} }
public void setContentValueDOM(List contentValueDOM) { public void setContentValueDOM(final List contentValueDOM) {
this.contentValueDOM = contentValueDOM; this.contentValueDOM = contentValueDOM;
} }
public String getContentAbout() { public String getContentAbout() {
return this.contentAbout; return contentAbout;
} }
public void setContentAbout(String contentAbout) { public void setContentAbout(final String contentAbout) {
this.contentAbout = contentAbout; this.contentAbout = contentAbout;
} }
public String getContentValueParseType() { public String getContentValueParseType() {
return this.contentValueParseType; return contentValueParseType;
} }
public void setContentValueParseType(String contentValueParseType) { public void setContentValueParseType(final String contentValueParseType) {
this.contentValueParseType = contentValueParseType; this.contentValueParseType = contentValueParseType;
} }
public List getContentValueNamespaces() { public List getContentValueNamespaces() {
return this.contentValueNamespace; return contentValueNamespace;
} }
public void setContentValueNamespaces(List contentValueNamespace) { public void setContentValueNamespaces(final List contentValueNamespace) {
this.contentValueNamespace = contentValueNamespace; this.contentValueNamespace = contentValueNamespace;
} }
public String getContentResource() { public String getContentResource() {
return this.contentResource; return contentResource;
} }
public void setContentResource(String contentResource) { public void setContentResource(final String contentResource) {
this.contentResource = contentResource; this.contentResource = contentResource;
} }
public boolean equals(Object obj) { @Override
public boolean equals(final Object obj) {
if (obj == null) { if (obj == null) {
return false; return false;
} }
@ -135,68 +136,70 @@ public class ContentItem implements Cloneable {
return false; return false;
} }
final ContentItem other = (ContentItem) obj; final ContentItem other = (ContentItem) obj;
if ((this.contentFormat == null) ? (other.contentFormat != null) : !this.contentFormat.equals(other.contentFormat)) { if (contentFormat == null ? other.contentFormat != null : !contentFormat.equals(other.contentFormat)) {
//System.out.println("format"); // System.out.println("format");
return false; return false;
} }
if ((this.contentEncoding == null) ? (other.contentEncoding != null) : !this.contentEncoding.equals(other.contentEncoding)) { if (contentEncoding == null ? other.contentEncoding != null : !contentEncoding.equals(other.contentEncoding)) {
//System.out.println("enc"); // System.out.println("enc");
return false; return false;
} }
String thisCV = this.contentValue.replaceAll(" xmlns=\"http://www.w3.org/1999/xhtml\"", "").trim();; final String thisCV = contentValue.replaceAll(" xmlns=\"http://www.w3.org/1999/xhtml\"", "").trim();
String thatCV = other.contentValue.replaceAll(" xmlns=\"http://www.w3.org/1999/xhtml\"", "").trim(); ;
if ((this.contentValue == null) ? (other.contentValue != null) : !thisCV.equals(thatCV)) { final String thatCV = other.contentValue.replaceAll(" xmlns=\"http://www.w3.org/1999/xhtml\"", "").trim();
if (contentValue == null ? other.contentValue != null : !thisCV.equals(thatCV)) {
return false; return false;
} }
if (this.contentValueDOM != other.contentValueDOM && (this.contentValueDOM == null || !this.contentValueDOM.equals(other.contentValueDOM))) { if (contentValueDOM != other.contentValueDOM && (contentValueDOM == null || !contentValueDOM.equals(other.contentValueDOM))) {
//System.out.println("vd"); // System.out.println("vd");
return false; return false;
} }
if ((this.contentAbout == null) ? (other.contentAbout != null) : !this.contentAbout.equals(other.contentAbout)) { if (contentAbout == null ? other.contentAbout != null : !contentAbout.equals(other.contentAbout)) {
//System.out.println("abt"); // System.out.println("abt");
return false; return false;
} }
if ((this.contentValueParseType == null) ? (other.contentValueParseType != null) : !this.contentValueParseType.equals(other.contentValueParseType)) { if (contentValueParseType == null ? other.contentValueParseType != null : !contentValueParseType.equals(other.contentValueParseType)) {
//System.out.println("pt"); // System.out.println("pt");
return false; return false;
} }
if (this.contentValueNamespace != other.contentValueNamespace && (this.contentValueNamespace == null || !this.contentValueNamespace.equals(other.contentValueNamespace))) { if (contentValueNamespace != other.contentValueNamespace
//System.out.println("ns"); && (contentValueNamespace == null || !contentValueNamespace.equals(other.contentValueNamespace))) {
// System.out.println("ns");
return false; return false;
} }
if ((this.contentResource == null) ? (other.contentResource != null) : !this.contentResource.equals(other.contentResource)) { if (contentResource == null ? other.contentResource != null : !contentResource.equals(other.contentResource)) {
//System.out.println("res"); // System.out.println("res");
return false; return false;
} }
return true; return true;
} }
@Override
public int hashCode() { public int hashCode() {
int hash = 7; int hash = 7;
hash = 97 * hash + (this.contentFormat != null ? this.contentFormat.hashCode() : 0); hash = 97 * hash + (contentFormat != null ? contentFormat.hashCode() : 0);
hash = 97 * hash + (this.contentEncoding != null ? this.contentEncoding.hashCode() : 0); hash = 97 * hash + (contentEncoding != null ? contentEncoding.hashCode() : 0);
hash = 97 * hash + (this.contentValue != null ? this.contentValue.hashCode() : 0); hash = 97 * hash + (contentValue != null ? contentValue.hashCode() : 0);
hash = 97 * hash + (this.contentValueDOM != null ? this.contentValueDOM.hashCode() : 0); hash = 97 * hash + (contentValueDOM != null ? contentValueDOM.hashCode() : 0);
hash = 97 * hash + (this.contentAbout != null ? this.contentAbout.hashCode() : 0); hash = 97 * hash + (contentAbout != null ? contentAbout.hashCode() : 0);
hash = 97 * hash + (this.contentValueParseType != null ? this.contentValueParseType.hashCode() : 0); hash = 97 * hash + (contentValueParseType != null ? contentValueParseType.hashCode() : 0);
hash = 97 * hash + (this.contentValueNamespace != null ? this.contentValueNamespace.hashCode() : 0); hash = 97 * hash + (contentValueNamespace != null ? contentValueNamespace.hashCode() : 0);
hash = 97 * hash + (this.contentResource != null ? this.contentResource.hashCode() : 0); hash = 97 * hash + (contentResource != null ? contentResource.hashCode() : 0);
return hash; return hash;
} }
@Override
public Object clone() { public Object clone() {
ContentItem o = new ContentItem(); final ContentItem o = new ContentItem();
o.contentAbout = this.contentAbout; o.contentAbout = contentAbout;
o.contentEncoding = this.contentEncoding; o.contentEncoding = contentEncoding;
o.contentFormat = this.contentFormat; o.contentFormat = contentFormat;
o.contentResource = this.contentResource; o.contentResource = contentResource;
o.contentValue = this.contentValue; o.contentValue = contentValue;
o.contentValueDOM = this.contentValueDOM; o.contentValueDOM = contentValueDOM;
o.contentValueNamespace = this.contentValueNamespace; o.contentValueNamespace = contentValueNamespace;
o.contentValueParseType = this.contentValueParseType; o.contentValueParseType = contentValueParseType;
return o; return o;
} }

View file

@ -40,26 +40,28 @@
*/ */
package org.rometools.feed.module.content; package org.rometools.feed.module.content;
import com.sun.syndication.feed.module.Module;
import java.util.List; import java.util.List;
import com.sun.syndication.feed.module.Module;
/** /**
* @version $Revision: 1.1 $ * @version $Revision: 1.1 $
* @author <a href="mailto:cooper@screaming-penguin.com">Robert "kebernet" Cooper</a> * @author <a href="mailto:cooper@screaming-penguin.com">Robert "kebernet" Cooper</a>
*/ */
public interface ContentModule extends Module { public interface ContentModule extends Module {
public static final String URI = "http://purl.org/rss/1.0/modules/content/"; public static final String URI = "http://purl.org/rss/1.0/modules/content/";
public static final String RDF_URI = "http://www.w3.org/1999/02/22-rdf-syntax-ns#"; public static final String RDF_URI = "http://www.w3.org/1999/02/22-rdf-syntax-ns#";
/** Returns a List of Strings containing the New Syntax Encoded values /**
* are in the element. * Returns a List of Strings containing the New Syntax Encoded values are in the element.
*
* @return List of content Strings * @return List of content Strings
*/ */
public List getEncodeds(); public List getEncodeds();
/** Sets a List of Strings containing the New Syntax Encoded values /**
* are in the element. * Sets a List of Strings containing the New Syntax Encoded values are in the element.
*
* @return List of content Strings * @return List of content Strings
*/ */
public void setEncodeds(List encodeds); public void setEncodeds(List encodeds);
@ -68,26 +70,32 @@ public interface ContentModule extends Module {
public String toString(String str); public String toString(String str);
/** Contains a list of ContentItems that represent the "Original Syntax" set. /**
* Contains a list of ContentItems that represent the "Original Syntax" set.
*
* @see com.totsp.xml.syndication.content.ContentItem * @see com.totsp.xml.syndication.content.ContentItem
* @return List of ContentItems. * @return List of ContentItems.
*/ */
public List getContentItems(); public List getContentItems();
/** Contains a list of ContentItems that represent the "Original Syntax" set. /**
* Contains a list of ContentItems that represent the "Original Syntax" set.
*
* @see com.totsp.xml.syndication.content.ContentItem * @see com.totsp.xml.syndication.content.ContentItem
* @param List of ContentItems. * @param List of ContentItems.
*/ */
public void setContentItems(List list); public void setContentItems(List list);
/** Returns a List of Strings containing whatever new or original syntax items /**
* are in the element. * Returns a List of Strings containing whatever new or original syntax items are in the element.
*
* @return List of content Strings * @return List of content Strings
*/ */
public List getContents(); public List getContents();
/** Sets a List of Strings containing whatever new or original syntax items /**
* are in the element. * Sets a List of Strings containing whatever new or original syntax items are in the element.
*
* @return List of content Strings * @return List of content Strings
*/ */
public void setContents(List contents); public void setContents(List contents);

View file

@ -43,14 +43,14 @@
*/ */
package org.rometools.feed.module.content; package org.rometools.feed.module.content;
import com.sun.syndication.feed.CopyFrom;
import java.util.ArrayList; import java.util.ArrayList;
import java.util.List; import java.util.List;
import com.sun.syndication.feed.CopyFrom;
/** /**
* @version $Revision: 1.4 $ * @version $Revision: 1.4 $
* @author <a href="mailto:cooper@screaming-penguin.com">Robert "kebernet" Cooper</a> * @author <a href="mailto:cooper@screaming-penguin.com">Robert "kebernet" Cooper</a>
*/ */
public class ContentModuleImpl extends com.sun.syndication.feed.module.ModuleImpl implements ContentModule { public class ContentModuleImpl extends com.sun.syndication.feed.module.ModuleImpl implements ContentModule {
private List encodeds; private List encodeds;
@ -61,24 +61,24 @@ public class ContentModuleImpl extends com.sun.syndication.feed.module.ModuleImp
super(ContentModuleImpl.class, URI); super(ContentModuleImpl.class, URI);
} }
protected ContentModuleImpl(java.lang.Class beanClass, java.lang.String uri) { protected ContentModuleImpl(final java.lang.Class beanClass, final java.lang.String uri) {
super(beanClass, uri); super(beanClass, uri);
} }
public List getEncodeds() { public List getEncodeds() {
this.encodeds = this.encodeds == null ? new ArrayList() : this.encodeds; encodeds = encodeds == null ? new ArrayList() : encodeds;
return this.encodeds; return encodeds;
} }
public void setEncodeds(List encodeds) { public void setEncodeds(final List encodeds) {
this.encodeds = encodeds; this.encodeds = encodeds;
} }
public void copyFrom(CopyFrom obj) { public void copyFrom(final CopyFrom obj) {
ContentModule cm = (ContentModule) obj; final ContentModule cm = (ContentModule) obj;
this.setEncodeds(cm.getEncodeds()); setEncodeds(cm.getEncodeds());
this.setContentItems(cm.getContentItems()); setContentItems(cm.getContentItems());
this.setContents(cm.getContents()); setContents(cm.getContents());
} }
public Class getInterface() { public Class getInterface() {
@ -86,24 +86,24 @@ public class ContentModuleImpl extends com.sun.syndication.feed.module.ModuleImp
} }
public List getContentItems() { public List getContentItems() {
this.contentItems = this.contentItems == null ? new ArrayList() : this.contentItems; contentItems = contentItems == null ? new ArrayList() : contentItems;
return this.contentItems; return contentItems;
} }
public void setContentItems(List list) { public void setContentItems(final List list) {
this.contentItems = list; contentItems = list;
} }
public List getContents() { public List getContents() {
this.contents = this.contents == null ? new ArrayList() : this.contents; contents = contents == null ? new ArrayList() : contents;
return this.contents; return contents;
} }
public void setContents(List contents) { public void setContents(final List contents) {
this.contents = contents; this.contents = contents;
} }
public String toString(String str) { public String toString(final String str) {
return contentItems.toString(); return contentItems.toString();
} }
} }

View file

@ -41,23 +41,23 @@
*/ */
package org.rometools.feed.module.content.io; package org.rometools.feed.module.content.io;
import org.rometools.feed.module.content.ContentItem;
import org.rometools.feed.module.content.ContentModule;
import org.jdom.Attribute;
import org.jdom.CDATA;
import org.jdom.Content;
import org.jdom.Element;
import org.jdom.Namespace;
import java.util.ArrayList; import java.util.ArrayList;
import java.util.Collections; import java.util.Collections;
import java.util.HashSet; import java.util.HashSet;
import java.util.List; import java.util.List;
import java.util.Set; import java.util.Set;
import org.jdom2.Attribute;
import org.jdom2.CDATA;
import org.jdom2.Content;
import org.jdom2.Element;
import org.jdom2.Namespace;
import org.rometools.feed.module.content.ContentItem;
import org.rometools.feed.module.content.ContentModule;
/** /**
* @version $Revision: 1.2 $ * @version $Revision: 1.2 $
* @author <a href="mailto:cooper@screaming-penguin.com">Robert "kebernet" Cooper</a> * @author <a href="mailto:cooper@screaming-penguin.com">Robert "kebernet" Cooper</a>
*/ */
public class ContentModuleGenerator implements com.sun.syndication.io.ModuleGenerator { public class ContentModuleGenerator implements com.sun.syndication.io.ModuleGenerator {
private static final Namespace CONTENT_NS = Namespace.getNamespace("content", ContentModule.URI); private static final Namespace CONTENT_NS = Namespace.getNamespace("content", ContentModule.URI);
@ -65,7 +65,7 @@ public class ContentModuleGenerator implements com.sun.syndication.io.ModuleGene
private static final Set NAMESPACES; private static final Set NAMESPACES;
static { static {
Set nss = new HashSet(); final Set nss = new HashSet();
nss.add(CONTENT_NS); nss.add(CONTENT_NS);
NAMESPACES = Collections.unmodifiableSet(nss); NAMESPACES = Collections.unmodifiableSet(nss);
} }
@ -74,11 +74,11 @@ public class ContentModuleGenerator implements com.sun.syndication.io.ModuleGene
public ContentModuleGenerator() { public ContentModuleGenerator() {
} }
public void generate(com.sun.syndication.feed.module.Module module, org.jdom.Element element) { public void generate(final com.sun.syndication.feed.module.Module module, final org.jdom2.Element element) {
// this is not necessary, it is done to avoid the namespace definition in every item. // this is not necessary, it is done to avoid the namespace definition in every item.
Element root = element; Element root = element;
while ((root.getParent() != null) && root.getParent() instanceof Element) { while (root.getParent() != null && root.getParent() instanceof Element) {
root = (Element) root.getParent(); root = (Element) root.getParent();
} }
@ -88,10 +88,10 @@ public class ContentModuleGenerator implements com.sun.syndication.io.ModuleGene
return; return;
} }
ContentModule cm = (ContentModule) module; final ContentModule cm = (ContentModule) module;
final List encodeds = cm.getEncodeds();
List encodeds = cm.getEncodeds();
// //
if (encodeds != null) { if (encodeds != null) {
System.out.println(cm.getEncodeds().size()); System.out.println(cm.getEncodeds().size());
@ -100,61 +100,60 @@ public class ContentModuleGenerator implements com.sun.syndication.io.ModuleGene
} }
} }
List contentItems = cm.getContentItems(); final List contentItems = cm.getContentItems();
if ((contentItems != null) && (contentItems.size() > 0)) { if (contentItems != null && contentItems.size() > 0) {
Element items = new Element("items", CONTENT_NS); final Element items = new Element("items", CONTENT_NS);
Element bag = new Element("Bag", RDF_NS); final Element bag = new Element("Bag", RDF_NS);
items.addContent(bag); items.addContent(bag);
for (int i = 0; i < contentItems.size(); i++) { for (int i = 0; i < contentItems.size(); i++) {
ContentItem contentItem = (ContentItem) contentItems.get(i); final ContentItem contentItem = (ContentItem) contentItems.get(i);
Element li = new Element("li", RDF_NS); final Element li = new Element("li", RDF_NS);
Element item = new Element("item", CONTENT_NS); final Element item = new Element("item", CONTENT_NS);
if (contentItem.getContentAbout() != null) { if (contentItem.getContentAbout() != null) {
Attribute about = new Attribute("about", contentItem.getContentAbout(), RDF_NS); final Attribute about = new Attribute("about", contentItem.getContentAbout(), RDF_NS);
item.setAttribute(about); item.setAttribute(about);
} }
if (contentItem.getContentFormat() != null) { if (contentItem.getContentFormat() != null) {
//System.out.println( "Format"); // System.out.println( "Format");
Element format = new Element("format", CONTENT_NS); final Element format = new Element("format", CONTENT_NS);
Attribute formatResource = new Attribute("resource", contentItem.getContentFormat(), RDF_NS); final Attribute formatResource = new Attribute("resource", contentItem.getContentFormat(), RDF_NS);
format.setAttribute(formatResource); format.setAttribute(formatResource);
item.addContent(format); item.addContent(format);
} }
if (contentItem.getContentEncoding() != null) { if (contentItem.getContentEncoding() != null) {
//System.out.println( "Encoding"); // System.out.println( "Encoding");
Element encoding = new Element("encoding", CONTENT_NS); final Element encoding = new Element("encoding", CONTENT_NS);
Attribute encodingResource = new Attribute("resource", contentItem.getContentEncoding(), RDF_NS); final Attribute encodingResource = new Attribute("resource", contentItem.getContentEncoding(), RDF_NS);
encoding.setAttribute(encodingResource); encoding.setAttribute(encodingResource);
item.addContent(encoding); item.addContent(encoding);
} }
if (contentItem.getContentValue() != null) { if (contentItem.getContentValue() != null) {
Element value = new Element("value", RDF_NS); final Element value = new Element("value", RDF_NS);
if (contentItem.getContentValueParseType() != null) { if (contentItem.getContentValueParseType() != null) {
Attribute parseType = new Attribute("parseType", contentItem.getContentValueParseType(), RDF_NS); final Attribute parseType = new Attribute("parseType", contentItem.getContentValueParseType(), RDF_NS);
value.setAttribute(parseType); value.setAttribute(parseType);
} }
if (contentItem.getContentValueNamespaces() != null) { if (contentItem.getContentValueNamespaces() != null) {
List namespaces = contentItem.getContentValueNamespaces(); final List namespaces = contentItem.getContentValueNamespaces();
for (int ni = 0; ni < namespaces.size(); ni++) { for (int ni = 0; ni < namespaces.size(); ni++) {
value.addNamespaceDeclaration((Namespace) namespaces.get(ni)); value.addNamespaceDeclaration((Namespace) namespaces.get(ni));
} }
} }
List detached = new ArrayList(); final List detached = new ArrayList();
for (int c = 0; for (int c = 0; c < contentItem.getContentValueDOM().size(); c++) {
c < contentItem.getContentValueDOM().size(); c++) { detached.add(((Content) contentItem.getContentValueDOM().get(c)).clone().detach());
detached.add(((Content) ((Content) contentItem.getContentValueDOM().get(c)).clone()).detach());
} }
value.setContent(detached); value.setContent(detached);
@ -163,22 +162,22 @@ public class ContentModuleGenerator implements com.sun.syndication.io.ModuleGene
li.addContent(item); li.addContent(item);
bag.addContent(li); bag.addContent(li);
} //end contentItems loop } // end contentItems loop
element.addContent(items); element.addContent(items);
} }
} }
protected Element generateSimpleElement(String name, String value) { protected Element generateSimpleElement(final String name, final String value) {
Element element = new Element(name, CONTENT_NS); final Element element = new Element(name, CONTENT_NS);
element.addContent(value); element.addContent(value);
return element; return element;
} }
protected Element generateCDATAElement(String name, String value) { protected Element generateCDATAElement(final String name, final String value) {
Element element = new Element(name, CONTENT_NS); final Element element = new Element(name, CONTENT_NS);
CDATA cdata = new CDATA(value); final CDATA cdata = new CDATA(value);
element.addContent(cdata); element.addContent(cdata);
return element; return element;

View file

@ -43,20 +43,20 @@
*/ */
package org.rometools.feed.module.content.io; package org.rometools.feed.module.content.io;
import java.util.ArrayList;
import java.util.List;
import org.jdom2.Attribute;
import org.jdom2.Element;
import org.jdom2.Namespace;
import org.jdom2.output.XMLOutputter;
import org.rometools.feed.module.content.ContentItem; import org.rometools.feed.module.content.ContentItem;
import org.rometools.feed.module.content.ContentModule; import org.rometools.feed.module.content.ContentModule;
import org.rometools.feed.module.content.ContentModuleImpl; import org.rometools.feed.module.content.ContentModuleImpl;
import org.jdom.Attribute;
import org.jdom.Element;
import org.jdom.Namespace;
import org.jdom.output.XMLOutputter;
import java.util.ArrayList;
import java.util.List;
/** /**
* @version $Revision: 1.3 $ * @version $Revision: 1.3 $
* @author <a href="mailto:cooper@screaming-penguin.com">Robert "kebernet" Cooper</a> * @author <a href="mailto:cooper@screaming-penguin.com">Robert "kebernet" Cooper</a>
*/ */
public class ContentModuleParser implements com.sun.syndication.io.ModuleParser { public class ContentModuleParser implements com.sun.syndication.io.ModuleParser {
private static final Namespace CONTENT_NS = Namespace.getNamespace("content", ContentModule.URI); private static final Namespace CONTENT_NS = Namespace.getNamespace("content", ContentModule.URI);
@ -70,45 +70,45 @@ public class ContentModuleParser implements com.sun.syndication.io.ModuleParser
return ContentModule.URI; return ContentModule.URI;
} }
public com.sun.syndication.feed.module.Module parse(org.jdom.Element element) { public com.sun.syndication.feed.module.Module parse(final org.jdom2.Element element) {
boolean foundSomething = false; boolean foundSomething = false;
ContentModule cm = new ContentModuleImpl(); final ContentModule cm = new ContentModuleImpl();
List encodeds = element.getChildren("encoded", CONTENT_NS); final List encodeds = element.getChildren("encoded", CONTENT_NS);
ArrayList contentStrings = new ArrayList(); final ArrayList contentStrings = new ArrayList();
ArrayList encodedStrings = new ArrayList(); final ArrayList encodedStrings = new ArrayList();
if (encodeds.size() > 0) { if (encodeds.size() > 0) {
foundSomething = true; foundSomething = true;
for (int i = 0; i < encodeds.size(); i++) { for (int i = 0; i < encodeds.size(); i++) {
Element encodedElement = (Element) encodeds.get(i); final Element encodedElement = (Element) encodeds.get(i);
encodedStrings.add(encodedElement.getText()); encodedStrings.add(encodedElement.getText());
contentStrings.add(encodedElement.getText()); contentStrings.add(encodedElement.getText());
} }
} }
ArrayList contentItems = new ArrayList(); final ArrayList contentItems = new ArrayList();
List items = element.getChildren("items", CONTENT_NS); final List items = element.getChildren("items", CONTENT_NS);
for (int i = 0; i < items.size(); i++) { for (int i = 0; i < items.size(); i++) {
foundSomething = true; foundSomething = true;
List lis = ((Element) items.get(i)).getChild("Bag", RDF_NS).getChildren("li", RDF_NS); final List lis = ((Element) items.get(i)).getChild("Bag", RDF_NS).getChildren("li", RDF_NS);
for (int j = 0; j < lis.size(); j++) { for (int j = 0; j < lis.size(); j++) {
ContentItem ci = new ContentItem(); final ContentItem ci = new ContentItem();
Element li = (Element) lis.get(j); final Element li = (Element) lis.get(j);
Element item = li.getChild("item", CONTENT_NS); final Element item = li.getChild("item", CONTENT_NS);
Element format = item.getChild("format", CONTENT_NS); final Element format = item.getChild("format", CONTENT_NS);
Element encoding = item.getChild("encoding", CONTENT_NS); final Element encoding = item.getChild("encoding", CONTENT_NS);
Element value = item.getChild("value", RDF_NS); final Element value = item.getChild("value", RDF_NS);
if (value != null) { if (value != null) {
if (value.getAttributeValue("parseType", RDF_NS) != null) { if (value.getAttributeValue("parseType", RDF_NS) != null) {
ci.setContentValueParseType(value.getAttributeValue("parseType", RDF_NS)); ci.setContentValueParseType(value.getAttributeValue("parseType", RDF_NS));
} }
if ((ci.getContentValueParseType() != null) && ci.getContentValueParseType().equals("Literal")) { if (ci.getContentValueParseType() != null && ci.getContentValueParseType().equals("Literal")) {
ci.setContentValue(getXmlInnerText(value)); ci.setContentValue(getXmlInnerText(value));
contentStrings.add(getXmlInnerText(value)); contentStrings.add(getXmlInnerText(value));
ci.setContentValueNamespaces(value.getAdditionalNamespaces()); ci.setContentValueNamespaces(value.getAdditionalNamespaces());
@ -117,7 +117,7 @@ public class ContentModuleParser implements com.sun.syndication.io.ModuleParser
contentStrings.add(value.getText()); contentStrings.add(value.getText());
} }
ci.setContentValueDOM(((Element) value.clone()).getContent()); ci.setContentValueDOM(value.clone().getContent());
} }
if (format != null) { if (format != null) {
@ -129,7 +129,7 @@ public class ContentModuleParser implements com.sun.syndication.io.ModuleParser
} }
if (item != null) { if (item != null) {
Attribute about = item.getAttribute("about", RDF_NS); final Attribute about = item.getAttribute("about", RDF_NS);
if (about != null) { if (about != null) {
ci.setContentAbout(about.getValue()); ci.setContentAbout(about.getValue());
@ -144,13 +144,13 @@ public class ContentModuleParser implements com.sun.syndication.io.ModuleParser
cm.setContentItems(contentItems); cm.setContentItems(contentItems);
cm.setContents(contentStrings); cm.setContents(contentStrings);
return (foundSomething) ? cm : null; return foundSomething ? cm : null;
} }
protected String getXmlInnerText(Element e) { protected String getXmlInnerText(final Element e) {
StringBuffer sb = new StringBuffer(); final StringBuffer sb = new StringBuffer();
XMLOutputter xo = new XMLOutputter(); final XMLOutputter xo = new XMLOutputter();
List children = e.getContent(); final List children = e.getContent();
sb.append(xo.outputString(children)); sb.append(xo.outputString(children));
return sb.toString(); return sb.toString();

View file

@ -23,25 +23,25 @@ import com.sun.syndication.feed.module.Module;
/** /**
* Interface for the FeedBurner RSS extension. * Interface for the FeedBurner RSS extension.
* *
* @version 1.0 * @version 1.0
* @author Georg Schmidl <georg.schmidl@scandio.de> * @author Georg Schmidl <georg.schmidl@scandio.de>
* *
*/ */
public interface FeedBurner extends Module, Serializable, Cloneable { public interface FeedBurner extends Module, Serializable, Cloneable {
public static final String URI = "http://rssnamespace.org/feedburner/ext/1.0"; public static final String URI = "http://rssnamespace.org/feedburner/ext/1.0";
public String getAwareness(); public String getAwareness();
public void setAwareness(String awareness); public void setAwareness(String awareness);
public String getOrigLink(); public String getOrigLink();
public void setOrigLink(String origLink); public void setOrigLink(String origLink);
public String getOrigEnclosureLink(); public String getOrigEnclosureLink();
public void setOrigEnclosureLink(String origEnclosureLink); public void setOrigEnclosureLink(String origEnclosureLink);
} }

View file

@ -21,61 +21,62 @@ import com.sun.syndication.feed.CopyFrom;
/** /**
* Implementation of the FeedBurner RSS extension. * Implementation of the FeedBurner RSS extension.
* *
* @version 1.0 * @version 1.0
* @author Georg Schmidl <georg.schmidl@scandio.de> * @author Georg Schmidl <georg.schmidl@scandio.de>
* *
*/ */
public class FeedBurnerImpl implements FeedBurner { public class FeedBurnerImpl implements FeedBurner {
private static final long serialVersionUID = 4595722221441468838L; private static final long serialVersionUID = 4595722221441468838L;
private String awareness; private String awareness;
private String origLink; private String origLink;
private String origEnclosureLink; private String origEnclosureLink;
public String getAwareness() { public String getAwareness() {
return awareness; return awareness;
} }
public void setAwareness(String awareness) { public void setAwareness(final String awareness) {
this.awareness = awareness; this.awareness = awareness;
} }
public String getOrigLink() { public String getOrigLink() {
return origLink; return origLink;
} }
public void setOrigLink(String origLink) { public void setOrigLink(final String origLink) {
this.origLink = origLink; this.origLink = origLink;
} }
public String getOrigEnclosureLink() { public String getOrigEnclosureLink() {
return origEnclosureLink; return origEnclosureLink;
} }
public void setOrigEnclosureLink(String origEnclosureLink) { public void setOrigEnclosureLink(final String origEnclosureLink) {
this.origEnclosureLink = origEnclosureLink; this.origEnclosureLink = origEnclosureLink;
} }
public String getUri() { public String getUri() {
return FeedBurner.URI; return FeedBurner.URI;
} }
public void copyFrom(CopyFrom object) { public void copyFrom(final CopyFrom object) {
FeedBurner source = (FeedBurner) object; final FeedBurner source = (FeedBurner) object;
this.setAwareness(source.getAwareness()); setAwareness(source.getAwareness());
this.setOrigLink(source.getOrigLink()); setOrigLink(source.getOrigLink());
this.setOrigEnclosureLink(source.getOrigEnclosureLink()); setOrigEnclosureLink(source.getOrigEnclosureLink());
} }
public Class getInterface() { public Class getInterface() {
return FeedBurner.class; return FeedBurner.class;
} }
public Object clone() { @Override
FeedBurnerImpl fbi = new FeedBurnerImpl(); public Object clone() {
fbi.copyFrom( this ); final FeedBurnerImpl fbi = new FeedBurnerImpl();
return fbi; fbi.copyFrom(this);
return fbi;
} }
} }

View file

@ -16,24 +16,22 @@
*/ */
package org.rometools.feed.module.feedburner.io; package org.rometools.feed.module.feedburner.io;
import com.sun.syndication.feed.module.Module;
import com.sun.syndication.io.ModuleGenerator;
import org.jdom.Element;
import org.jdom.Namespace;
import org.rometools.feed.module.feedburner.FeedBurner;
import java.util.HashSet; import java.util.HashSet;
import java.util.Set; import java.util.Set;
import org.jdom2.Element;
import org.jdom2.Namespace;
import org.rometools.feed.module.feedburner.FeedBurner;
import com.sun.syndication.feed.module.Module;
import com.sun.syndication.io.ModuleGenerator;
/** /**
* ModuleGenerator implementation for the FeedBurner RSS extension. * ModuleGenerator implementation for the FeedBurner RSS extension.
* *
* @version 1.0 * @version 1.0
* @author Georg Schmidl <georg.schmidl@scandio.de> * @author Georg Schmidl <georg.schmidl@scandio.de>
* *
*/ */
public class FeedBurnerModuleGenerator implements ModuleGenerator { public class FeedBurnerModuleGenerator implements ModuleGenerator {
private static final Namespace NS = Namespace.getNamespace("feedburner", FeedBurner.URI); private static final Namespace NS = Namespace.getNamespace("feedburner", FeedBurner.URI);
@ -43,34 +41,34 @@ public class FeedBurnerModuleGenerator implements ModuleGenerator {
} }
public Set getNamespaces() { public Set getNamespaces() {
HashSet set = new HashSet(); final HashSet set = new HashSet();
set.add(FeedBurnerModuleGenerator.NS); set.add(FeedBurnerModuleGenerator.NS);
return set; return set;
} }
public void generate(Module module, Element element) { public void generate(final Module module, final Element element) {
if (!(module instanceof FeedBurner)) { if (!(module instanceof FeedBurner)) {
return; return;
} }
FeedBurner feedBurner = (FeedBurner) module; final FeedBurner feedBurner = (FeedBurner) module;
if (feedBurner.getAwareness() != null) { if (feedBurner.getAwareness() != null) {
element.addContent(this.generateSimpleElement("awareness", feedBurner.getAwareness())); element.addContent(generateSimpleElement("awareness", feedBurner.getAwareness()));
} }
if (feedBurner.getOrigLink() != null) { if (feedBurner.getOrigLink() != null) {
element.addContent(this.generateSimpleElement("origLink", feedBurner.getOrigLink())); element.addContent(generateSimpleElement("origLink", feedBurner.getOrigLink()));
} }
if (feedBurner.getOrigEnclosureLink() != null) { if (feedBurner.getOrigEnclosureLink() != null) {
element.addContent(this.generateSimpleElement("origEnclosureLink", feedBurner.getOrigEnclosureLink())); element.addContent(generateSimpleElement("origEnclosureLink", feedBurner.getOrigEnclosureLink()));
} }
} }
protected Element generateSimpleElement(String name, String value) { protected Element generateSimpleElement(final String name, final String value) {
Element element = new Element(name, FeedBurnerModuleGenerator.NS); final Element element = new Element(name, FeedBurnerModuleGenerator.NS);
element.addContent(value); element.addContent(value);
return element; return element;

View file

@ -16,22 +16,20 @@
*/ */
package org.rometools.feed.module.feedburner.io; package org.rometools.feed.module.feedburner.io;
import com.sun.syndication.feed.module.Module; import org.jdom2.Element;
import com.sun.syndication.io.ModuleParser; import org.jdom2.Namespace;
import org.jdom.Element;
import org.jdom.Namespace;
import org.rometools.feed.module.feedburner.FeedBurner; import org.rometools.feed.module.feedburner.FeedBurner;
import org.rometools.feed.module.feedburner.FeedBurnerImpl; import org.rometools.feed.module.feedburner.FeedBurnerImpl;
import com.sun.syndication.feed.module.Module;
import com.sun.syndication.io.ModuleParser;
/** /**
* ModuleParser implementation for the FeedBurner RSS extension. * ModuleParser implementation for the FeedBurner RSS extension.
* *
* @version 1.0 * @version 1.0
* @author Georg Schmidl <georg.schmidl@scandio.de> * @author Georg Schmidl <georg.schmidl@scandio.de>
* *
*/ */
public class FeedBurnerModuleParser implements ModuleParser { public class FeedBurnerModuleParser implements ModuleParser {
private static final Namespace NS = Namespace.getNamespace(FeedBurner.URI); private static final Namespace NS = Namespace.getNamespace(FeedBurner.URI);
@ -40,8 +38,8 @@ public class FeedBurnerModuleParser implements ModuleParser {
return FeedBurner.URI; return FeedBurner.URI;
} }
public Module parse(Element element) { public Module parse(final Element element) {
FeedBurnerImpl fbi = new FeedBurnerImpl(); final FeedBurnerImpl fbi = new FeedBurnerImpl();
boolean returnObj = false; boolean returnObj = false;
Element tag = element.getChild("awareness", FeedBurnerModuleParser.NS); Element tag = element.getChild("awareness", FeedBurnerModuleParser.NS);

View file

@ -16,67 +16,78 @@
*/ */
package org.rometools.feed.module.georss; package org.rometools.feed.module.georss;
import java.util.*; import java.util.Collections;
import java.util.HashSet;
import java.util.Iterator;
import java.util.List;
import java.util.Set;
import org.jdom.Element; import org.jdom2.Element;
import org.rometools.feed.module.georss.geometries.AbstractGeometry;
import org.rometools.feed.module.georss.geometries.AbstractRing;
import org.rometools.feed.module.georss.geometries.Envelope;
import org.rometools.feed.module.georss.geometries.LineString;
import org.rometools.feed.module.georss.geometries.LinearRing;
import org.rometools.feed.module.georss.geometries.Point;
import org.rometools.feed.module.georss.geometries.Polygon;
import org.rometools.feed.module.georss.geometries.Position;
import org.rometools.feed.module.georss.geometries.PositionList;
import com.sun.syndication.feed.module.Module; import com.sun.syndication.feed.module.Module;
import com.sun.syndication.io.ModuleGenerator; import com.sun.syndication.io.ModuleGenerator;
import org.rometools.feed.module.georss.geometries.*;
/** /**
* GMLGenerator produces georss elements in georss GML format. * GMLGenerator produces georss elements in georss GML format.
* *
* @author Marc Wick * @author Marc Wick
* @version $Id: GMLGenerator.java,v 1.1 2007/04/18 09:59:29 marcwick Exp $ * @version $Id: GMLGenerator.java,v 1.1 2007/04/18 09:59:29 marcwick Exp $
* *
*/ */
public class GMLGenerator implements ModuleGenerator { public class GMLGenerator implements ModuleGenerator {
private static final Set NAMESPACES; private static final Set NAMESPACES;
static { static {
Set nss = new HashSet(); final Set nss = new HashSet();
nss.add(GeoRSSModule.GML_NS); nss.add(GeoRSSModule.GML_NS);
NAMESPACES = Collections.unmodifiableSet(nss); NAMESPACES = Collections.unmodifiableSet(nss);
} }
private Element createPosListElement(PositionList posList) { private Element createPosListElement(final PositionList posList) {
Element posElement = new Element("posList", GeoRSSModule.GML_NS); final Element posElement = new Element("posList", GeoRSSModule.GML_NS);
StringBuffer sb = new StringBuffer(); final StringBuffer sb = new StringBuffer();
for (int i=0; i<posList.size(); ++i) for (int i = 0; i < posList.size(); ++i) {
sb.append(posList.getLatitude(i)).append(" ").append(posList.getLongitude(i)).append(" "); sb.append(posList.getLatitude(i)).append(" ").append(posList.getLongitude(i)).append(" ");
}
posElement.addContent(sb.toString()); posElement.addContent(sb.toString());
return posElement; return posElement;
} }
/* /*
* (non-Javadoc) * (non-Javadoc)
* *
* @see com.sun.syndication.io.ModuleGenerator#getNamespaceUri() * @see com.sun.syndication.io.ModuleGenerator#getNamespaceUri()
*/ */
public String getNamespaceUri() { public String getNamespaceUri() {
return GeoRSSModule.GEORSS_GML_URI; return GeoRSSModule.GEORSS_GML_URI;
} }
/* /*
* (non-Javadoc) * (non-Javadoc)
* *
* @see com.sun.syndication.io.ModuleGenerator#getNamespaces() * @see com.sun.syndication.io.ModuleGenerator#getNamespaces()
*/ */
public Set getNamespaces() { public Set getNamespaces() {
return NAMESPACES; return NAMESPACES;
} }
/* /*
* (non-Javadoc) * (non-Javadoc)
* *
* @see com.sun.syndication.io.ModuleGenerator#generate(com.sun.syndication.feed.module.Module, * @see com.sun.syndication.io.ModuleGenerator#generate(com.sun.syndication.feed.module.Module, org.jdom2.Element)
* org.jdom.Element) */
*/ public void generate(final Module module, final Element element) {
public void generate(Module module, Element element) {
// this is not necessary, it is done to avoid the namespace definition // this is not necessary, it is done to avoid the namespace definition
// in every item. // in every item.
Element root = element; Element root = element;
@ -85,77 +96,74 @@ public class GMLGenerator implements ModuleGenerator {
} }
root.addNamespaceDeclaration(GeoRSSModule.SIMPLE_NS); root.addNamespaceDeclaration(GeoRSSModule.SIMPLE_NS);
root.addNamespaceDeclaration(GeoRSSModule.GML_NS); root.addNamespaceDeclaration(GeoRSSModule.GML_NS);
Element whereElement= new Element("where", GeoRSSModule.SIMPLE_NS); final Element whereElement = new Element("where", GeoRSSModule.SIMPLE_NS);
element.addContent(whereElement); element.addContent(whereElement);
GeoRSSModule geoRSSModule = (GeoRSSModule) module; final GeoRSSModule geoRSSModule = (GeoRSSModule) module;
AbstractGeometry geometry = geoRSSModule.getGeometry(); final AbstractGeometry geometry = geoRSSModule.getGeometry();
if (geometry instanceof Point) { if (geometry instanceof Point) {
Position pos = ((Point)geometry).getPosition(); final Position pos = ((Point) geometry).getPosition();
Element pointElement = new Element("Point", GeoRSSModule.GML_NS); final Element pointElement = new Element("Point", GeoRSSModule.GML_NS);
whereElement.addContent(pointElement); whereElement.addContent(pointElement);
Element posElement = new Element("pos", GeoRSSModule.GML_NS); final Element posElement = new Element("pos", GeoRSSModule.GML_NS);
posElement.addContent(String.valueOf(pos.getLatitude()) + " " posElement.addContent(String.valueOf(pos.getLatitude()) + " " + String.valueOf(pos.getLongitude()));
+ String.valueOf(pos.getLongitude()));
pointElement.addContent(posElement); pointElement.addContent(posElement);
} }
else if (geometry instanceof LineString) { else if (geometry instanceof LineString) {
PositionList posList = ((LineString) geometry).getPositionList(); final PositionList posList = ((LineString) geometry).getPositionList();
Element lineElement = new Element("LineString", GeoRSSModule.GML_NS); final Element lineElement = new Element("LineString", GeoRSSModule.GML_NS);
lineElement.addContent(createPosListElement(posList)); lineElement.addContent(createPosListElement(posList));
whereElement.addContent(lineElement); whereElement.addContent(lineElement);
} else if (geometry instanceof Polygon) { } else if (geometry instanceof Polygon) {
Element polygonElement = new Element("Polygon", GeoRSSModule.GML_NS); final Element polygonElement = new Element("Polygon", GeoRSSModule.GML_NS);
{ {
AbstractRing ring = ((Polygon) geometry).getExterior(); final AbstractRing ring = ((Polygon) geometry).getExterior();
if (ring instanceof LinearRing) { if (ring instanceof LinearRing) {
Element exteriorElement = new Element("exterior", GeoRSSModule.GML_NS); final Element exteriorElement = new Element("exterior", GeoRSSModule.GML_NS);
polygonElement.addContent(exteriorElement); polygonElement.addContent(exteriorElement);
Element ringElement = new Element("LinearRing", GeoRSSModule.GML_NS); final Element ringElement = new Element("LinearRing", GeoRSSModule.GML_NS);
exteriorElement.addContent(ringElement); exteriorElement.addContent(ringElement);
ringElement.addContent(createPosListElement(((LinearRing) ring).getPositionList())); ringElement.addContent(createPosListElement(((LinearRing) ring).getPositionList()));
} else { } else {
System.err.println("GeoRSS GML format can't handle rings of type: " + ring.getClass().getName()); System.err.println("GeoRSS GML format can't handle rings of type: " + ring.getClass().getName());
} }
} }
List interiorList = ((Polygon) geometry).getInterior(); final List interiorList = ((Polygon) geometry).getInterior();
Iterator it = interiorList.iterator(); final Iterator it = interiorList.iterator();
while (it.hasNext()) { while (it.hasNext()) {
AbstractRing ring = (AbstractRing)it.next(); final AbstractRing ring = (AbstractRing) it.next();
if (ring instanceof LinearRing) { if (ring instanceof LinearRing) {
Element interiorElement = new Element("interior", GeoRSSModule.GML_NS); final Element interiorElement = new Element("interior", GeoRSSModule.GML_NS);
polygonElement.addContent(interiorElement); polygonElement.addContent(interiorElement);
Element ringElement = new Element("LinearRing", GeoRSSModule.GML_NS); final Element ringElement = new Element("LinearRing", GeoRSSModule.GML_NS);
interiorElement.addContent(ringElement); interiorElement.addContent(ringElement);
ringElement.addContent(createPosListElement(((LinearRing) ring).getPositionList())); ringElement.addContent(createPosListElement(((LinearRing) ring).getPositionList()));
} else { } else {
System.err.println("GeoRSS GML format can't handle rings of type: " + ring.getClass().getName()); System.err.println("GeoRSS GML format can't handle rings of type: " + ring.getClass().getName());
} }
} }
whereElement.addContent(polygonElement); whereElement.addContent(polygonElement);
} else if (geometry instanceof Envelope) { } else if (geometry instanceof Envelope) {
Envelope envelope = (Envelope)geometry; final Envelope envelope = (Envelope) geometry;
Element envelopeElement = new Element("Envelope", GeoRSSModule.GML_NS); final Element envelopeElement = new Element("Envelope", GeoRSSModule.GML_NS);
whereElement.addContent(envelopeElement); whereElement.addContent(envelopeElement);
Element lowerElement = new Element("lowerCorner", GeoRSSModule.GML_NS); final Element lowerElement = new Element("lowerCorner", GeoRSSModule.GML_NS);
lowerElement.addContent(String.valueOf(envelope.getMinLatitude()) + " " lowerElement.addContent(String.valueOf(envelope.getMinLatitude()) + " " + String.valueOf(envelope.getMinLongitude()));
+ String.valueOf(envelope.getMinLongitude()));
envelopeElement.addContent(lowerElement); envelopeElement.addContent(lowerElement);
Element upperElement = new Element("upperCorner", GeoRSSModule.GML_NS); final Element upperElement = new Element("upperCorner", GeoRSSModule.GML_NS);
upperElement.addContent(String.valueOf(envelope.getMaxLatitude()) + " " upperElement.addContent(String.valueOf(envelope.getMaxLatitude()) + " " + String.valueOf(envelope.getMaxLongitude()));
+ String.valueOf(envelope.getMaxLongitude()));
envelopeElement.addContent(upperElement); envelopeElement.addContent(upperElement);
} else { } else {
System.err.println("GeoRSS GML format can't handle geometries of type: " + geometry.getClass().getName()); System.err.println("GeoRSS GML format can't handle geometries of type: " + geometry.getClass().getName());
} }

View file

@ -17,8 +17,7 @@
package org.rometools.feed.module.georss; package org.rometools.feed.module.georss;
/** /**
* GMLModuleImpl is the implementation of the {@link GeoRSSModule} Interface * GMLModuleImpl is the implementation of the {@link GeoRSSModule} Interface for the gml GeoRSS format.
* for the gml GeoRSS format.
* *
* @author Marc Wick * @author Marc Wick
* @version $Id: GMLModuleImpl.java,v 1.1 2007/04/18 09:59:29 marcwick Exp $ * @version $Id: GMLModuleImpl.java,v 1.1 2007/04/18 09:59:29 marcwick Exp $
@ -26,17 +25,16 @@ package org.rometools.feed.module.georss;
*/ */
public class GMLModuleImpl extends GeoRSSModule { public class GMLModuleImpl extends GeoRSSModule {
public GMLModuleImpl() { public GMLModuleImpl() {
super(GeoRSSModule.class, GeoRSSModule.GEORSS_GML_URI); super(GeoRSSModule.class, GeoRSSModule.GEORSS_GML_URI);
} }
/*
/* * (non-Javadoc)
* (non-Javadoc) *
* * @see com.sun.syndication.feed.CopyFrom#getInterface()
* @see com.sun.syndication.feed.CopyFrom#getInterface() */
*/ public Class getInterface() {
public Class getInterface() { return GeoRSSModule.class;
return GeoRSSModule.class; }
}
} }

View file

@ -16,140 +16,139 @@
*/ */
package org.rometools.feed.module.georss; package org.rometools.feed.module.georss;
import org.jdom.Element; import java.util.Iterator;
import java.util.List;
import com.sun.syndication.feed.module.Module; import org.jdom2.Element;
import org.rometools.feed.module.georss.geometries.Envelope;
import org.rometools.feed.module.georss.geometries.LineString; import org.rometools.feed.module.georss.geometries.LineString;
import org.rometools.feed.module.georss.geometries.LinearRing; import org.rometools.feed.module.georss.geometries.LinearRing;
import org.rometools.feed.module.georss.geometries.Point; import org.rometools.feed.module.georss.geometries.Point;
import org.rometools.feed.module.georss.geometries.Polygon; import org.rometools.feed.module.georss.geometries.Polygon;
import org.rometools.feed.module.georss.geometries.Envelope;
import org.rometools.feed.module.georss.geometries.Position; import org.rometools.feed.module.georss.geometries.Position;
import org.rometools.feed.module.georss.geometries.PositionList; import org.rometools.feed.module.georss.geometries.PositionList;
import com.sun.syndication.io.ModuleParser;
import java.util.*; import com.sun.syndication.feed.module.Module;
import com.sun.syndication.io.ModuleParser;
/** /**
* GMLParser is a parser for the GML georss format. * GMLParser is a parser for the GML georss format.
* *
* @author Marc Wick * @author Marc Wick
* @version $Id: GMLParser.java,v 1.2 2007/06/05 20:44:53 marcwick Exp $ * @version $Id: GMLParser.java,v 1.2 2007/06/05 20:44:53 marcwick Exp $
* *
*/ */
public class GMLParser implements ModuleParser { public class GMLParser implements ModuleParser {
/* /*
* (non-Javadoc) * (non-Javadoc)
* *
* @see com.sun.syndication.io.ModuleParser#getNamespaceUri() * @see com.sun.syndication.io.ModuleParser#getNamespaceUri()
*/ */
public String getNamespaceUri() { public String getNamespaceUri() {
return GeoRSSModule.GEORSS_GEORSS_URI; return GeoRSSModule.GEORSS_GEORSS_URI;
} }
/* /*
* (non-Javadoc) * (non-Javadoc)
* *
* @see com.sun.syndication.io.ModuleParser#parse(org.jdom.Element) * @see com.sun.syndication.io.ModuleParser#parse(org.jdom2.Element)
*/ */
public Module parse(Element element) { public Module parse(final Element element) {
Module geoRssModule = parseGML(element); final Module geoRssModule = parseGML(element);
return geoRssModule; return geoRssModule;
} }
private static PositionList parsePosList(Element element) { private static PositionList parsePosList(final Element element) {
String coordinates = element.getText(); final String coordinates = element.getText();
String[] coord = GeoRSSUtils.trimWhitespace(coordinates).split(" "); final String[] coord = GeoRSSUtils.trimWhitespace(coordinates).split(" ");
PositionList posList = new PositionList(); final PositionList posList = new PositionList();
for (int i=0; i<coord.length; i += 2) { for (int i = 0; i < coord.length; i += 2) {
posList.add(Double.parseDouble(coord[i]), Double.parseDouble(coord[i+1])); posList.add(Double.parseDouble(coord[i]), Double.parseDouble(coord[i + 1]));
} }
return posList; return posList;
} }
static Module parseGML(Element element) { static Module parseGML(final Element element) {
GeoRSSModule geoRSSModule = null; GeoRSSModule geoRSSModule = null;
Element pointElement = element.getChild("Point", final Element pointElement = element.getChild("Point", GeoRSSModule.GML_NS);
GeoRSSModule.GML_NS); final Element lineStringElement = element.getChild("LineString", GeoRSSModule.GML_NS);
Element lineStringElement = element.getChild("LineString", final Element polygonElement = element.getChild("Polygon", GeoRSSModule.GML_NS);
GeoRSSModule.GML_NS); final Element envelopeElement = element.getChild("Envelope", GeoRSSModule.GML_NS);
Element polygonElement = element.getChild("Polygon",
GeoRSSModule.GML_NS);
Element envelopeElement = element.getChild("Envelope",
GeoRSSModule.GML_NS);
if (pointElement != null) { if (pointElement != null) {
Element posElement = pointElement.getChild("pos", GeoRSSModule.GML_NS); final Element posElement = pointElement.getChild("pos", GeoRSSModule.GML_NS);
if (posElement != null) { if (posElement != null) {
geoRSSModule = new GMLModuleImpl(); geoRSSModule = new GMLModuleImpl();
String coordinates = posElement.getText(); final String coordinates = posElement.getText();
String[] coord = GeoRSSUtils.trimWhitespace(coordinates).split(" "); final String[] coord = GeoRSSUtils.trimWhitespace(coordinates).split(" ");
Position pos = new Position(Double.parseDouble(coord[0]), Double.parseDouble(coord[1])); final Position pos = new Position(Double.parseDouble(coord[0]), Double.parseDouble(coord[1]));
geoRSSModule.setGeometry(new Point(pos)); geoRSSModule.setGeometry(new Point(pos));
} }
} else if (lineStringElement != null) { } else if (lineStringElement != null) {
Element posListElement = lineStringElement.getChild("posList", GeoRSSModule.GML_NS); final Element posListElement = lineStringElement.getChild("posList", GeoRSSModule.GML_NS);
if (posListElement != null) { if (posListElement != null) {
geoRSSModule = new GMLModuleImpl(); geoRSSModule = new GMLModuleImpl();
geoRSSModule.setGeometry(new LineString(parsePosList(posListElement))); geoRSSModule.setGeometry(new LineString(parsePosList(posListElement)));
} }
} else if (polygonElement != null) { } else if (polygonElement != null) {
Polygon poly = null; Polygon poly = null;
// The external ring // The external ring
Element exteriorElement = polygonElement.getChild("exterior", GeoRSSModule.GML_NS); final Element exteriorElement = polygonElement.getChild("exterior", GeoRSSModule.GML_NS);
if (exteriorElement != null) { if (exteriorElement != null) {
Element linearRingElement = exteriorElement.getChild("LinearRing", GeoRSSModule.GML_NS); final Element linearRingElement = exteriorElement.getChild("LinearRing", GeoRSSModule.GML_NS);
if (linearRingElement != null) { if (linearRingElement != null) {
Element posListElement = linearRingElement.getChild("posList", GeoRSSModule.GML_NS); final Element posListElement = linearRingElement.getChild("posList", GeoRSSModule.GML_NS);
if (posListElement != null) { if (posListElement != null) {
if (poly == null) if (poly == null) {
poly = new Polygon(); poly = new Polygon();
}
poly.setExterior(new LinearRing(parsePosList(posListElement))); poly.setExterior(new LinearRing(parsePosList(posListElement)));
} }
} }
} }
// The internal rings (holes) // The internal rings (holes)
List interiorElementList = polygonElement.getChildren("interior", GeoRSSModule.GML_NS); final List interiorElementList = polygonElement.getChildren("interior", GeoRSSModule.GML_NS);
Iterator it = interiorElementList.iterator(); final Iterator it = interiorElementList.iterator();
while (it.hasNext()) { while (it.hasNext()) {
Element interiorElement = (Element)it.next(); final Element interiorElement = (Element) it.next();
if (interiorElement != null) { if (interiorElement != null) {
Element linearRingElement = interiorElement.getChild("LinearRing", GeoRSSModule.GML_NS); final Element linearRingElement = interiorElement.getChild("LinearRing", GeoRSSModule.GML_NS);
if (linearRingElement != null) { if (linearRingElement != null) {
Element posListElement = linearRingElement.getChild("posList", GeoRSSModule.GML_NS); final Element posListElement = linearRingElement.getChild("posList", GeoRSSModule.GML_NS);
if (posListElement != null) { if (posListElement != null) {
if (poly == null) if (poly == null) {
poly = new Polygon(); poly = new Polygon();
}
poly.getInterior().add(new LinearRing(parsePosList(posListElement))); poly.getInterior().add(new LinearRing(parsePosList(posListElement)));
} }
} }
} }
} }
if (poly != null) { if (poly != null) {
geoRSSModule = new GMLModuleImpl(); geoRSSModule = new GMLModuleImpl();
geoRSSModule.setGeometry(poly); geoRSSModule.setGeometry(poly);
} }
} else if (envelopeElement != null) { } else if (envelopeElement != null) {
Element lowerElement = envelopeElement.getChild("lowerCorner", GeoRSSModule.GML_NS); final Element lowerElement = envelopeElement.getChild("lowerCorner", GeoRSSModule.GML_NS);
Element upperElement = envelopeElement.getChild("upperCorner", GeoRSSModule.GML_NS); final Element upperElement = envelopeElement.getChild("upperCorner", GeoRSSModule.GML_NS);
if (lowerElement != null && upperElement != null) { if (lowerElement != null && upperElement != null) {
geoRSSModule = new GMLModuleImpl(); geoRSSModule = new GMLModuleImpl();
String lowerCoordinates = lowerElement.getText(); final String lowerCoordinates = lowerElement.getText();
String[] lowerCoord = GeoRSSUtils.trimWhitespace(lowerCoordinates).split(" "); final String[] lowerCoord = GeoRSSUtils.trimWhitespace(lowerCoordinates).split(" ");
String upperCoordinates = upperElement.getText(); final String upperCoordinates = upperElement.getText();
String[] upperCoord = GeoRSSUtils.trimWhitespace(upperCoordinates).split(" "); final String[] upperCoord = GeoRSSUtils.trimWhitespace(upperCoordinates).split(" ");
Envelope envelope = new Envelope(Double.parseDouble(lowerCoord[0]), Double.parseDouble(lowerCoord[1]), final Envelope envelope = new Envelope(Double.parseDouble(lowerCoord[0]), Double.parseDouble(lowerCoord[1]), Double.parseDouble(upperCoord[0]),
Double.parseDouble(upperCoord[0]), Double.parseDouble(upperCoord[1])); Double.parseDouble(upperCoord[1]));
geoRSSModule.setGeometry(envelope); geoRSSModule.setGeometry(envelope);
} }
} }
return geoRSSModule; return geoRSSModule;
} }
} }

View file

@ -16,132 +16,128 @@
*/ */
package org.rometools.feed.module.georss; package org.rometools.feed.module.georss;
import com.sun.syndication.feed.CopyFrom; import org.jdom2.Namespace;
import org.jdom.Namespace;
import com.sun.syndication.feed.module.ModuleImpl;
import org.rometools.feed.module.georss.geometries.AbstractGeometry; import org.rometools.feed.module.georss.geometries.AbstractGeometry;
import org.rometools.feed.module.georss.geometries.Position;
import org.rometools.feed.module.georss.geometries.Point; import org.rometools.feed.module.georss.geometries.Point;
import org.rometools.feed.module.georss.geometries.Position;
import com.sun.syndication.feed.CopyFrom;
import com.sun.syndication.feed.module.ModuleImpl;
/** /**
* GeoRSSModule is the main georss interface defining the methods to produce and * GeoRSSModule is the main georss interface defining the methods to produce and consume georss elements.
* consume georss elements. *
*
* @author Marc Wick * @author Marc Wick
* @version $Id: GeoRSSModule.java,v 1.8 2007/06/06 09:47:32 marcwick Exp $ * @version $Id: GeoRSSModule.java,v 1.8 2007/06/06 09:47:32 marcwick Exp $
*/ */
public abstract class GeoRSSModule extends ModuleImpl implements Cloneable { public abstract class GeoRSSModule extends ModuleImpl implements Cloneable {
protected AbstractGeometry geometry; protected AbstractGeometry geometry;
public static final String version = "0.9.8"; public static final String version = "0.9.8";
/** /**
* namespace URI for georss simple: <i>"http://www.georss.org/georss"</i> * namespace URI for georss simple: <i>"http://www.georss.org/georss"</i>
*/ */
public static final String GEORSS_GEORSS_URI = "http://www.georss.org/georss"; public static final String GEORSS_GEORSS_URI = "http://www.georss.org/georss";
/** /**
* namespace URI for w3c georss : * namespace URI for w3c georss : <i>"http://www.w3.org/2003/01/geo/wgs84_pos#"</i>
* <i>"http://www.w3.org/2003/01/geo/wgs84_pos#"</i>
*/ */
public static final String GEORSS_W3CGEO_URI = "http://www.w3.org/2003/01/geo/wgs84_pos#"; public static final String GEORSS_W3CGEO_URI = "http://www.w3.org/2003/01/geo/wgs84_pos#";
/** /**
* namespace URI for GML georss : <i>"http://www.opengis.net/gml"</i> * namespace URI for GML georss : <i>"http://www.opengis.net/gml"</i>
*/ */
public static final String GEORSS_GML_URI = "http://www.opengis.net/gml"; public static final String GEORSS_GML_URI = "http://www.opengis.net/gml";
/** /**
* Namespace for georss simple : * Namespace for georss simple : <i>xmlns:georss="http://www.georss.org/georss"</i>
* <i>xmlns:georss="http://www.georss.org/georss"</i>
*/ */
public static final Namespace SIMPLE_NS = Namespace.getNamespace("georss", public static final Namespace SIMPLE_NS = Namespace.getNamespace("georss", GeoRSSModule.GEORSS_GEORSS_URI);
GeoRSSModule.GEORSS_GEORSS_URI);
/** /**
* *
* Namespace for w3c georss : * Namespace for w3c georss : <i>xmlns:geo="http://www.w3.org/2003/01/geo/wgs84_pos#"</i>
* <i>xmlns:geo="http://www.w3.org/2003/01/geo/wgs84_pos#"</i>
*/ */
public static final Namespace W3CGEO_NS = Namespace.getNamespace("geo", public static final Namespace W3CGEO_NS = Namespace.getNamespace("geo", GeoRSSModule.GEORSS_W3CGEO_URI);
GeoRSSModule.GEORSS_W3CGEO_URI);
/** /**
* *
* Namespace for gml georss : <i>xmlns:gml="http://www.opengis.net/gml"</i> * Namespace for gml georss : <i>xmlns:gml="http://www.opengis.net/gml"</i>
*/ */
public static final Namespace GML_NS = Namespace.getNamespace("gml", public static final Namespace GML_NS = Namespace.getNamespace("gml", GeoRSSModule.GEORSS_GML_URI);
GeoRSSModule.GEORSS_GML_URI);
protected GeoRSSModule(final java.lang.Class beanClass, final java.lang.String uri) {
protected GeoRSSModule(java.lang.Class beanClass, java.lang.String uri) {
super(beanClass, uri); super(beanClass, uri);
} }
/** /**
* Set geometry of georss element * Set geometry of georss element
* *
* @param geometry * @param geometry geometry
* geometry
*/ */
public void setGeometry(AbstractGeometry geometry) { public void setGeometry(final AbstractGeometry geometry) {
this.geometry = geometry; this.geometry = geometry;
} }
/** /**
* returns the geometry * returns the geometry
* *
* @return geometry * @return geometry
*/ */
public AbstractGeometry getGeometry() { public AbstractGeometry getGeometry() {
return geometry; return geometry;
} }
/** /**
* Convenience method to return point geometry. * Convenience method to return point geometry. Returns null if the geometry is non-point.
* Returns null if the geometry is non-point. *
*
* @return geometry * @return geometry
*/ */
public Position getPosition() { public Position getPosition() {
if (geometry instanceof Point) if (geometry instanceof Point) {
return ((Point)geometry).getPosition(); return ((Point) geometry).getPosition();
}
return null; return null;
} }
/** /**
* Convenience method to set point geometry. * Convenience method to set point geometry.
* *
* @return geometry * @return geometry
*/ */
public void setPosition(Position pos) { public void setPosition(final Position pos) {
if (pos != null) if (pos != null) {
geometry = new Point(pos); geometry = new Point(pos);
}
} }
/* /*
* (non-Javadoc) * (non-Javadoc)
* *
* @see com.sun.syndication.feed.CopyFrom#copyFrom(java.lang.Object) * @see com.sun.syndication.feed.CopyFrom#copyFrom(java.lang.Object)
*/ */
public void copyFrom(CopyFrom obj) { public void copyFrom(final CopyFrom obj) {
GeoRSSModule geoRSSModule = (GeoRSSModule) obj; final GeoRSSModule geoRSSModule = (GeoRSSModule) obj;
geometry = geoRSSModule.getGeometry(); geometry = geoRSSModule.getGeometry();
try { try {
geometry = (AbstractGeometry)geometry.clone(); geometry = (AbstractGeometry) geometry.clone();
} catch (CloneNotSupportedException ex) { } catch (final CloneNotSupportedException ex) {
ex.printStackTrace(); ex.printStackTrace();
} }
} }
@Override
public Object clone() throws CloneNotSupportedException { public Object clone() throws CloneNotSupportedException {
try { try {
GeoRSSModule retval = (GeoRSSModule)super.clone(); final GeoRSSModule retval = (GeoRSSModule) super.clone();
if (geometry != null) if (geometry != null) {
retval.geometry = (AbstractGeometry)geometry.clone(); retval.geometry = (AbstractGeometry) geometry.clone();
}
return retval; return retval;
} catch(Exception ex) {ex.printStackTrace();} } catch (final Exception ex) {
ex.printStackTrace();
}
throw new CloneNotSupportedException(); throw new CloneNotSupportedException();
} }
} }

View file

@ -21,42 +21,41 @@ package org.rometools.feed.module.georss;
* *
*/ */
public class GeoRSSPoint implements Cloneable { public class GeoRSSPoint implements Cloneable {
private double latitude; private double latitude;
private double longitude; private double longitude;
/** /**
* @return the latitude * @return the latitude
*/ */
public double getLatitude() { public double getLatitude() {
return latitude; return latitude;
} }
/** /**
* @param latitude * @param latitude the latitude to set
* the latitude to set */
*/ public void setLatitude(final double latitude) {
public void setLatitude(double latitude) { this.latitude = latitude;
this.latitude = latitude; }
}
/** /**
* @return the longitude * @return the longitude
*/ */
public double getLongitude() { public double getLongitude() {
return longitude; return longitude;
} }
/** /**
* @param longitude * @param longitude the longitude to set
* the longitude to set */
*/ public void setLongitude(final double longitude) {
public void setLongitude(double longitude) { this.longitude = longitude;
this.longitude = longitude; }
}
public Object clone() throws CloneNotSupportedException { @Override
return super.clone(); public Object clone() throws CloneNotSupportedException {
} return super.clone();
}
} }

View file

@ -21,110 +21,95 @@ import com.sun.syndication.feed.synd.SyndFeed;
/** /**
* static utility methods for georss. * static utility methods for georss.
* *
* @author Marc Wick * @author Marc Wick
* @version $Id: GeoRSSUtils.java,v 1.4 2007/04/18 09:59:29 marcwick Exp $ * @version $Id: GeoRSSUtils.java,v 1.4 2007/04/18 09:59:29 marcwick Exp $
* *
*/ */
public class GeoRSSUtils { public class GeoRSSUtils {
static String trimWhitespace(final String in) {
static String trimWhitespace(String in) { final StringBuffer strbuf = new StringBuffer();
StringBuffer strbuf = new StringBuffer();
int i = 0; int i = 0;
for (; i<in.length() && Character.isWhitespace(in.charAt(i)); ++i); for (; i < in.length() && Character.isWhitespace(in.charAt(i)); ++i) {
;
}
boolean wasWhite = false; boolean wasWhite = false;
for (; i< in.length(); ++i) { for (; i < in.length(); ++i) {
char ch=in.charAt(i); final char ch = in.charAt(i);
if (Character.isWhitespace(ch)) if (Character.isWhitespace(ch)) {
wasWhite = true; wasWhite = true;
else { } else {
if (wasWhite) if (wasWhite) {
strbuf.append(' '); strbuf.append(' ');
}
strbuf.append(ch); strbuf.append(ch);
wasWhite = false; wasWhite = false;
} }
} }
return strbuf.toString(); return strbuf.toString();
} }
/** /**
* This convenience method checks whether there is any geoRss Element and * This convenience method checks whether there is any geoRss Element and will return it (georss simple or W3GGeo).
* will return it (georss simple or W3GGeo). *
* * @param entry the element in the feed which might have a georss element
* @param entry
* the element in the feed which might have a georss element
* @return a georssmodule or null if none is present * @return a georssmodule or null if none is present
*/ */
public static GeoRSSModule getGeoRSS(SyndEntry entry) { public static GeoRSSModule getGeoRSS(final SyndEntry entry) {
GeoRSSModule simple = (GeoRSSModule) entry final GeoRSSModule simple = (GeoRSSModule) entry.getModule(GeoRSSModule.GEORSS_GEORSS_URI);
.getModule(GeoRSSModule.GEORSS_GEORSS_URI); final GeoRSSModule w3cGeo = (GeoRSSModule) entry.getModule(GeoRSSModule.GEORSS_W3CGEO_URI);
GeoRSSModule w3cGeo = (GeoRSSModule) entry final GeoRSSModule gml = (GeoRSSModule) entry.getModule(GeoRSSModule.GEORSS_GML_URI);
.getModule(GeoRSSModule.GEORSS_W3CGEO_URI); if (gml != null) {
GeoRSSModule gml = (GeoRSSModule) entry
.getModule(GeoRSSModule.GEORSS_GML_URI);
if (gml != null)
return gml; return gml;
if (simple != null) }
if (simple != null) {
return simple; return simple;
if (w3cGeo != null) }
if (w3cGeo != null) {
return w3cGeo; return w3cGeo;
}
return null;
/*
if (geoRSSModule == null && w3cGeo != null) {
geoRSSModule = w3cGeo;
} else if (geoRSSModule == null && gml != null) {
geoRSSModule = gml;
} else if (geoRSSModule != null && w3cGeo != null) {
// sanity check
if (!geoRSSModule.getGeometry().equals(w3cGeo.getGeometry())) {
throw new Error("geometry of simple and w3c do not match");
}
}
return geoRSSModule;
*/
}
/**
* This convenience method checks whether there is any geoRss Element and
* will return it (georss simple or W3GGeo).
*
* @param feed
* the element in the feed which might have a georss element
* @return a georssmodule or null if none is present
*/
public static GeoRSSModule getGeoRSS(SyndFeed feed) {
GeoRSSModule simple = (GeoRSSModule) feed
.getModule(GeoRSSModule.GEORSS_GEORSS_URI);
GeoRSSModule w3cGeo = (GeoRSSModule) feed
.getModule(GeoRSSModule.GEORSS_W3CGEO_URI);
GeoRSSModule gml = (GeoRSSModule) feed
.getModule(GeoRSSModule.GEORSS_GML_URI);
if (gml != null)
return gml;
if (simple != null)
return simple;
if (w3cGeo != null)
return w3cGeo;
return null; return null;
/* /*
if (geoRSSModule == null && w3cGeo != null) { * if (geoRSSModule == null && w3cGeo != null) { geoRSSModule = w3cGeo; } else if (geoRSSModule == null && gml != null) { geoRSSModule = gml; } else if
geoRSSModule = w3cGeo; * (geoRSSModule != null && w3cGeo != null) { // sanity check if (!geoRSSModule.getGeometry().equals(w3cGeo.getGeometry())) { throw new
} else if (geoRSSModule == null && gml != null) { * Error("geometry of simple and w3c do not match"); } }
geoRSSModule = gml; *
} else if (geoRSSModule != null && w3cGeo != null) { * return geoRSSModule;
// sanity check */
if (!geoRSSModule.getGeometry().equals(w3cGeo.getGeometry())) { }
throw new Error("geometry of simple and w3c do not match");
} /**
* This convenience method checks whether there is any geoRss Element and will return it (georss simple or W3GGeo).
*
* @param feed the element in the feed which might have a georss element
* @return a georssmodule or null if none is present
*/
public static GeoRSSModule getGeoRSS(final SyndFeed feed) {
final GeoRSSModule simple = (GeoRSSModule) feed.getModule(GeoRSSModule.GEORSS_GEORSS_URI);
final GeoRSSModule w3cGeo = (GeoRSSModule) feed.getModule(GeoRSSModule.GEORSS_W3CGEO_URI);
final GeoRSSModule gml = (GeoRSSModule) feed.getModule(GeoRSSModule.GEORSS_GML_URI);
if (gml != null) {
return gml;
} }
if (simple != null) {
return geoRSSModule; return simple;
}
if (w3cGeo != null) {
return w3cGeo;
}
return null;
/*
* if (geoRSSModule == null && w3cGeo != null) { geoRSSModule = w3cGeo; } else if (geoRSSModule == null && gml != null) { geoRSSModule = gml; } else if
* (geoRSSModule != null && w3cGeo != null) { // sanity check if (!geoRSSModule.getGeometry().equals(w3cGeo.getGeometry())) { throw new
* Error("geometry of simple and w3c do not match"); } }
*
* return geoRSSModule;
*/ */
} }
} }

View file

@ -20,11 +20,19 @@ import java.util.Collections;
import java.util.HashSet; import java.util.HashSet;
import java.util.Set; import java.util.Set;
import org.jdom.Element; import org.jdom2.Element;
import org.rometools.feed.module.georss.geometries.AbstractGeometry;
import org.rometools.feed.module.georss.geometries.AbstractRing;
import org.rometools.feed.module.georss.geometries.Envelope;
import org.rometools.feed.module.georss.geometries.LineString;
import org.rometools.feed.module.georss.geometries.LinearRing;
import org.rometools.feed.module.georss.geometries.Point;
import org.rometools.feed.module.georss.geometries.Polygon;
import org.rometools.feed.module.georss.geometries.Position;
import org.rometools.feed.module.georss.geometries.PositionList;
import com.sun.syndication.feed.module.Module; import com.sun.syndication.feed.module.Module;
import com.sun.syndication.io.ModuleGenerator; import com.sun.syndication.io.ModuleGenerator;
import org.rometools.feed.module.georss.geometries.*;
/** /**
* SimpleGenerator produces georss elements in georss simple format. * SimpleGenerator produces georss elements in georss simple format.
@ -37,19 +45,19 @@ public class SimpleGenerator implements ModuleGenerator {
private static final Set NAMESPACES; private static final Set NAMESPACES;
static { static {
Set nss = new HashSet(); final Set nss = new HashSet();
nss.add(GeoRSSModule.SIMPLE_NS); nss.add(GeoRSSModule.SIMPLE_NS);
NAMESPACES = Collections.unmodifiableSet(nss); NAMESPACES = Collections.unmodifiableSet(nss);
} }
private String posListToString(PositionList posList) { private String posListToString(final PositionList posList) {
StringBuffer sb = new StringBuffer(); final StringBuffer sb = new StringBuffer();
for (int i=0; i<posList.size(); ++i) for (int i = 0; i < posList.size(); ++i) {
sb.append(posList.getLatitude(i)).append(" ").append(posList.getLongitude(i)).append(" "); sb.append(posList.getLatitude(i)).append(" ").append(posList.getLongitude(i)).append(" ");
}
return sb.toString(); return sb.toString();
} }
/* /*
* (non-Javadoc) * (non-Javadoc)
* *
@ -71,10 +79,9 @@ public class SimpleGenerator implements ModuleGenerator {
/* /*
* (non-Javadoc) * (non-Javadoc)
* *
* @see com.sun.syndication.io.ModuleGenerator#generate(com.sun.syndication.feed.module.Module, * @see com.sun.syndication.io.ModuleGenerator#generate(com.sun.syndication.feed.module.Module, org.jdom2.Element)
* org.jdom.Element)
*/ */
public void generate(Module module, Element element) { public void generate(final Module module, final Element element) {
// this is not necessary, it is done to avoid the namespace definition // this is not necessary, it is done to avoid the namespace definition
// in every item. // in every item.
Element root = element; Element root = element;
@ -83,49 +90,43 @@ public class SimpleGenerator implements ModuleGenerator {
} }
root.addNamespaceDeclaration(GeoRSSModule.SIMPLE_NS); root.addNamespaceDeclaration(GeoRSSModule.SIMPLE_NS);
GeoRSSModule geoRSSModule = (GeoRSSModule) module; final GeoRSSModule geoRSSModule = (GeoRSSModule) module;
AbstractGeometry geometry = geoRSSModule.getGeometry(); final AbstractGeometry geometry = geoRSSModule.getGeometry();
if (geometry instanceof Point) { if (geometry instanceof Point) {
Position pos = ((Point) geometry).getPosition(); final Position pos = ((Point) geometry).getPosition();
Element pointElement = new Element("point", GeoRSSModule.SIMPLE_NS); final Element pointElement = new Element("point", GeoRSSModule.SIMPLE_NS);
pointElement.addContent(pos.getLatitude() + " " pointElement.addContent(pos.getLatitude() + " " + pos.getLongitude());
+ pos.getLongitude());
element.addContent(pointElement); element.addContent(pointElement);
} } else if (geometry instanceof LineString) {
else if (geometry instanceof LineString) { final PositionList posList = ((LineString) geometry).getPositionList();
PositionList posList = ((LineString) geometry).getPositionList();
final Element lineElement = new Element("line", GeoRSSModule.SIMPLE_NS);
Element lineElement = new Element("line", GeoRSSModule.SIMPLE_NS);
lineElement.addContent(posListToString(posList)); lineElement.addContent(posListToString(posList));
element.addContent(lineElement); element.addContent(lineElement);
} } else if (geometry instanceof Polygon) {
else if (geometry instanceof Polygon) { final AbstractRing ring = ((Polygon) geometry).getExterior();
AbstractRing ring = ((Polygon) geometry).getExterior();
if (ring instanceof LinearRing) { if (ring instanceof LinearRing) {
PositionList posList = ((LinearRing) ring).getPositionList(); final PositionList posList = ((LinearRing) ring).getPositionList();
Element polygonElement = new Element("polygon", GeoRSSModule.SIMPLE_NS); final Element polygonElement = new Element("polygon", GeoRSSModule.SIMPLE_NS);
polygonElement.addContent(posListToString(posList)); polygonElement.addContent(posListToString(posList));
element.addContent(polygonElement); element.addContent(polygonElement);
} } else {
else {
System.err.println("GeoRSS simple format can't handle rings of type: " + ring.getClass().getName()); System.err.println("GeoRSS simple format can't handle rings of type: " + ring.getClass().getName());
} }
if (((Polygon) geometry).getInterior() != null || !((Polygon) geometry).getInterior().isEmpty()) { if (((Polygon) geometry).getInterior() != null || !((Polygon) geometry).getInterior().isEmpty()) {
System.err.println("GeoRSS simple format can't handle interior rings (ignored)"); System.err.println("GeoRSS simple format can't handle interior rings (ignored)");
} }
} } else if (geometry instanceof Envelope) {
else if (geometry instanceof Envelope) { final Envelope envelope = (Envelope) geometry;
Envelope envelope = (Envelope)geometry; final Element boxElement = new Element("box", GeoRSSModule.SIMPLE_NS);
Element boxElement = new Element("box", GeoRSSModule.SIMPLE_NS); boxElement.addContent(envelope.getMinLatitude() + " " + envelope.getMinLongitude() + " " + envelope.getMaxLatitude() + " "
boxElement.addContent(envelope.getMinLatitude() + " " + envelope.getMinLongitude() + " " + + envelope.getMaxLongitude());
envelope.getMaxLatitude() + " " + envelope.getMaxLongitude());
element.addContent(boxElement); element.addContent(boxElement);
} } else {
else {
System.err.println("GeoRSS simple format can't handle geometries of type: " + geometry.getClass().getName()); System.err.println("GeoRSS simple format can't handle geometries of type: " + geometry.getClass().getName());
} }
} }

View file

@ -16,21 +16,18 @@
*/ */
package org.rometools.feed.module.georss; package org.rometools.feed.module.georss;
/** /**
* SimpleModuleImpl is the implementation of the {@link GeoRSSModule} Interface * SimpleModuleImpl is the implementation of the {@link GeoRSSModule} Interface for the GeoRSS Simple format.
* for the GeoRSS Simple format.
* *
* @author Marc Wick * @author Marc Wick
* @version $Id: SimpleModuleImpl.java,v 1.4 2007/04/18 09:59:29 marcwick Exp $ * @version $Id: SimpleModuleImpl.java,v 1.4 2007/04/18 09:59:29 marcwick Exp $
* *
*/ */
public class SimpleModuleImpl extends GeoRSSModule { public class SimpleModuleImpl extends GeoRSSModule {
public SimpleModuleImpl() { public SimpleModuleImpl() {
super(GeoRSSModule.class, GeoRSSModule.GEORSS_GEORSS_URI); super(GeoRSSModule.class, GeoRSSModule.GEORSS_GEORSS_URI);
} }
/* /*
* (non-Javadoc) * (non-Javadoc)
* *

View file

@ -16,90 +16,91 @@
*/ */
package org.rometools.feed.module.georss; package org.rometools.feed.module.georss;
import org.jdom.Element; import org.jdom2.Element;
import org.rometools.feed.module.georss.geometries.Envelope;
import org.rometools.feed.module.georss.geometries.LineString;
import org.rometools.feed.module.georss.geometries.LinearRing;
import org.rometools.feed.module.georss.geometries.Point;
import org.rometools.feed.module.georss.geometries.Polygon;
import org.rometools.feed.module.georss.geometries.Position;
import org.rometools.feed.module.georss.geometries.PositionList;
import com.sun.syndication.feed.module.Module; import com.sun.syndication.feed.module.Module;
import org.rometools.feed.module.georss.GMLParser;
import com.sun.syndication.io.ModuleParser; import com.sun.syndication.io.ModuleParser;
import org.rometools.feed.module.georss.geometries.*;
/** /**
* SimpleParser is a parser for the GeoRSS Simple format. * SimpleParser is a parser for the GeoRSS Simple format.
* *
* @author Marc Wick * @author Marc Wick
* @version $Id: SimpleParser.java,v 1.4 2007/04/18 09:59:29 marcwick Exp $ * @version $Id: SimpleParser.java,v 1.4 2007/04/18 09:59:29 marcwick Exp $
* *
*/ */
public class SimpleParser implements ModuleParser { public class SimpleParser implements ModuleParser {
/* /*
* (non-Javadoc) * (non-Javadoc)
* *
* @see com.sun.syndication.io.ModuleParser#getNamespaceUri() * @see com.sun.syndication.io.ModuleParser#getNamespaceUri()
*/ */
public String getNamespaceUri() { public String getNamespaceUri() {
return GeoRSSModule.GEORSS_GEORSS_URI; return GeoRSSModule.GEORSS_GEORSS_URI;
} }
private static PositionList parsePosList(Element element) { private static PositionList parsePosList(final Element element) {
String coordinates = element.getText(); final String coordinates = element.getText();
String[] coord = GeoRSSUtils.trimWhitespace(coordinates).split(" "); final String[] coord = GeoRSSUtils.trimWhitespace(coordinates).split(" ");
PositionList posList = new PositionList(); final PositionList posList = new PositionList();
for (int i=0; i<coord.length; i += 2) { for (int i = 0; i < coord.length; i += 2) {
posList.add(Double.parseDouble(coord[i]), Double.parseDouble(coord[i+1])); posList.add(Double.parseDouble(coord[i]), Double.parseDouble(coord[i + 1]));
} }
return posList; return posList;
} }
/* /*
* (non-Javadoc) * (non-Javadoc)
* *
* @see com.sun.syndication.io.ModuleParser#parse(org.jdom.Element) * @see com.sun.syndication.io.ModuleParser#parse(org.jdom2.Element)
*/ */
public Module parse(Element element) { public Module parse(final Element element) {
Module geoRssModule = parseSimple(element); final Module geoRssModule = parseSimple(element);
return geoRssModule; return geoRssModule;
} }
static Module parseSimple(Element element) { static Module parseSimple(final Element element) {
GeoRSSModule geoRSSModule = null; GeoRSSModule geoRSSModule = null;
Element pointElement = element.getChild("point", final Element pointElement = element.getChild("point", GeoRSSModule.SIMPLE_NS);
GeoRSSModule.SIMPLE_NS); final Element lineElement = element.getChild("line", GeoRSSModule.SIMPLE_NS);
Element lineElement = element.getChild("line", final Element polygonElement = element.getChild("polygon", GeoRSSModule.SIMPLE_NS);
GeoRSSModule.SIMPLE_NS); final Element boxElement = element.getChild("box", GeoRSSModule.SIMPLE_NS);
Element polygonElement = element.getChild("polygon", final Element whereElement = element.getChild("where", GeoRSSModule.SIMPLE_NS);
GeoRSSModule.SIMPLE_NS);
Element boxElement = element.getChild("box",
GeoRSSModule.SIMPLE_NS);
Element whereElement = element
.getChild("where", GeoRSSModule.SIMPLE_NS);
if (pointElement != null) { if (pointElement != null) {
geoRSSModule = new SimpleModuleImpl(); geoRSSModule = new SimpleModuleImpl();
String coordinates = pointElement.getText(); final String coordinates = pointElement.getText();
String[] coord = GeoRSSUtils.trimWhitespace(coordinates).split(" "); final String[] coord = GeoRSSUtils.trimWhitespace(coordinates).split(" ");
Position pos = new Position(Double.parseDouble(coord[0]), Double.parseDouble(coord[1])); final Position pos = new Position(Double.parseDouble(coord[0]), Double.parseDouble(coord[1]));
geoRSSModule.setGeometry(new Point(pos)); geoRSSModule.setGeometry(new Point(pos));
} else if (lineElement != null) { } else if (lineElement != null) {
geoRSSModule = new SimpleModuleImpl(); geoRSSModule = new SimpleModuleImpl();
PositionList posList = parsePosList(lineElement); final PositionList posList = parsePosList(lineElement);
geoRSSModule.setGeometry(new LineString(posList)); geoRSSModule.setGeometry(new LineString(posList));
} else if (polygonElement != null) { } else if (polygonElement != null) {
geoRSSModule = new SimpleModuleImpl(); geoRSSModule = new SimpleModuleImpl();
PositionList posList = parsePosList(polygonElement); final PositionList posList = parsePosList(polygonElement);
Polygon poly = new Polygon(); final Polygon poly = new Polygon();
poly.setExterior(new LinearRing(posList)); poly.setExterior(new LinearRing(posList));
geoRSSModule.setGeometry(poly); geoRSSModule.setGeometry(poly);
} else if (boxElement != null) { } else if (boxElement != null) {
geoRSSModule = new SimpleModuleImpl(); geoRSSModule = new SimpleModuleImpl();
String coordinates = boxElement.getText(); final String coordinates = boxElement.getText();
String[] coord = GeoRSSUtils.trimWhitespace(coordinates).split(" "); final String[] coord = GeoRSSUtils.trimWhitespace(coordinates).split(" ");
Envelope envelope = new Envelope(Double.parseDouble(coord[0]), Double.parseDouble(coord[1]), final Envelope envelope = new Envelope(Double.parseDouble(coord[0]), Double.parseDouble(coord[1]), Double.parseDouble(coord[2]),
Double.parseDouble(coord[2]), Double.parseDouble(coord[3])); Double.parseDouble(coord[3]));
geoRSSModule.setGeometry(envelope); geoRSSModule.setGeometry(envelope);
} else if (whereElement != null) { } else if (whereElement != null) {
geoRSSModule = (GeoRSSModule)GMLParser.parseGML(whereElement); geoRSSModule = (GeoRSSModule) GMLParser.parseGML(whereElement);
} }
return geoRSSModule; return geoRSSModule;
} }
} }

View file

@ -20,11 +20,13 @@ import java.util.Collections;
import java.util.HashSet; import java.util.HashSet;
import java.util.Set; import java.util.Set;
import org.jdom.Element; import org.jdom2.Element;
import org.rometools.feed.module.georss.geometries.AbstractGeometry;
import org.rometools.feed.module.georss.geometries.Point;
import org.rometools.feed.module.georss.geometries.Position;
import com.sun.syndication.feed.module.Module; import com.sun.syndication.feed.module.Module;
import com.sun.syndication.io.ModuleGenerator; import com.sun.syndication.io.ModuleGenerator;
import org.rometools.feed.module.georss.geometries.*;
/** /**
* W3CGeoGenerator produces georss elements in georss W3C geo format. * W3CGeoGenerator produces georss elements in georss W3C geo format.
@ -34,18 +36,18 @@ import org.rometools.feed.module.georss.geometries.*;
* *
*/ */
public class W3CGeoGenerator implements ModuleGenerator { public class W3CGeoGenerator implements ModuleGenerator {
private static boolean isShort = true; private static boolean isShort = true;
private static final Set NAMESPACES; private static final Set NAMESPACES;
static { static {
Set nss = new HashSet(); final Set nss = new HashSet();
nss.add(GeoRSSModule.W3CGEO_NS); nss.add(GeoRSSModule.W3CGEO_NS);
NAMESPACES = Collections.unmodifiableSet(nss); NAMESPACES = Collections.unmodifiableSet(nss);
} }
public static void enableDefaultPointElement(){ public static void enableDefaultPointElement() {
isShort = false; isShort = false;
} }
@ -70,10 +72,9 @@ public class W3CGeoGenerator implements ModuleGenerator {
/* /*
* (non-Javadoc) * (non-Javadoc)
* *
* @see com.sun.syndication.io.ModuleGenerator#generate(com.sun.syndication.feed.module.Module, * @see com.sun.syndication.io.ModuleGenerator#generate(com.sun.syndication.feed.module.Module, org.jdom2.Element)
* org.jdom.Element)
*/ */
public void generate(Module module, Element element) { public void generate(final Module module, final Element element) {
// this is not necessary, it is done to avoid the namespace definition // this is not necessary, it is done to avoid the namespace definition
// in every item. // in every item.
Element root = element; Element root = element;
@ -88,21 +89,20 @@ public class W3CGeoGenerator implements ModuleGenerator {
element.addContent(pointElement); element.addContent(pointElement);
} }
GeoRSSModule geoRSSModule = (GeoRSSModule) module; final GeoRSSModule geoRSSModule = (GeoRSSModule) module;
AbstractGeometry geometry = geoRSSModule.getGeometry(); final AbstractGeometry geometry = geoRSSModule.getGeometry();
if (geometry instanceof Point) { if (geometry instanceof Point) {
Position pos = ((Point)geometry).getPosition(); final Position pos = ((Point) geometry).getPosition();
Element latElement = new Element("lat", GeoRSSModule.W3CGEO_NS); final Element latElement = new Element("lat", GeoRSSModule.W3CGEO_NS);
latElement.addContent(String.valueOf(pos.getLatitude())); latElement.addContent(String.valueOf(pos.getLatitude()));
pointElement.addContent(latElement); pointElement.addContent(latElement);
Element lngElement = new Element("long", GeoRSSModule.W3CGEO_NS); final Element lngElement = new Element("long", GeoRSSModule.W3CGEO_NS);
lngElement.addContent(String.valueOf(pos.getLongitude())); lngElement.addContent(String.valueOf(pos.getLongitude()));
pointElement.addContent(lngElement); pointElement.addContent(lngElement);
} } else {
else { System.err.println("W3C Geo format can't handle geometries of type: " + geometry.getClass().getName());
System.err.println("W3C Geo format can't handle geometries of type: " + geometry.getClass().getName());
} }
} }
} }

View file

@ -16,10 +16,8 @@
*/ */
package org.rometools.feed.module.georss; package org.rometools.feed.module.georss;
/** /**
* W3CGeoModuleImpl is the implementation of the {@link GeoRSSModule} Interface * W3CGeoModuleImpl is the implementation of the {@link GeoRSSModule} Interface for the W3C geo format.
* for the W3C geo format.
* *
* @author Marc Wick * @author Marc Wick
* @version $Id: W3CGeoModuleImpl.java,v 1.2 2007/04/18 09:59:29 marcwick Exp $ * @version $Id: W3CGeoModuleImpl.java,v 1.2 2007/04/18 09:59:29 marcwick Exp $
@ -27,18 +25,17 @@ package org.rometools.feed.module.georss;
*/ */
public class W3CGeoModuleImpl extends GeoRSSModule { public class W3CGeoModuleImpl extends GeoRSSModule {
public W3CGeoModuleImpl() { public W3CGeoModuleImpl() {
super(GeoRSSModule.class, GeoRSSModule.GEORSS_W3CGEO_URI); super(GeoRSSModule.class, GeoRSSModule.GEORSS_W3CGEO_URI);
} }
/*
/* * (non-Javadoc)
* (non-Javadoc) *
* * @see com.sun.syndication.feed.CopyFrom#getInterface()
* @see com.sun.syndication.feed.CopyFrom#getInterface() */
*/ public Class getInterface() {
public Class getInterface() { return GeoRSSModule.class;
return GeoRSSModule.class; }
}
} }

View file

@ -16,64 +16,64 @@
*/ */
package org.rometools.feed.module.georss; package org.rometools.feed.module.georss;
import org.jdom.Element; import org.jdom2.Element;
import org.rometools.feed.module.georss.geometries.Point;
import org.rometools.feed.module.georss.geometries.Position;
import com.sun.syndication.feed.module.Module; import com.sun.syndication.feed.module.Module;
import com.sun.syndication.io.ModuleParser; import com.sun.syndication.io.ModuleParser;
import org.rometools.feed.module.georss.geometries.*;
/** /**
* W3CGeoParser is a parser for the W3C geo format. * W3CGeoParser is a parser for the W3C geo format.
* *
* @author Marc Wick * @author Marc Wick
* @version $Id: W3CGeoParser.java,v 1.4 2007/04/18 09:59:29 marcwick Exp $ * @version $Id: W3CGeoParser.java,v 1.4 2007/04/18 09:59:29 marcwick Exp $
* *
*/ */
public class W3CGeoParser implements ModuleParser { public class W3CGeoParser implements ModuleParser {
/* /*
* (non-Javadoc) * (non-Javadoc)
* *
* @see com.sun.syndication.io.ModuleParser#getNamespaceUri() * @see com.sun.syndication.io.ModuleParser#getNamespaceUri()
*/ */
public String getNamespaceUri() { public String getNamespaceUri() {
return GeoRSSModule.GEORSS_W3CGEO_URI; return GeoRSSModule.GEORSS_W3CGEO_URI;
} }
static Module parseW3C(final Element element) {
static Module parseW3C(Element element) {
GeoRSSModule geoRSSModule = null; GeoRSSModule geoRSSModule = null;
// do we have an optional "Point" element ? // do we have an optional "Point" element ?
Element pointElement = element Element pointElement = element.getChild("Point", GeoRSSModule.W3CGEO_NS);
.getChild("Point", GeoRSSModule.W3CGEO_NS);
// we don't have an optional "Point" element // we don't have an optional "Point" element
if (pointElement == null) { if (pointElement == null) {
pointElement = element; pointElement = element;
} }
Element lat = pointElement.getChild("lat", GeoRSSModule.W3CGEO_NS); final Element lat = pointElement.getChild("lat", GeoRSSModule.W3CGEO_NS);
Element lng = pointElement.getChild("long", GeoRSSModule.W3CGEO_NS); Element lng = pointElement.getChild("long", GeoRSSModule.W3CGEO_NS);
if (lng == null) if (lng == null) {
lng = pointElement.getChild("lon", GeoRSSModule.W3CGEO_NS); lng = pointElement.getChild("lon", GeoRSSModule.W3CGEO_NS);
}
if (lat != null && lng != null) { if (lat != null && lng != null) {
geoRSSModule = new W3CGeoModuleImpl(); geoRSSModule = new W3CGeoModuleImpl();
Position pos = new Position(Double.parseDouble(lat.getText()), Double.parseDouble(lng.getText())); final Position pos = new Position(Double.parseDouble(lat.getText()), Double.parseDouble(lng.getText()));
geoRSSModule.setGeometry(new Point(pos)); geoRSSModule.setGeometry(new Point(pos));
} }
return geoRSSModule; return geoRSSModule;
} }
/* /*
* (non-Javadoc) * (non-Javadoc)
* *
* @see com.sun.syndication.io.ModuleParser#parse(org.jdom.Element) * @see com.sun.syndication.io.ModuleParser#parse(org.jdom2.Element)
*/ */
public Module parse(Element element) { public Module parse(final Element element) {
Module geoRssModule = parseW3C(element); final Module geoRssModule = parseW3C(element);
return geoRssModule; return geoRssModule;
} }
} }

View file

@ -11,12 +11,13 @@ package org.rometools.feed.module.georss.geometries;
/** /**
* Abstract base class for Curves (linear objects) * Abstract base class for Curves (linear objects)
*
* @author runaas * @author runaas
*/ */
public abstract class AbstractCurve extends AbstractGeometricPrimitive { public abstract class AbstractCurve extends AbstractGeometricPrimitive {
/** Creates a new instance of Curve */ /** Creates a new instance of Curve */
public AbstractCurve() { public AbstractCurve() {
} }
} }

View file

@ -10,14 +10,15 @@
package org.rometools.feed.module.georss.geometries; package org.rometools.feed.module.georss.geometries;
/** /**
* Abstract base class for geometric primitives (non-composite geometric objects) * Abstract base class for geometric primitives (non-composite geometric objects)
*
* @author runaas * @author runaas
*/ */
public abstract class AbstractGeometricPrimitive extends AbstractGeometry { public abstract class AbstractGeometricPrimitive extends AbstractGeometry {
/** Creates a new instance of GeometricPrimitive */ /** Creates a new instance of GeometricPrimitive */
public AbstractGeometricPrimitive() { public AbstractGeometricPrimitive() {
} }
} }

View file

@ -13,24 +13,27 @@ import java.io.Serializable;
/** /**
* Abstract base class for geometries. * Abstract base class for geometries.
* *
* @author runaas * @author runaas
*/ */
public abstract class AbstractGeometry implements Cloneable, Serializable { public abstract class AbstractGeometry implements Cloneable, Serializable {
/** Creates a new instance of Geometry */ /** Creates a new instance of Geometry */
public AbstractGeometry() { public AbstractGeometry() {
} }
/** /**
* Make a deep copy of the geometric object * Make a deep copy of the geometric object
*
* @return A copy of the object * @return A copy of the object
*/ */
@Override
public Object clone() throws CloneNotSupportedException { public Object clone() throws CloneNotSupportedException {
return super.clone(); return super.clone();
} }
public boolean equals(Object obj) { @Override
return obj != null && obj.getClass() == getClass(); public boolean equals(final Object obj) {
} return obj != null && obj.getClass() == getClass();
}
} }

View file

@ -13,14 +13,16 @@ import java.io.Serializable;
/** /**
* Abstract base class for rings (closed linear objects used for polygon borders) * Abstract base class for rings (closed linear objects used for polygon borders)
*
* @author runaas * @author runaas
*/ */
public abstract class AbstractRing implements Cloneable, Serializable { public abstract class AbstractRing implements Cloneable, Serializable {
/** Creates a new instance of AbstractRing */ /** Creates a new instance of AbstractRing */
public AbstractRing() { public AbstractRing() {
} }
@Override
public Object clone() throws CloneNotSupportedException { public Object clone() throws CloneNotSupportedException {
return super.clone(); return super.clone();
} }

View file

@ -11,12 +11,13 @@ package org.rometools.feed.module.georss.geometries;
/** /**
* Abstract base class for surface (area) objects * Abstract base class for surface (area) objects
*
* @author runaas * @author runaas
*/ */
public abstract class AbstractSurface extends AbstractGeometricPrimitive { public abstract class AbstractSurface extends AbstractGeometricPrimitive {
/** Creates a new instance of Surface */ /** Creates a new instance of Surface */
public AbstractSurface() { public AbstractSurface() {
} }
} }

Some files were not shown because too many files have changed in this diff Show more