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

@ -28,16 +28,19 @@ import org.rometools.feed.module.activitystreams.types.Verb;
public interface ActivityStreamModule {
public Verb getVerb();
public void setVerb(Verb verb);
public ActivityObject getObject();
public void setObject(ActivityObject object);
public ActivityObject getTarget();
public void setTarget(ActivityObject object);
public Mood getMood();
public void setMood(Mood mood);
}

View file

@ -20,7 +20,6 @@ import org.rometools.feed.module.activitystreams.types.ActivityObject;
import org.rometools.feed.module.activitystreams.types.Mood;
import org.rometools.feed.module.activitystreams.types.Verb;
/**
*
* @author robert.cooper
@ -34,8 +33,8 @@ public class ActivityStreamModuleImpl implements ActivityStreamModule {
*
* @param newobject new value of object
*/
public void setObject(ActivityObject newobject) {
this.object = newobject;
public void setObject(final ActivityObject newobject) {
object = newobject;
}
/**
@ -44,7 +43,7 @@ public class ActivityStreamModuleImpl implements ActivityStreamModule {
* @return the value of object
*/
public ActivityObject getObject() {
return this.object;
return object;
}
/**
@ -52,8 +51,8 @@ public class ActivityStreamModuleImpl implements ActivityStreamModule {
*
* @param newverb new value of verb
*/
public void setVerb(Verb newverb) {
this.verb = newverb;
public void setVerb(final Verb newverb) {
verb = newverb;
}
/**
@ -62,14 +61,14 @@ public class ActivityStreamModuleImpl implements ActivityStreamModule {
* @return the value of verb
*/
public Verb getVerb() {
return this.verb;
return verb;
}
public ActivityObject getTarget() {
throw new UnsupportedOperationException("Not supported yet.");
}
public void setTarget(ActivityObject object) {
public void setTarget(final ActivityObject object) {
throw new UnsupportedOperationException("Not supported yet.");
}
@ -77,7 +76,7 @@ public class ActivityStreamModuleImpl implements ActivityStreamModule {
throw new UnsupportedOperationException("Not supported yet.");
}
public void setMood(Mood mood) {
public void setMood(final Mood mood) {
throw new UnsupportedOperationException("Not supported yet.");
}
}

View file

@ -17,31 +17,32 @@
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.portablecontacts.ContactModule;
import com.sun.syndication.feed.atom.Entry;
/**
*
* @author robert.cooper
*/
public abstract class ActivityObject extends Entry implements HasLocation {
public abstract String getTypeIRI();
public GeoRSSModule getLocation() {
throw new UnsupportedOperationException("Not supported yet.");
}
public void setLocation(GeoRSSModule location) {
public void setLocation(final GeoRSSModule location) {
throw new UnsupportedOperationException("Not supported yet.");
}
public ContactModule getAddress(){
public ContactModule getAddress() {
throw new UnsupportedOperationException("Not supported yet.");
}
public void setAddress(ContactModule address){
public void setAddress(final ContactModule address) {
throw new UnsupportedOperationException("Not supported yet.");
}

View file

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

View file

@ -16,30 +16,28 @@
*/
package org.rometools.feed.module.activitystreams.types;
/**
* <p>The "audio" Object type represents audio content.
*</p>
*<p>The "audio" Object type is identified by the URI <tt>http://activitystrea.ms/schema/1.0/audio</tt>.
*</p>
*<p>An audio has the following additional components:
*</p>
*<p></p>
*<blockquote class="text"><dl>
*<dt>Audio Stream Link</dt>
*<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 properties as defined in [TODO: xref the JSON
* serialization of a Media Link Construct]
*</dd>
*<dt>Embed Code</dt>
*<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 called <tt>embedCode</tt> whose value is a JSON string
* containing the fragment of HTML.
*</dd>
*</dl>
* <p>
* The "audio" Object type represents audio content.
* </p>
* <p>
* The "audio" Object type is identified by the URI <tt>http://activitystrea.ms/schema/1.0/audio</tt>.
* </p>
* <p>
* An audio has the following additional components:
* </p>
* <p>
* </p>
* <blockquote class="text">
* <dl>
* <dt>Audio Stream Link</dt>
* <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
* properties as defined in [TODO: xref the JSON serialization of a Media Link Construct]</dd>
* <dt>Embed Code</dt>
* <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
* called <tt>embedCode</tt> whose value is a JSON string containing the fragment of HTML.</dd>
* </dl>
*
* @author robert.cooper
*/
public class Audio extends ActivityObject {
@ -51,8 +49,8 @@ public class Audio extends ActivityObject {
*
* @param newembedCode new value of embedCode
*/
public void setEmbedCode(String newembedCode) {
this.embedCode = newembedCode;
public void setEmbedCode(final String newembedCode) {
embedCode = newembedCode;
}
/**
@ -61,7 +59,7 @@ public class Audio extends ActivityObject {
* @return the value of embedCode
*/
public String getEmbedCode() {
return this.embedCode;
return embedCode;
}
/**
@ -69,8 +67,8 @@ public class Audio extends ActivityObject {
*
* @param newstreamLink new value of streamLink
*/
public void setStreamLink(String newstreamLink) {
this.streamLink = newstreamLink;
public void setStreamLink(final String newstreamLink) {
streamLink = newstreamLink;
}
/**
@ -79,7 +77,7 @@ public class Audio extends ActivityObject {
* @return the value of streamLink
*/
public String getStreamLink() {
return this.streamLink;
return streamLink;
}
@Override

View file

@ -19,62 +19,49 @@ package org.rometools.feed.module.activitystreams.types;
import com.sun.syndication.feed.atom.Link;
/**
* <p>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 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 pointer to the
* 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, 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 the title and
* description of his or her own bookmarks to differ from the metadata
* on the target itself.
*</p>
*<p>Some implementations refer to this Object type as a "link". This
* specification uses the term "bookmark" to avoid confusion with the
* general concept of hyperlinks which apply to all Object types.
*</p>
*<p>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 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 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 bookmark collection.
*</p>
*<p>The "bookmark" Object type is identified by the URI <tt>http://activitystrea.ms/schema/1.0/bookmark</tt>.
*</p>
*<p>A bookmark has the following additional components:
*</p>
*<p></p>
*<blockquote class="text"><dl>
*<dt>Title</dt>
*<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 MAY use the title of
* the target resource as a default for this property where a user
* hasn't entered a customized value.
*</dd>
*<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>
* <p>
* 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
* 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
* pointer to the 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,
* 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
* the title and description of his or her own bookmarks to differ from the metadata on the target itself.
* </p>
* <p>
* Some implementations refer to this Object type as a "link". This specification uses the term "bookmark" to avoid confusion with the general concept of
* hyperlinks which apply to all Object types.
* </p>
* <p>
* 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
* 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
* 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
* bookmark collection.
* </p>
* <p>
* The "bookmark" Object type is identified by the URI <tt>http://activitystrea.ms/schema/1.0/bookmark</tt>.
* </p>
* <p>
* A bookmark has the following additional components:
* </p>
* <p>
* </p>
* <blockquote class="text">
* <dl>
* <dt>Title</dt>
* <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
* MAY use the title of the target resource as a default for this property where a user hasn't entered a customized value.</dd>
* <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
*/
public class Bookmark extends ActivityObject {
@ -84,16 +71,13 @@ public class Bookmark extends ActivityObject {
return "http://activitystrea.ms/schema/1.0/bookmark";
}
/**
* Get the value of thumbnail
*
* @return the value of thumbnail
*/
public Link getThumbnail() {
return this.findRelatedLink("thumbnail");
return findRelatedLink("thumbnail");
}
/**
@ -101,19 +85,19 @@ public class Bookmark extends ActivityObject {
*
* @param newthumbnail new value of thumbnail
*/
public void setThumbnail(Link newthumbnail) {
public void setThumbnail(final Link newthumbnail) {
Link old = null;
for(Link l : this.getOtherLinks()){
if("thumbnail".equals(l.getRel())){
for (final Link l : getOtherLinks()) {
if ("thumbnail".equals(l.getRel())) {
old = l;
break;
}
}
if(old != null){
this.getOtherLinks().remove(old);
if (old != null) {
getOtherLinks().remove(old);
newthumbnail.setRel("thumbnail");
}
this.getOtherLinks().add(newthumbnail);
getOtherLinks().add(newthumbnail);
}
}

View file

@ -18,37 +18,33 @@
package org.rometools.feed.module.activitystreams.types;
/**
* <p>The "comment" object type represents a textual response to
* another object.
*</p>
*<p>The comment object type MUST NOT be used for other kinds of
* replies, such as video replies or reviews.
*</p>
*<p>The "comment" object type is identified by the URI <tt>http://activitystrea.ms/schema/1.0/comment</tt>.
*</p>
*<p>A comment has the following additional components:
*</p>
*<p></p>
*<blockquote class="text"><dl>
*<dt>Subject</dt>
*<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 for a comment; such
* systems MUST omit the Name component. Processors SHOULD refer to
* such comments as simply being "a comment", with appropriate
* localization, if they are to be described in a sentence.
*</dd>
*<dt>Content</dt>
*<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
* represents the content. Publishers SHOULD include any markup
* necessary to achieve a similar presentation to that on the
* 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>
* <p>
* The "comment" object type represents a textual response to another object.
* </p>
* <p>
* The comment object type MUST NOT be used for other kinds of replies, such as video replies or reviews.
* </p>
* <p>
* The "comment" object type is identified by the URI <tt>http://activitystrea.ms/schema/1.0/comment</tt>.
* </p>
* <p>
* A comment has the following additional components:
* </p>
* <p>
* </p>
* <blockquote class="text">
* <dl>
* <dt>Subject</dt>
* <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
* for a comment; such systems MUST omit the Name component. Processors SHOULD refer to such comments as simply being "a comment", with appropriate
* localization, if they are to be described in a sentence.</dd>
* <dt>Content</dt>
* <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
* represents the content. Publishers SHOULD include any markup necessary to achieve a similar presentation to that on the 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
*/
public class Comment extends ActivityObject {

View file

@ -18,30 +18,27 @@
package org.rometools.feed.module.activitystreams.types;
/**
* <p>The "event" object type represents an event that occurs in a
* certain place during a particular interval of time.
*</p>
*<p>The object type URL for the "event" object type is <tt>http://activitystrea.ms/schema/1.0/event</tt>.
*</p>
*<p>An event has the following additional components:
*</p>
*<p></p>
*<blockquote class="text"><dl>
*<dt>Start Date and Time</dt>
*<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 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>
*<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 timestamp. [TODO: Reference W3CDTF spec.]
* [TODO: Include prose describing how to represent just a date vs.
* a date and time.]
*</dd>
*</dl></blockquote>
* <p>
* The "event" object type represents an event that occurs in a certain place during a particular interval of time.
* </p>
* <p>
* The object type URL for the "event" object type is <tt>http://activitystrea.ms/schema/1.0/event</tt>.
* </p>
* <p>
* An event has the following additional components:
* </p>
* <p>
* </p>
* <blockquote class="text">
* <dl>
* <dt>Start Date and Time</dt>
* <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
* 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>
* <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
* timestamp. [TODO: Reference W3CDTF spec.] [TODO: Include prose describing how to represent just a date vs. a date and time.]</dd>
* </dl>
* </blockquote>
*
* @author robert.cooper
*/

View file

@ -18,33 +18,32 @@
package org.rometools.feed.module.activitystreams.types;
/**
* <p>The "file" Object type represents some document or other file
* with no additional machine-readable semantics.
*</p>
*<p>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 fallback ability for clients that do not
* support the more specific Object type.
*</p>
*<p>The "file" Object type is identified by the URI <tt>http://activitystrea.ms/schema/1.0/file</tt>.
*</p>
*<p>A file has the following additional components:
*</p>
*<p></p>
*<blockquote class="text"><dl>
*<dt>Associated File URL</dt>
*<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 the URL.
*</dd>
*<dt>File MIME Type</dt>
*<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 containing the MIME type.
*</dd>
*</dl></blockquote>
* <p>
* The "file" Object type represents some document or other file with no additional machine-readable semantics.
* </p>
* <p>
* 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
* fallback ability for clients that do not support the more specific Object type.
* </p>
* <p>
* The "file" Object type is identified by the URI <tt>http://activitystrea.ms/schema/1.0/file</tt>.
* </p>
* <p>
* A file has the following additional components:
* </p>
* <p>
* </p>
* <blockquote class="text">
* <dl>
* <dt>Associated File URL</dt>
* <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
* the URL.</dd>
* <dt>File MIME Type</dt>
* <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
* containing the MIME type.</dd>
* </dl>
* </blockquote>
*
* @author robert.cooper
*/
public class File extends ActivityObject {
@ -54,6 +53,4 @@ public class File extends ActivityObject {
return "http://activitystrea.ms/schema/1.0/file";
}
}

View file

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

View file

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

View file

@ -21,26 +21,26 @@ import org.rometools.feed.module.georss.GeoRSSModule;
import org.rometools.feed.module.portablecontacts.ContactModule;
/**
* <p>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 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 GeoRSS
* specification. Addresses should be included using a poco:address
* element defined at Portable Contacts specification. The entry level
* location represents the location of the author at the time the
* activity was performed. The author level location represents the
* primary location of the author. Finally, the location within other
* objects represents the physical location of those objects. All
* location fields are optional. For free form addresses use the
* poco:formatted field.
*</p>
*<p><a class='info' href='#location-poco'>Figure&nbsp;1<span> (</span><span class='info'>Location Example</span><span>)</span></a>
*</p>
*<p><br /><hr class="insert" />
*<a name="location-poco"></a>
*</p>
*<div style='display: table; width: 0; margin-left: 3em; margin-right: auto'><pre>&lt;entry&gt;
* <p>
* 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
* 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
* GeoRSS specification. Addresses should be included using a poco:address element defined at Portable Contacts specification. The entry level location
* represents the location of the author at the time the activity was performed. The author level location represents the primary location of the author.
* Finally, the location within other objects represents the physical location of those objects. All location fields are optional. For free form addresses use
* the poco:formatted field.
* </p>
* <p>
* <a class='info' href='#location-poco'>Figure&nbsp;1<span> (</span><span class='info'>Location Example</span><span>)</span></a>
* </p>
* <p>
* <br />
* <hr class="insert" />
* <a name="location-poco"></a>
* </p>
* <div style='display: table; width: 0; margin-left: 3em; margin-right: auto'>
*
* <pre>
* &lt;entry&gt;
* &lt;id&gt;tag:world:activity:1212121212121&lt;/id&gt;
* &lt;title&gt;Rob liked Goldeberg's Deli&lt;/title&gt;
* &lt;author&gt;
@ -70,15 +70,25 @@ import org.rometools.feed.module.portablecontacts.ContactModule;
* &lt;/activity:object&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;/entry&gt;</pre></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" />
* &lt;/entry&gt;
* </pre>
*
* </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>
*
*</p>
* @author robert.cooper
*/
public interface HasLocation {
public GeoRSSModule getLocation();
public void setLocation(GeoRSSModule location);

View file

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

View file

@ -16,25 +16,23 @@
*/
package org.rometools.feed.module.activitystreams.types;
/**
*
*<p>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 activity. For the purpose of this
* schema, a mood is a freeform, short mood keyword or phrase along
* 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>
*<p>The content of the mood element is the mood keyword or
* phrase.
*</p>
*<p>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 appropriate to be displayed alongside the
* mood keyword at a normal text size.
*</p>
* <p>
* 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
* activity. For the purpose of this schema, a mood is a freeform, short mood keyword or phrase along 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>
* <p>
* The content of the mood element is the mood keyword or phrase.
* </p>
* <p>
* 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
* appropriate to be displayed alongside the mood keyword at a normal text size.
* </p>
*
* @author robert.cooper
*/
public class Mood {
@ -46,8 +44,8 @@ public class Mood {
*
* @param newiconUrl new value of iconUrl
*/
public void setIconUrl(String newiconUrl) {
this.iconUrl = newiconUrl;
public void setIconUrl(final String newiconUrl) {
iconUrl = newiconUrl;
}
/**
@ -56,7 +54,7 @@ public class Mood {
* @return the value of iconUrl
*/
public String getIconUrl() {
return this.iconUrl;
return iconUrl;
}
/**
@ -64,8 +62,8 @@ public class Mood {
*
* @param newtext new value of text
*/
public void setText(String newtext) {
this.text = newtext;
public void setText(final String newtext) {
text = newtext;
}
/**
@ -74,6 +72,6 @@ public class Mood {
* @return the value of text
*/
public String getText() {
return this.text;
return text;
}
}

View file

@ -18,35 +18,31 @@
package org.rometools.feed.module.activitystreams.types;
/**
*<p>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 to publish short, often plain-text messages
* whose useful lifespan is generally shorter than that of an article
* 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 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.
*</p>
*<p>The "note" Object type is identified by the URI <tt>http://activitystrea.ms/schema/1.0/note</tt>.
*</p>
*<p>A note has the following additional components:
*</p>
*<p></p>
*<blockquote class="text"><dl>
*<dt>Content</dt>
*<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
* represents the content. Publishers SHOULD include any markup
* necessary to achieve a similar presentation to that on the
* 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>
* <p>
* 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
* to publish short, often plain-text messages whose useful lifespan is generally shorter than that of an article 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
* 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.
* </p>
* <p>
* The "note" Object type is identified by the URI <tt>http://activitystrea.ms/schema/1.0/note</tt>.
* </p>
* <p>
* A note has the following additional components:
* </p>
* <p>
* </p>
* <blockquote class="text">
* <dl>
* <dt>Content</dt>
* <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
* represents the content. Publishers SHOULD include any markup necessary to achieve a similar presentation to that on the 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
*/
public class Note extends ActivityObject {

View file

@ -20,30 +20,29 @@ package org.rometools.feed.module.activitystreams.types;
import com.sun.syndication.feed.atom.Link;
/**
* <p>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 represented by a user account.
*</p>
*<p>The "person" Object type is identified by the URI <tt>http://activitystrea.ms/schema/1.0/person</tt>.
*</p>
*<p>A person has the following additional components:
*</p>
*<p></p>
*<blockquote class="text"><dl>
*<dt>Display Name</dt>
*<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 placed
* on what kind of name may be used here. Represented by the Name
* component of the base Object Construct.
*</dd>
*<dt>Avatar</dt>
*<dd>A link to an "avatar" or "userpic" image
* for the user. Represented by the Representative Image component
* of the base Object Construct.
*</dd>
*</dl></blockquote>
@author robert.cooper
* <p>
* 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
* represented by a user account.
* </p>
* <p>
* The "person" Object type is identified by the URI <tt>http://activitystrea.ms/schema/1.0/person</tt>.
* </p>
* <p>
* A person has the following additional components:
* </p>
* <p>
* </p>
* <blockquote class="text">
* <dl>
* <dt>Display Name</dt>
* <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
* placed on what kind of name may be used here. Represented by the Name component of the base Object Construct.</dd>
* <dt>Avatar</dt>
* <dd>A link to an "avatar" or "userpic" image for the user. Represented by the Representative Image component of the base Object Construct.</dd>
* </dl>
* </blockquote>
*
* @author robert.cooper
*/
public class Person extends ActivityObject {
@ -52,19 +51,17 @@ public class Person extends ActivityObject {
return "http://activitystrea.ms/schema/1.0/person";
}
/**
* Get the value of avatar
*
* @return the value of avatar
*/
public Link getAvatar() {
Link result = this.findRelatedLink("avatar");
if(result != null){
final Link result = findRelatedLink("avatar");
if (result != null) {
return result;
}
return this.findRelatedLink("userpic");
return findRelatedLink("userpic");
}
/**
@ -72,13 +69,13 @@ public class Person extends ActivityObject {
*
* @param newavatar new value of avatar
*/
public void setAvatar(Link newavatar) {
Link old = this.getAvatar();
if(old != null){
this.getOtherLinks().remove(old);
public void setAvatar(final Link newavatar) {
final Link old = getAvatar();
if (old != null) {
getOtherLinks().remove(old);
}
newavatar.setRel("avatar");
this.getOtherLinks().add(newavatar);
getOtherLinks().add(newavatar);
}
}

View file

@ -18,29 +18,28 @@
package org.rometools.feed.module.activitystreams.types;
/**
* <p>The "photo" object type represents a graphical still image.
*</p>
*<p>The "photo" Object type is identified by the URI <tt>http://activitystrea.ms/schema/1.0/photo</tt>.
*</p>
*<p>A photo has the following additional components:
*</p>
*<p></p>
*<blockquote class="text"><dl>
*<dt>Thumbnail</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 thumbnails that are
* of an inappropriate size for their user interface.
*</dd>
*<dt>Larger Image</dt>
*<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 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>
*</dl></blockquote>
* <p>
* The "photo" object type represents a graphical still image.
* </p>
* <p>
* The "photo" Object type is identified by the URI <tt>http://activitystrea.ms/schema/1.0/photo</tt>.
* </p>
* <p>
* A photo has the following additional components:
* </p>
* <p>
* </p>
* <blockquote class="text">
* <dl>
* <dt>Thumbnail</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
* thumbnails that are of an inappropriate size for their user interface.</dd>
* <dt>Larger Image</dt>
* <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
* 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>
* </dl>
* </blockquote>
*
* @author robert.cooper
*/
public class Photo extends ActivityObject {
@ -50,6 +49,4 @@ public class Photo extends ActivityObject {
return "http://activitystrea.ms/schema/1.0/photo";
}
}

View file

@ -18,23 +18,25 @@
package org.rometools.feed.module.activitystreams.types;
/**
* <p>The "photo album" object type represents a collection of
* images.
*</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 has the following additional components:
*</p>
*<p></p>
*<blockquote class="text"><dl>
*<dt>Preview Image Link</dt>
*<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
* the base Object Construct. Processors MAY ignore thumbnails that
* are of an inappropriate size for their user interface.
*</dd>
*</dl></blockquote>
* <p>
* The "photo album" object type represents a collection of images.
* </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 has the following additional components:
* </p>
* <p>
* </p>
* <blockquote class="text">
* <dl>
* <dt>Preview Image Link</dt>
* <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
* the base Object Construct. Processors MAY ignore thumbnails that are of an inappropriate size for their user interface.</dd>
* </dl>
* </blockquote>
*
* @author robert.cooper
*/
public class PhotoAlbum extends ActivityObject {

View file

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

View file

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

View file

@ -18,30 +18,28 @@
package org.rometools.feed.module.activitystreams.types;
/**
* <p>The "product" object type represents a commercial good or
* service.
*</p>
*<p>The "product" object type is identified by the URI <tt>http://activitystrea.ms/schema/1.0/product</tt>.
*</p>
*<p>A product has the following additional components:
*</p>
*<p></p>
*<blockquote class="text"><dl>
*<dt>Thumbnail</dt>
*<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.
* Processors MAY ignore thumbnails that are of an inappropriate
* size for their user interface.
*</dd>
*<dt>Larger Image</dt>
*<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 <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>
*</dl></blockquote>
* <p>
* The "product" object type represents a commercial good or service.
* </p>
* <p>
* The "product" object type is identified by the URI <tt>http://activitystrea.ms/schema/1.0/product</tt>.
* </p>
* <p>
* A product has the following additional components:
* </p>
* <p>
* </p>
* <blockquote class="text">
* <dl>
* <dt>Thumbnail</dt>
* <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.
* Processors MAY ignore thumbnails that are of an inappropriate size for their user interface.</dd>
* <dt>Larger Image</dt>
* <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
* <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>
* </dl>
* </blockquote>
*
* @author robert.cooper
*/
public class Product extends ActivityObject {

View file

@ -18,45 +18,35 @@
package org.rometools.feed.module.activitystreams.types;
/**
* <p>The "review" object type represents a primarily prose-based
* commentary on another object.
*</p>
*<p>The "review" object type is identified by the URI <tt>http://activitystrea.ms/schema/1.0/review</tt>.
*</p>
*<p>A review has the following additional components:
*</p>
*<p></p>
*<blockquote class="text"><dl>
*<dt>Title</dt>
*<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; 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 be described in a sentence.
*</dd>
*<dt>Content</dt>
*<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
* represents the content. Publishers SHOULD include any markup
* necessary to achieve a similar presentation to that on the
* 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>
*<dt>Reviewed Object</dt>
*<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>
* <p>
* The "review" object type represents a primarily prose-based commentary on another object.
* </p>
* <p>
* The "review" object type is identified by the URI <tt>http://activitystrea.ms/schema/1.0/review</tt>.
* </p>
* <p>
* A review has the following additional components:
* </p>
* <p>
* </p>
* <blockquote class="text">
* <dl>
* <dt>Title</dt>
* <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;
* 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
* be described in a sentence.</dd>
* <dt>Content</dt>
* <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
* represents the content. Publishers SHOULD include any markup necessary to achieve a similar presentation to that on the 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>
* <dt>Reviewed Object</dt>
* <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
*/
public class Review extends ActivityObject {

View file

@ -18,27 +18,27 @@
package org.rometools.feed.module.activitystreams.types;
/**
* <p>The "service" Object type represents a website, personal website
* or blog, business, brand, or other entity that performs some kind of
* work for other entities, people, or services, or acts as kind of
* container for other objects.
*</p>
*<p>The "service" Object type is identified by the URI <tt>http://activitystrea.ms/schema/1.0/service</tt>.
*</p>
*<p>A service has the following additional components:
*</p>
*<p></p>
*<blockquote class="text"><dl>
*<dt>icon</dt>
*<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 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 one (horizontal) to one (vertical) and
* SHOULD be suitable for presentation at a small size.
*</dd>
*</dl></blockquote>
* <p>
* The "service" Object type represents a website, personal website or blog, business, brand, or other entity that performs some kind of work for other
* entities, people, or services, or acts as kind of container for other objects.
* </p>
* <p>
* The "service" Object type is identified by the URI <tt>http://activitystrea.ms/schema/1.0/service</tt>.
* </p>
* <p>
* A service has the following additional components:
* </p>
* <p>
* </p>
* <blockquote class="text">
* <dl>
* <dt>icon</dt>
* <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
* 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
* one (horizontal) to one (vertical) and SHOULD be suitable for presentation at a small size.</dd>
* </dl>
* </blockquote>
*
* @author robert.cooper
*/
public class Service extends ActivityObject {

View file

@ -16,22 +16,23 @@
*/
package org.rometools.feed.module.activitystreams.types;
/**
* <p>The "song" Object type represents a song or a recording of a
* song.
*</p>
*<p>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 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 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
* <p>
* The "song" Object type represents a song or a recording of a song.
* </p>
* <p>
* 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
* 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
* 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
* rather than merely a generic audio stream.
*</p>
*<p>The Object type URL for the "song" Object type is <tt>http://activitystrea.ms/schema/1.0/song</tt>.
*</p>
*<p>A song has no additional components.
*</p>
* </p>
* <p>
* The Object type URL for the "song" Object type is <tt>http://activitystrea.ms/schema/1.0/song</tt>.
* </p>
* <p>
* A song has no additional components.
* </p>
*
* @author robert.cooper
*/
public class Song extends ActivityObject {
@ -42,8 +43,8 @@ public class Song extends ActivityObject {
*
* @param newaudio new value of audio
*/
public void setAudio(Audio newaudio) {
this.audio = newaudio;
public void setAudio(final Audio newaudio) {
audio = newaudio;
}
/**
@ -52,7 +53,7 @@ public class Song extends ActivityObject {
* @return the value of audio
*/
public Audio getAudio() {
return this.audio;
return audio;
}
@Override

View file

@ -18,22 +18,24 @@
package org.rometools.feed.module.activitystreams.types;
/**
* <p>The "status" Object type represents a human-readable update of
* the author's situation, mood, location or other status.
*</p>
*<p>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, feeling or experiencing.
*</p>
*<p>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 old. When a status becomes too old is
* not defined by this specification.
*</p>
*<p>The "status" object type is identified by the URI <tt>http://activitystrea.ms/schema/1.0/status</tt>.
*</p>
*<p>A status has the same components as a note.
*</p>
* <p>
* The "status" Object type represents a human-readable update of the author's situation, mood, location or other status.
* </p>
* <p>
* 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,
* feeling or experiencing.
* </p>
* <p>
* 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
* old. When a status becomes too old is not defined by this specification.
* </p>
* <p>
* The "status" object type is identified by the URI <tt>http://activitystrea.ms/schema/1.0/status</tt>.
* </p>
* <p>
* A status has the same components as a note.
* </p>
*
* @author robert.cooper
*/
public class Status extends ActivityObject {

View file

@ -16,31 +16,26 @@
*/
package org.rometools.feed.module.activitystreams.types;
/**
*
* @author robert.cooper
*/
public enum Verb {
/**
* 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 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 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 3.1.8.
* The verb URI for the "mark as favorite" Verb is http://activitystrea.ms/schema/1.0/favorite.
* 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
* 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
* 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
* 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"),
/**
* 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, but it can
* potentially be of any type that can sensibly generate 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,
* but it can 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.
*
* Processors MAY ignore (silently drop) successive identical "start following" activities
* regardless of whether they maintain state sufficient to determine (A), (B), or (C) above.
* Processors MAY ignore (silently drop) successive identical "start following" activities regardless of whether they maintain state sufficient to determine
* (A), (B), or (C) above.
*/
START_FOLLOWING("http://activitystrea.ms/schema/1.0/follow"),
/**
@ -52,128 +47,114 @@ public enum Verb {
/**
* 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
* activities with this Verb unless they are able to verify through some external means that
* there is in fact a reciprocated connection. For example, a processor MAY have received a
* guarantee from a particular publisher that the publisher will only use this Verb in cases
* where a reciprocal relationship exists.
* 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
* through some external means that there is in fact a reciprocated connection. For example, a processor MAY have received a 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.
*/
MAKE_FRIEND("http://activitystrea.ms/schema/1.0/make-friend"),
/**
* 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 Group,
* though implementors SHOULD be prepared to handle other Object types as meaning
* MAY be provided by extension specifications.
* 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
* Group, 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.
*/
JOIN("http://activitystrea.ms/schema/1.0/join"),
/**
* 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 watched all or part of the video.
* 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
* watched all or part of the video.
*
* The "play" Verb is identified by the URI 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.
* It is only referenced here for completeness.
* The "Post" Verb is described in section 8 of the AtomActivity specification. It is only referenced here for completeness.
*
* 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
* interest primarily to him- or herself. Though this action MAY be shared 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 by the "share"
* Verb (Section 3.1.9).
* 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
* 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
* by the "share" Verb (Section 3.1.9).
*
* The "save" Verb is identified by the URI 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.
* In most cases, the actor did not create the Object being shared, but is instead
* drawing attention to it.
* 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
* instead drawing attention to it.
*
* The "share" Verb is identified by the URI 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
* inside another object. For example, the actor may have specified that a particular
* user appears in a photo.
* 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
* particular user appears in a photo.
*
* 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.
* For example, if a user appears in a photo, the activity:object is the user and
* the activity:target is the photo.
* 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
* and the activity:target is the photo.
*/
TAG("http://activitystrea.ms/schema/1.0/tag"),
/**
* 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
* new items to a Section 3.2.8 or similar. Update is reserved for modifications
* to existing Objects or data such as changing a user's profile information.
* 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
* modifications 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.
*/
UPDATE("http://activitystrea.ms/schema/1.0/update"),
/**
*
*<p>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 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
* handle other object types as meaning MAY be provided by extension
* specifications.
*</p>
*<p>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 has been added as an attendee by an event
* 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>
* <p>
* 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
* 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 handle other object types as meaning MAY be provided by extension specifications.
* </p>
* <p>
* 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
* has been added as an attendee by an event 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>
*/
RSVP_YES("http://activitystrea.ms/schema/1.0/rsvp-yes"),
/**
* <p>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 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
* handle other object types as meaning MAY be provided by extension
* specifications.
*</p>
*<p>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 has been added as an attendee by an event
* 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>
* <p>
* 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
* 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 handle other object types as meaning MAY be provided by extension specifications.
* </p>
* <p>
* 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
* has been added as an attendee by an event 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>
*/
RSVP_MAYBE("http://activitystrea.ms/schema/1.0/rsvp-maybe"),
/**
* <p>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 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
* handle other object types as meaning MAY be provided by extension
* specifications.
*</p>
*<p>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 has been added as an attendee by an event
* 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>
* <p>
* 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
* 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 handle other object types as meaning MAY be provided by extension specifications.
* </p>
* <p>
* 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
* has been added as an attendee by an event 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>
*/
RSVP_NO("http://activitystrea.ms/schema/1.0/rsvp-no");
private final String iri;
@ -181,22 +162,23 @@ public enum Verb {
/**
* @param iri
*/
Verb(final String iri){
Verb(final String iri) {
this.iri = iri;
}
@Override
public String toString(){
public String toString() {
return iri;
}
/**
*
* @param iri
* @return
*/
public static Verb fromIRI(String iri){
for(Verb v: Verb.values()){
if(v.toString().equals(iri)){
public static Verb fromIRI(final String iri) {
for (final Verb v : Verb.values()) {
if (v.toString().equals(iri)) {
return v;
}
}

View file

@ -18,29 +18,28 @@
package org.rometools.feed.module.activitystreams.types;
/**
* <p>The "video" Object type represents video content, which usually
* consists of a motion picture track and an audio track.
*</p>
*<p>The "video" Object type is identified by the URI <tt>http://activitystrea.ms/schema/1.0/video</tt>.
*</p>
*<p>A video has the following additional components:
*</p>
*<p></p>
*<blockquote class="text"><dl>
*<dt>Video Stream Link</dt>
*<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 properties as defined in [TODO: xref the JSON
* serialization of a Media Link Construct]
*</dd>
*<dt>Embed Code</dt>
*<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 called <tt>embedCode</tt> whose value is a JSON string
* containing the fragment of HTML.
*</dd>
*</dl></blockquote>
* <p>
* The "video" Object type represents video content, which usually consists of a motion picture track and an audio track.
* </p>
* <p>
* The "video" Object type is identified by the URI <tt>http://activitystrea.ms/schema/1.0/video</tt>.
* </p>
* <p>
* A video has the following additional components:
* </p>
* <p>
* </p>
* <blockquote class="text">
* <dl>
* <dt>Video Stream Link</dt>
* <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
* properties as defined in [TODO: xref the JSON serialization of a Media Link Construct]</dd>
* <dt>Embed Code</dt>
* <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
* called <tt>embedCode</tt> whose value is a JSON string containing the fragment of HTML.</dd>
* </dl>
* </blockquote>
*
* @author robert.cooper
*/
public class Video {

View file

@ -41,10 +41,9 @@ package org.rometools.feed.module.base;
import java.util.Date;
/**
* This is an interface for the GoogleBase plug in that exposes methods used for
* Article or News entry types.
* This is an interface for the GoogleBase plug in that exposes methods used for Article or News entry types.
*
* @author <a href="mailto:cooper@screaming-penguin.com">Robert "kebernet" Cooper</a>
* @version $Revision: 1.2 $
*/
@ -53,38 +52,33 @@ public interface Article extends GlobalInterface {
* Array of Author Names. Limit 10.
* <table border="1" cellpadding="5" cellspacing="0" width="640">
*
* <tbody><tr valign="top">
* <td colspan="2" bgcolor="#dddddd" valign="top"><font size="-1">
* <b><a name="author"></a>author</b></font></td>
* <tbody>
* <tr valign="top">
* <td colspan="2" bgcolor="#dddddd" valign="top"><font size="-1"> <b><a name="author"></a>author</b></font></td>
* </tr>
* <tr valign="top">
* <td width="120"><font size="-1">
* <b>Details</b></font></td>
* <td width="120"><font size="-1"> <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 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"> &lt;g:author&gt;John Steinbeck&lt;/g:author&gt;</font></td>
*
* </tr>
* <tr valign="top">
* <td width="120"><font size="-1">
* <b>Attribute of</b></font></td>
* <td><font size="-1">
* Reference Items, News and Articles</font></td>
* <td width="120"><font size="-1"> <b>Attribute of</b></font></td>
* <td><font size="-1"> Reference Items, News and Articles</font></td>
* </tr>
*
* <tr valign="top">
*
* <td width="120"><font size="-1">
* <b>Content type</b></font></td>
* <td><font size="-1">
* string</font></td>
* <td width="120"><font size="-1"> <b>Content type</b></font></td>
* <td><font size="-1"> string</font></td>
* </tr>
* </tbody></table>
* </tbody>
* </table>
*
* @param authors Array of Author Names. Limit 10.
*/
public void setAuthors(String[] authors);
@ -93,38 +87,33 @@ public interface Article extends GlobalInterface {
* Array of Author Names. Limit 10.
* <table border="1" cellpadding="5" cellspacing="0" width="640">
*
* <tbody><tr valign="top">
* <td colspan="2" bgcolor="#dddddd" valign="top"><font size="-1">
* <b><a name="author"></a>author</b></font></td>
* <tbody>
* <tr valign="top">
* <td colspan="2" bgcolor="#dddddd" valign="top"><font size="-1"> <b><a name="author"></a>author</b></font></td>
* </tr>
* <tr valign="top">
* <td width="120"><font size="-1">
* <b>Details</b></font></td>
* <td width="120"><font size="-1"> <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 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"> &lt;g:author&gt;John Steinbeck&lt;/g:author&gt;</font></td>
*
* </tr>
* <tr valign="top">
* <td width="120"><font size="-1">
* <b>Attribute of</b></font></td>
* <td><font size="-1">
* Reference Items, News and Articles</font></td>
* <td width="120"><font size="-1"> <b>Attribute of</b></font></td>
* <td><font size="-1"> Reference Items, News and Articles</font></td>
* </tr>
*
* <tr valign="top">
*
* <td width="120"><font size="-1">
* <b>Content type</b></font></td>
* <td><font size="-1">
* string</font></td>
* <td width="120"><font size="-1"> <b>Content type</b></font></td>
* <td><font size="-1"> string</font></td>
* </tr>
* </tbody></table>
* </tbody>
* </table>
*
* @return Array of author names.
*/
public String[] getAuthors();
@ -134,41 +123,37 @@ public interface Article extends GlobalInterface {
*
*
* <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 valign="top">
* <td width="120"><font size="-1">
* <b>Details</b></font></td>
* <td width="120"><font size="-1"> <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 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"> &lt;g:news_source&gt;Journal&lt;/g:news_source&gt;</font></td>
*
* </tr>
*
* <tr valign="top">
* <td width="120"><font size="-1">
* <b>Attribute of</b></font></td>
* <td><font size="-1">
* News and Articles</font></td>
* <td width="120"><font size="-1"> <b>Attribute of</b></font></td>
* <td><font size="-1"> News and Articles</font></td>
* </tr>
*
* <tr valign="top">
* <td width="120"><font size="-1">
*
* <b>Content type</b></font></td>
* <td><font size="-1">
* string</font></td>
* <td><font size="-1"> string</font></td>
* </tr>
* </tbody></table>
* </tbody>
* </table>
*
* @param newsSource Source for this article
*/
public void setNewsSource(String newsSource);
@ -177,41 +162,37 @@ public interface Article extends GlobalInterface {
* Source for this article.
*
* <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 valign="top">
* <td width="120"><font size="-1">
* <b>Details</b></font></td>
* <td width="120"><font size="-1"> <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 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"> &lt;g:news_source&gt;Journal&lt;/g:news_source&gt;</font></td>
*
* </tr>
*
* <tr valign="top">
* <td width="120"><font size="-1">
* <b>Attribute of</b></font></td>
* <td><font size="-1">
* News and Articles</font></td>
* <td width="120"><font size="-1"> <b>Attribute of</b></font></td>
* <td><font size="-1"> News and Articles</font></td>
* </tr>
*
* <tr valign="top">
* <td width="120"><font size="-1">
*
* <b>Content type</b></font></td>
* <td><font size="-1">
* string</font></td>
* <td><font size="-1"> string</font></td>
* </tr>
* </tbody></table>
* </tbody>
* </table>
*
* @return source for this article.
*/
public String getNewsSource();
@ -221,41 +202,38 @@ public interface Article extends GlobalInterface {
*
* <table border="1" cellpadding="5" cellspacing="0" width="640">
*
* <tbody><tr valign="top">
* <td colspan="2" bgcolor="#dddddd" valign="top"><font size="-1">
* <b><a name="pages"></a>pages</b></font></td>
* <tbody>
* <tr valign="top">
* <td colspan="2" bgcolor="#dddddd" valign="top"><font size="-1"> <b><a name="pages"></a>pages</b></font></td>
*
* </tr>
* <tr valign="top">
* <td width="120"><font size="-1">
* <b>Details</b></font></td>
* <td width="120"><font size="-1"> <b>Details</b></font></td>
* <td><font size="-1">
*
* The number of pages in the publication.</font></td>
* </tr>
*
* <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"> &lt;g:pages&gt;18&lt;/g:pages&gt;</font></td>
*
* </tr>
* <tr valign="top">
*
* <td width="120"><font size="-1">
* <b>Attribute of</b></font></td>
* <td><font size="-1">
* Reference Items, News and Articles</font></td>
* <td width="120"><font size="-1"> <b>Attribute of</b></font></td>
* <td><font size="-1"> Reference Items, News and Articles</font></td>
* </tr>
* <tr valign="top">
*
* <td width="120"><font size="-1">
*
* <b>Content type</b></font></td>
* <td><font size="-1">
* integer</font></td>
* <td><font size="-1"> integer</font></td>
* </tr>
* </tbody></table>
* </tbody>
* </table>
*
* @param pages Number of pages in the article
*/
public void setPages(Integer pages);
@ -265,41 +243,38 @@ public interface Article extends GlobalInterface {
*
* <table border="1" cellpadding="5" cellspacing="0" width="640">
*
* <tbody><tr valign="top">
* <td colspan="2" bgcolor="#dddddd" valign="top"><font size="-1">
* <b><a name="pages"></a>pages</b></font></td>
* <tbody>
* <tr valign="top">
* <td colspan="2" bgcolor="#dddddd" valign="top"><font size="-1"> <b><a name="pages"></a>pages</b></font></td>
*
* </tr>
* <tr valign="top">
* <td width="120"><font size="-1">
* <b>Details</b></font></td>
* <td width="120"><font size="-1"> <b>Details</b></font></td>
* <td><font size="-1">
*
* The number of pages in the publication.</font></td>
* </tr>
*
* <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"> &lt;g:pages&gt;18&lt;/g:pages&gt;</font></td>
*
* </tr>
* <tr valign="top">
*
* <td width="120"><font size="-1">
* <b>Attribute of</b></font></td>
* <td><font size="-1">
* Reference Items, News and Articles</font></td>
* <td width="120"><font size="-1"> <b>Attribute of</b></font></td>
* <td><font size="-1"> Reference Items, News and Articles</font></td>
* </tr>
* <tr valign="top">
*
* <td width="120"><font size="-1">
*
* <b>Content type</b></font></td>
* <td><font size="-1">
* integer</font></td>
* <td><font size="-1"> integer</font></td>
* </tr>
* </tbody></table>
* </tbody>
* </table>
*
* @return Number of pages in the article
*/
public Integer getPages();
@ -308,17 +283,16 @@ public interface Article extends GlobalInterface {
* Date article was published.
*
* <table border="1" cellpadding="5" cellspacing="0" width="640">
* <tbody><tr valign="top">
* <td colspan="2" bgcolor="#dddddd"><font size="-1">
* <b><a name="publish_date"></a>publish_date</b></font></td>
* <tbody>
* <tr valign="top">
* <td colspan="2" bgcolor="#dddddd"><font size="-1"> <b><a name="publish_date"></a>publish_date</b></font></td>
*
* </tr>
* <tr valign="top">
* <td width="120"><font size="-1">
*
* <b>Details</b></font></td>
* <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:
* <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:
* YYYY-MM-DD</font></td>
*
* </tr>
@ -330,11 +304,9 @@ public interface Article extends GlobalInterface {
* </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">
* Reference Items</font></td>
* <td><font size="-1"> Reference Items</font></td>
* </tr>
* <tr valign="top">
* <td width="120"><font size="-1">
@ -344,7 +316,9 @@ public interface Article extends GlobalInterface {
*
* date</font></td>
* </tr>
* </tbody></table>
* </tbody>
* </table>
*
* @param publishDate Date article was published
*/
public void setPublishDate(Date publishDate);
@ -353,17 +327,16 @@ public interface Article extends GlobalInterface {
* Date article was published.
*
* <table border="1" cellpadding="5" cellspacing="0" width="640">
* <tbody><tr valign="top">
* <td colspan="2" bgcolor="#dddddd"><font size="-1">
* <b><a name="publish_date"></a>publish_date</b></font></td>
* <tbody>
* <tr valign="top">
* <td colspan="2" bgcolor="#dddddd"><font size="-1"> <b><a name="publish_date"></a>publish_date</b></font></td>
*
* </tr>
* <tr valign="top">
* <td width="120"><font size="-1">
*
* <b>Details</b></font></td>
* <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:
* <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:
* YYYY-MM-DD</font></td>
*
* </tr>
@ -375,11 +348,9 @@ public interface Article extends GlobalInterface {
* </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">
* Reference Items</font></td>
* <td><font size="-1"> Reference Items</font></td>
* </tr>
* <tr valign="top">
* <td width="120"><font size="-1">
@ -389,7 +360,9 @@ public interface Article extends GlobalInterface {
*
* date</font></td>
* </tr>
* </tbody></table>
* </tbody>
* </table>
*
* @return Date article was published
*/
public Date getPublishDate();

View file

@ -40,10 +40,9 @@ package org.rometools.feed.module.base;
import org.rometools.feed.module.base.types.DateTimeRange;
/**
* This is an interface for the GoogleBase plug in that exposes methods used for
* Class or Course information entry types.
* This is an interface for the GoogleBase plug in that exposes methods used for Class or Course information entry types.
*
* @author <a href="mailto:cooper@screaming-penguin.com">Robert "kebernet" Cooper</a>
* @version $Revision: 1.2 $
*/
@ -54,29 +53,27 @@ public interface Course extends GlobalInterface {
*
* <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 valign="top">
* <td width="120"><font size="-1">
* <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 8601</a>. Two sub-attributes
* are included in course_date_range attribute.<ul type="disc">
* <td width="120"><font size="-1"> <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
* 8601</a>. Two sub-attributes are included in course_date_range attribute.
* <ul type="disc">
*
* <li>start = Start date and time of a trip in
* format YYYY-MM-DDThh:mm:ss</li>
* <li>end = End date and time of a trip in
* format YYYY-MM-DDThh:mm:ss</li></ul></font></td>
* <li>start = Start date and time of a trip in format YYYY-MM-DDThh:mm:ss</li>
* <li>end = End date and time of a trip in format YYYY-MM-DDThh:mm:ss</li>
* </ul>
* </font></td>
* </tr>
* <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"> &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:course_date_range&gt;</font></td>
* </tr>
@ -85,18 +82,18 @@ public interface Course extends GlobalInterface {
* <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 valign="top">
* <td width="120"><font size="-1">
*
* <b>Content type</b></font></td>
*
* <td><font size="-1">
* dateTimeRange</font></td>
* <td><font size="-1"> dateTimeRange</font></td>
* </tr>
* </tbody></table>
* </tbody>
* </table>
*
* @param courseDateRange The timeframe a course is running
*/
public void setCourseDateRange(DateTimeRange courseDateRange);
@ -107,29 +104,27 @@ public interface Course extends GlobalInterface {
*
* <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 valign="top">
* <td width="120"><font size="-1">
* <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 8601</a>. Two sub-attributes
* are included in course_date_range attribute.<ul type="disc">
* <td width="120"><font size="-1"> <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
* 8601</a>. Two sub-attributes are included in course_date_range attribute.
* <ul type="disc">
*
* <li>start = Start date and time of a trip in
* format YYYY-MM-DDThh:mm:ss</li>
* <li>end = End date and time of a trip in
* format YYYY-MM-DDThh:mm:ss</li></ul></font></td>
* <li>start = Start date and time of a trip in format YYYY-MM-DDThh:mm:ss</li>
* <li>end = End date and time of a trip in format YYYY-MM-DDThh:mm:ss</li>
* </ul>
* </font></td>
* </tr>
* <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"> &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:course_date_range&gt;</font></td>
* </tr>
@ -138,18 +133,18 @@ public interface Course extends GlobalInterface {
* <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 valign="top">
* <td width="120"><font size="-1">
*
* <b>Content type</b></font></td>
*
* <td><font size="-1">
* dateTimeRange</font></td>
* <td><font size="-1"> dateTimeRange</font></td>
* </tr>
* </tbody></table>
* </tbody>
* </table>
*
* @return The timeframe a course is running
*/
public DateTimeRange getCourseDateRange();
@ -159,34 +154,35 @@ public interface Course extends GlobalInterface {
*
*
* <table border="1" cellpadding="5" cellspacing="0" width="640">
* <tbody><tr valign="top">
* <td colspan="2" bgcolor="#dddddd" valign="top"> <font size="-1"><b><a name="course_number"></a>course_number</b></font></td>
* <tbody>
* <tr valign="top">
* <td colspan="2" bgcolor="#dddddd" valign="top"><font size="-1"><b><a name="course_number"></a>course_number</b></font></td>
* </tr>
* <tr valign="top">
* <td width="120"> <font size="-1"><b>Details</b></font></td>
* <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">
* <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>
* <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">
*
* <td width="120"> <font size="-1"><b>Attribute
* of</b></font></td>
* <td> <font size="-1">Course schedules</font></td>
* <td width="120"><font size="-1"><b>Attribute of</b></font></td>
* <td><font size="-1">Course schedules</font></td>
* </tr>
* <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>
* <td><font size="-1">string</font></td>
*
* </tr>
* </tbody></table>
* </tbody>
* </table>
*
* @param courseNumber ID code associated with a course
*/
public void setCourseNumber(String courseNumber);
@ -197,34 +193,35 @@ public interface Course extends GlobalInterface {
*
*
* <table border="1" cellpadding="5" cellspacing="0" width="640">
* <tbody><tr valign="top">
* <td colspan="2" bgcolor="#dddddd" valign="top"> <font size="-1"><b><a name="course_number"></a>course_number</b></font></td>
* <tbody>
* <tr valign="top">
* <td colspan="2" bgcolor="#dddddd" valign="top"><font size="-1"><b><a name="course_number"></a>course_number</b></font></td>
* </tr>
* <tr valign="top">
* <td width="120"> <font size="-1"><b>Details</b></font></td>
* <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">
* <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>
* <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">
*
* <td width="120"> <font size="-1"><b>Attribute
* of</b></font></td>
* <td> <font size="-1">Course schedules</font></td>
* <td width="120"><font size="-1"><b>Attribute of</b></font></td>
* <td><font size="-1">Course schedules</font></td>
* </tr>
* <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>
* <td><font size="-1">string</font></td>
*
* </tr>
* </tbody></table>
* </tbody>
* </table>
*
* @return ID code associated with a course
*/
public String getCourseNumber();
@ -234,34 +231,35 @@ public interface Course extends GlobalInterface {
*
*
* <table border="1" cellpadding="5" cellspacing="0" width="640">
* <tbody><tr valign="top">
* <td colspan="2" bgcolor="#dddddd" valign="top"> <font size="-1"><b><a name="course_times"></a>course_times</b></font></td>
* <tbody>
* <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 valign="top">
* <td width="120"> <font size="-1"><b>Details</b></font></td>
* <td> <font size="-1">Time a class is in session.</font></td>
* <td width="120"><font size="-1"><b>Details</b></font></td>
* <td><font size="-1">Time a class is in session.</font></td>
* </tr>
* <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">&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">
* <td width="120"> <font size="-1"><b>Attribute
* of</b></font></td>
* <td> <font size="-1">Course schedules</font></td>
* <td width="120"><font size="-1"><b>Attribute of</b></font></td>
* <td><font size="-1">Course schedules</font></td>
*
* </tr>
* <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>
* <td><font size="-1">string</font></td>
* </tr>
* </tbody></table>
* </tbody>
* </table>
*
* @param courseTimes Time a class is in session
*/
public void setCourseTimes(String courseTimes);
@ -272,34 +270,35 @@ public interface Course extends GlobalInterface {
*
*
* <table border="1" cellpadding="5" cellspacing="0" width="640">
* <tbody><tr valign="top">
* <td colspan="2" bgcolor="#dddddd" valign="top"> <font size="-1"><b><a name="course_times"></a>course_times</b></font></td>
* <tbody>
* <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 valign="top">
* <td width="120"> <font size="-1"><b>Details</b></font></td>
* <td> <font size="-1">Time a class is in session.</font></td>
* <td width="120"><font size="-1"><b>Details</b></font></td>
* <td><font size="-1">Time a class is in session.</font></td>
* </tr>
* <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">&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">
* <td width="120"> <font size="-1"><b>Attribute
* of</b></font></td>
* <td> <font size="-1">Course schedules</font></td>
* <td width="120"><font size="-1"><b>Attribute of</b></font></td>
* <td><font size="-1">Course schedules</font></td>
*
* </tr>
* <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>
* <td><font size="-1">string</font></td>
* </tr>
* </tbody></table>
* </tbody>
* </table>
*
* @return Time a class is in session
*/
public String getCourseTimes();
@ -310,43 +309,40 @@ public interface Course extends GlobalInterface {
*
*
* <table border="1" cellpadding="5" cellspacing="0" width="640">
* <tbody><tr valign="top">
* <td colspan="2" bgcolor="#dddddd" valign="top"><font size="-1">
* <b><a name="salary"></a>salary</b></font></td>
* <tbody>
* <tr valign="top">
* <td colspan="2" bgcolor="#dddddd" valign="top"><font size="-1"> <b><a name="salary"></a>salary</b></font></td>
* </tr>
*
* <tr valign="top">
*
* <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>
* <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 valign="top">
*
* <td width="120"><font size="-1">
*
* <b>Example</b></font></td>
* <td><font size="-1">
* &lt;g:salary&gt;55000&lt;/g:salary&gt;</font></td>
* <td><font size="-1"> &lt;g:salary&gt;55000&lt;/g:salary&gt;</font></td>
* </tr>
* <tr valign="top">
* <td width="120"><font size="-1">
*
* <b>Attribute of</b></font></td>
*
* <td><font size="-1">
* Jobs</font></td>
* <td><font size="-1"> Jobs</font></td>
* </tr>
* <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">
*
* float</font></td>
* </tr>
* </tbody></table>
* </tbody>
* </table>
*
* @param salary Salary for this position
*/
public void setSalary(Float salary);
@ -356,43 +352,40 @@ public interface Course extends GlobalInterface {
*
*
* <table border="1" cellpadding="5" cellspacing="0" width="640">
* <tbody><tr valign="top">
* <td colspan="2" bgcolor="#dddddd" valign="top"><font size="-1">
* <b><a name="salary"></a>salary</b></font></td>
* <tbody>
* <tr valign="top">
* <td colspan="2" bgcolor="#dddddd" valign="top"><font size="-1"> <b><a name="salary"></a>salary</b></font></td>
* </tr>
*
* <tr valign="top">
*
* <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>
* <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 valign="top">
*
* <td width="120"><font size="-1">
*
* <b>Example</b></font></td>
* <td><font size="-1">
* &lt;g:salary&gt;55000&lt;/g:salary&gt;</font></td>
* <td><font size="-1"> &lt;g:salary&gt;55000&lt;/g:salary&gt;</font></td>
* </tr>
* <tr valign="top">
* <td width="120"><font size="-1">
*
* <b>Attribute of</b></font></td>
*
* <td><font size="-1">
* Jobs</font></td>
* <td><font size="-1"> Jobs</font></td>
* </tr>
* <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">
*
* float</font></td>
* </tr>
* </tbody></table>
* </tbody>
* </table>
*
* @return Salary for this position
*/
public Float getSalary();
@ -402,39 +395,36 @@ public interface Course extends GlobalInterface {
*
*
* <table border="1" cellpadding="5" cellspacing="0" width="640">
* <tbody><tr valign="top">
* <td colspan="2" bgcolor="#dddddd" valign="top"><font size="-1">
* <b><a name="subject"></a>subject</b></font></td>
* <tbody>
* <tr valign="top">
* <td colspan="2" bgcolor="#dddddd" valign="top"><font size="-1"> <b><a name="subject"></a>subject</b></font></td>
* </tr>
* <tr valign="top">
*
* <td width="120"><font size="-1">
*
* <b>Details</b></font></td>
* <td><font size="-1">
* Topic of study for a course.</font></td>
* <td><font size="-1"> Topic of study for a course.</font></td>
* </tr>
* <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"> &lt;g:subject&gt;Trigonometry&lt;/g:subject&gt;</font></td>
* </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>
* </tr>
* <tr valign="top">
* <td width="120"><font size="-1">
* <b>Content type</b></font></td>
* <td><font size="-1">
* string</font></td>
* <td width="120"><font size="-1"> <b>Content type</b></font></td>
* <td><font size="-1"> string</font></td>
*
* </tr>
* </tbody></table>
* </tbody>
* </table>
*
* @param subject Topics of study for a course
*/
public void setSubjects(String[] subject);
@ -444,39 +434,36 @@ public interface Course extends GlobalInterface {
*
*
* <table border="1" cellpadding="5" cellspacing="0" width="640">
* <tbody><tr valign="top">
* <td colspan="2" bgcolor="#dddddd" valign="top"><font size="-1">
* <b><a name="subject"></a>subject</b></font></td>
* <tbody>
* <tr valign="top">
* <td colspan="2" bgcolor="#dddddd" valign="top"><font size="-1"> <b><a name="subject"></a>subject</b></font></td>
* </tr>
* <tr valign="top">
*
* <td width="120"><font size="-1">
*
* <b>Details</b></font></td>
* <td><font size="-1">
* Topic of study for a course.</font></td>
* <td><font size="-1"> Topic of study for a course.</font></td>
* </tr>
* <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"> &lt;g:subject&gt;Trigonometry&lt;/g:subject&gt;</font></td>
* </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>
* </tr>
* <tr valign="top">
* <td width="120"><font size="-1">
* <b>Content type</b></font></td>
* <td><font size="-1">
* string</font></td>
* <td width="120"><font size="-1"> <b>Content type</b></font></td>
* <td><font size="-1"> string</font></td>
*
* </tr>
* </tbody></table>
* </tbody>
* </table>
*
* @return Topics of study for a course
*/
public String[] getSubjects();
@ -484,22 +471,19 @@ public interface Course extends GlobalInterface {
/**
* Name of the school at which a class is offered.
* <table border="1" cellpadding="5" cellspacing="0" width="640">
* <tbody><tr valign="top">
* <td colspan="2" bgcolor="#dddddd" valign="top"><font size="-1">
* <b><a name="university"></a>university</b></font></td>
* <tbody>
* <tr valign="top">
* <td colspan="2" bgcolor="#dddddd" valign="top"><font size="-1"> <b><a name="university"></a>university</b></font></td>
*
* </tr>
* <tr valign="top">
* <td width="120"><font size="-1">
* <b>Details</b></font></td>
* <td><font size="-1">
* Name of the school a class is offered at. </font></td>
* <td width="120"><font size="-1"> <b>Details</b></font></td>
* <td><font size="-1"> Name of the school a class is offered at. </font></td>
* </tr>
*
* <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"> &lt;g:university&gt;Stanford&lt;/g:university&gt;</font></td>
* </tr>
* <tr valign="top">
@ -507,18 +491,18 @@ public interface Course extends GlobalInterface {
* <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 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>
* </tbody></table>
* </tbody>
* </table>
*
* @param university Name of the school at which a class is offered.
*/
public void setUniversity(String university);
@ -526,22 +510,19 @@ public interface Course extends GlobalInterface {
/**
* Name of the school at which a class is offered.
* <table border="1" cellpadding="5" cellspacing="0" width="640">
* <tbody><tr valign="top">
* <td colspan="2" bgcolor="#dddddd" valign="top"><font size="-1">
* <b><a name="university"></a>university</b></font></td>
* <tbody>
* <tr valign="top">
* <td colspan="2" bgcolor="#dddddd" valign="top"><font size="-1"> <b><a name="university"></a>university</b></font></td>
*
* </tr>
* <tr valign="top">
* <td width="120"><font size="-1">
* <b>Details</b></font></td>
* <td><font size="-1">
* Name of the school a class is offered at. </font></td>
* <td width="120"><font size="-1"> <b>Details</b></font></td>
* <td><font size="-1"> Name of the school a class is offered at. </font></td>
* </tr>
*
* <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"> &lt;g:university&gt;Stanford&lt;/g:university&gt;</font></td>
* </tr>
* <tr valign="top">
@ -549,18 +530,18 @@ public interface Course extends GlobalInterface {
* <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 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>
* </tbody></table>
* </tbody>
* </table>
*
* @return Name of the school at which a class is offered.
*/
public String getUniversity();

View file

@ -20,9 +20,9 @@
package org.rometools.feed.module.base;
/**
* This class represents a custom tag name and value.
*
* @author <a href="mailto:cooper@screaming-penguin.com">Robert "kebernet" Cooper</a>
* @version $Revision: 1.2 $
*/
@ -30,16 +30,17 @@ public interface CustomTag {
/**
* Returns the tag name used.
*
* @return Returns the tag name used.
*/
public String getName();
/**
* The value of the custom tag.
* <br>
* The value of the custom tag. <br>
* <br>
* <table border="1" cellpadding="6" cellspacing="0">
* <tbody><tr valign="top">
* <tbody>
* <tr valign="top">
* <td><strong><font size="-1">Type (JavaType)</font></strong></td>
*
* <td><strong><font size="-1">Description</font></strong></td>
@ -91,9 +92,11 @@ public interface CustomTag {
* <tr valign="top">
* <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>
* </tr>
@ -117,7 +120,9 @@ public interface CustomTag {
* <td><font size="-1">921 W. Dana Street, Mtn View, CA-94103 </font></td>
* </tr>
*
* </tbody></table>
* </tbody>
* </table>
*
* @return The value of the tag. The objects class is determined by the "type" attribute on the tag.
*/
public Object getValue();

View file

@ -19,179 +19,191 @@
*/
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.FloatUnit;
import org.rometools.feed.module.base.types.IntUnit;
import org.rometools.feed.module.base.types.ShortDate;
import java.net.URL;
import java.util.Date;
/**
* @version $Revision: 1.1 $
* @author <a href="mailto:cooper@screaming-penguin.com">Robert "kebernet" Cooper</a>
*/
public class CustomTagImpl implements CustomTag {
private Object value;
private String name;
private final String name;
/** Creates a new instance of CustomTagImpl */
public CustomTagImpl(String name,String value) {
if( name == null || value == null ){ throw new NullPointerException("Name and Value cannont be null."); }
public CustomTagImpl(final String name, final String value) {
if (name == null || value == null) {
throw new NullPointerException("Name and Value cannont be null.");
}
this.name = name;
this.value = value;
}
public CustomTagImpl(String name,Integer value) {
if( name == null || value == null ){ throw new NullPointerException("Name and Value cannont be null."); }
public CustomTagImpl(final String name, final Integer value) {
if (name == null || value == null) {
throw new NullPointerException("Name and Value cannont be null.");
}
this.name = name;
this.value = value;
}
public CustomTagImpl(String name,Float value) {
if( name == null || value == null ){ throw new NullPointerException("Name and Value cannont be null."); }
public CustomTagImpl(final String name, final Float value) {
if (name == null || value == null) {
throw new NullPointerException("Name and Value cannont be null.");
}
this.name = name;
this.value = value;
}
public CustomTagImpl(String name,IntUnit value) {
if( name == null || value == null ){ throw new NullPointerException("Name and Value cannont be null."); }
public CustomTagImpl(final String name, final IntUnit value) {
if (name == null || value == null) {
throw new NullPointerException("Name and Value cannont be null.");
}
this.name = name;
this.value = value;
}
public CustomTagImpl(String name,FloatUnit value) {
if( name == null || value == null ){ throw new NullPointerException("Name and Value cannont be null."); }
public CustomTagImpl(final String name, final FloatUnit value) {
if (name == null || value == null) {
throw new NullPointerException("Name and Value cannont be null.");
}
this.name = name;
this.value = value;
}
public CustomTagImpl(String name,ShortDate value) {
if( name == null || value == null ){ throw new NullPointerException("Name and Value cannont be null."); }
public CustomTagImpl(final String name, final ShortDate value) {
if (name == null || value == null) {
throw new NullPointerException("Name and Value cannont be null.");
}
this.name = name;
this.value = value;
}
public CustomTagImpl(String name,Date value) {
if( name == null || value == null ){ throw new NullPointerException("Name and Value cannont be null."); }
public CustomTagImpl(final String name, final Date value) {
if (name == null || value == null) {
throw new NullPointerException("Name and Value cannont be null.");
}
this.name = name;
this.value = value;
}
public CustomTagImpl(String name,DateTimeRange value) {
if( name == null || value == null ){ throw new NullPointerException("Name and Value cannont be null."); }
public CustomTagImpl(final String name, final DateTimeRange value) {
if (name == null || value == null) {
throw new NullPointerException("Name and Value cannont be null.");
}
this.name = name;
this.value = value;
}
public CustomTagImpl(String name,URL value) {
if( name == null || value == null ){ throw new NullPointerException("Name and Value cannont be null."); }
public CustomTagImpl(final String name, final URL value) {
if (name == null || value == null) {
throw new NullPointerException("Name and Value cannont be null.");
}
this.name = name;
this.value = value;
}
public CustomTagImpl(String name,Boolean value) {
if( name == null || value == null ){ throw new NullPointerException("Name and Value cannont be null."); }
public CustomTagImpl(final String name, final Boolean value) {
if (name == null || value == null) {
throw new NullPointerException("Name and Value cannont be null.");
}
this.name = name;
this.value = value;
}
public CustomTagImpl(String name,Location value) {
if( name == null || value == null ){ throw new NullPointerException("Name and Value cannont be null."); }
public CustomTagImpl(final String name, final Location value) {
if (name == null || value == null) {
throw new NullPointerException("Name and Value cannont be null.");
}
this.name = name;
this.value = value;
}
public String getName() {
return this.name;
return name;
}
public Object getValue() {
return this.value;
return value;
}
public boolean equals( Object o ){
if( o instanceof CustomTag ){
CustomTag tag = (CustomTag) o;
if( this.name.equals( tag.getName() ) && this.value.equals( tag.getValue() ))
@Override
public boolean equals(final Object o) {
if (o instanceof CustomTag) {
final CustomTag tag = (CustomTag) o;
if (name.equals(tag.getName()) && value.equals(tag.getValue())) {
return true;
}
}
return false;
}
/**
* 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 object <tt>x</tt>, the expression:
* <blockquote>
* 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
* object <tt>x</tt>, the expression: <blockquote>
*
* <pre>
* x.clone() != x</pre></blockquote>
* will be true, and that the expression:
* <blockquote>
* 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>
* 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.
* 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>.
* 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.
* 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.
* 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.
* 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.
* @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
*/
@Override
public Object clone() throws CloneNotSupportedException {
CustomTagImpl cti = new CustomTagImpl( this.name, "" );
cti.value = this.value;
final CustomTagImpl cti = new CustomTagImpl(name, "");
cti.value = value;
return cti;
}
@Override
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;
}
@ -199,17 +211,23 @@ public class CustomTagImpl implements CustomTag {
return value;
}
@Override
public Object clone() {
return new Location(this.value);
return new Location(value);
}
@Override
public String toString() {
return value;
}
public boolean equals( Object o ){
if( o instanceof Location && ((Location) o).value.equals(this.value) ) return true;
else return false;
@Override
public boolean equals(final Object o) {
if (o instanceof Location && ((Location) o).value.equals(value)) {
return true;
} else {
return false;
}
}
}
}

View file

@ -20,9 +20,10 @@
package org.rometools.feed.module.base;
import com.sun.syndication.feed.module.Module;
import java.util.List;
import com.sun.syndication.feed.module.Module;
/**
* @version $Revision: 1.1 $
* @author <a href="mailto:cooper@screaming-penguin.com">Robert "kebernet" Cooper</a>

View file

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

File diff suppressed because it is too large Load diff

View file

@ -43,79 +43,81 @@ import java.io.Serializable;
import java.net.URL;
import java.util.Date;
/**
* This is an interface representing the universals.
*
* @author <a href="mailto:cooper@screaming-penguin.com">Robert "kebernet" Cooper</a>
* @version $Revision: 1.2 $
*/
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">
* <tbody><tr valign="top">
* <td colspan="2" bgcolor="#dddddd" valign="top"> <font size="-1"><b><a name="expiration_date"></a>expiration_date</b></font></td>
* <tbody>
* <tr valign="top">
* <td colspan="2" bgcolor="#dddddd" valign="top"><font size="-1"><b><a name="expiration_date"></a>expiration_date</b></font></td>
* </tr>
* <tr valign="top">
* <td width="120"> <font size="-1"><b>Details</b></font></td>
* <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>
* </tr>
* <tr valign="top">
* <td width="120"><font size="-1"><b>Example</b></font></td>
* <td><font size="-1">
* &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>
* </tr>
* <tr valign="top">
* <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 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>
* </tr>
* <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>
* </tr>
* </tbody></table>
* </tbody>
* </table>
*
* @param expirationDate the date this entry will expire
*/
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">
* <tbody><tr valign="top">
* <td colspan="2" bgcolor="#dddddd" valign="top"> <font size="-1"><b><a name="expiration_date"></a>expiration_date</b></font></td>
* <tbody>
* <tr valign="top">
* <td colspan="2" bgcolor="#dddddd" valign="top"><font size="-1"><b><a name="expiration_date"></a>expiration_date</b></font></td>
* </tr>
* <tr valign="top">
* <td width="120"> <font size="-1"><b>Details</b></font></td>
* <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>
* </tr>
* <tr valign="top">
* <td width="120"><font size="-1"><b>Example</b></font></td>
* <td><font size="-1">
* &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>
* </tr>
* <tr valign="top">
* <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 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>
* </tr>
* <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>
* </tr>
* </tbody></table>
* </tbody>
* </table>
*
* @return the date this entry will expire
*/
public Date getExpirationDate();
@ -124,36 +126,36 @@ public interface GlobalInterface extends Serializable {
* Date and time that the item expires.
*
* <table border="1" cellpadding="5" cellspacing="0" width="640">
* <tbody><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>
* <tbody>
* <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">
* <td width="120"> <font size="-1"><b>Details</b></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> format:
* YYYY-MM-DDThh:mm:ss</font></td>
* <td width="120"><font size="-1"><b>Details</b></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>
* format: YYYY-MM-DDThh:mm:ss</font></td>
* </tr>
*
* <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;
* </font></td>
* <td><font size="-1"> &lt;g:expiration_date_time&gt;12-20-05T11:59:59&lt;/g:expiration_date_time&gt; </font></td>
* </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"> 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">
* <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"> dateTime</font></td>
* </tr>
*
* </tbody></table>
* </tbody>
* </table>
*
* @param expirationDateTime Date and time that the item expires.
*/
public void setExpirationDateTime(Date expirationDateTime);
@ -162,135 +164,134 @@ public interface GlobalInterface extends Serializable {
* Date and time that the item expires.
*
* <table border="1" cellpadding="5" cellspacing="0" width="640">
* <tbody><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>
* <tbody>
* <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">
* <td width="120"> <font size="-1"><b>Details</b></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> format:
* YYYY-MM-DDThh:mm:ss</font></td>
* <td width="120"><font size="-1"><b>Details</b></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>
* format: YYYY-MM-DDThh:mm:ss</font></td>
* </tr>
*
* <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;
* </font></td>
* <td><font size="-1"> &lt;g:expiration_date_time&gt;12-20-05T11:59:59&lt;/g:expiration_date_time&gt; </font></td>
* </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"> 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">
* <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"> dateTime</font></td>
* </tr>
*
* </tbody></table>
* </tbody>
* </table>
*
* @return Date and time that the item expires.
*/
public Date getExpirationDateTime();
/** Unique id for this item.
/**
* Unique id for this item.
* <table border="1" cellpadding="5" cellspacing="0" width="640">
* <tbody><tr valign="top">
* <td colspan="2" bgcolor="#dddddd" valign="top"> <font size="-1"><b><a name="id"></a>id</b></font></td>
* <tbody>
* <tr valign="top">
* <td colspan="2" bgcolor="#dddddd" valign="top"><font size="-1"><b><a name="id"></a>id</b></font></td>
* </tr>
* <tr valign="top">
* <td width="120"> <font size="-1"><b>Details</b></font></td>
* <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>
* 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 id in subsequent bulk uploads.</font></td>
* <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 must not change when you send in a new bulk upload. Each item must retain the same
* id in subsequent bulk uploads.</font></td>
* </tr>
* <tr valign="top">
* <td width="120"> <font size="-1"><b>Example</b></font></td>
* <td> <font size="-1">
* <td width="120"><font size="-1"><b>Example</b></font></td>
* <td><font size="-1">
*
* &lt;g:id&gt;01flx&lt;/g:id&gt;</font></td>
* </tr>
* <tr valign="top">
* <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 Ads.</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
* Ads.</font></td>
*
* </tr>
*
* <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>
* </tbody></table>
* </tbody>
* </table>
*
* @param id unique identifier for this entry
*/
public void setId(String id);
/** Unique id for this item.
/**
* Unique id for this item.
* <table border="1" cellpadding="5" cellspacing="0" width="640">
* <tbody><tr valign="top">
* <td colspan="2" bgcolor="#dddddd" valign="top"> <font size="-1"><b><a name="id"></a>id</b></font></td>
* <tbody>
* <tr valign="top">
* <td colspan="2" bgcolor="#dddddd" valign="top"><font size="-1"><b><a name="id"></a>id</b></font></td>
* </tr>
* <tr valign="top">
* <td width="120"> <font size="-1"><b>Details</b></font></td>
* <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>
* 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 id in subsequent bulk uploads.</font></td>
* <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 must not change when you send in a new bulk upload. Each item must retain the same
* id in subsequent bulk uploads.</font></td>
* </tr>
* <tr valign="top">
* <td width="120"> <font size="-1"><b>Example</b></font></td>
* <td> <font size="-1">
* <td width="120"><font size="-1"><b>Example</b></font></td>
* <td><font size="-1">
*
* &lt;g:id&gt;01flx&lt;/g:id&gt;</font></td>
* </tr>
* <tr valign="top">
* <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 Ads.</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
* Ads.</font></td>
*
* </tr>
*
* <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>
* </tbody></table>
* </tbody>
* </table>
*
* @return unique identifier for this entry
*/
public String getId();
/**Images for this item.
* <br>
/**
* Images for this item. <br>
*
* <table border="1" cellpadding="5" cellspacing="0" width="640">
* <tbody><tr valign="top">
* <td colspan="2" bgcolor="#dddddd" valign="top"> <font size="-1"><b><a name="image_link"></a>image_link</b></font></td>
* <tbody>
* <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">
* <td width="120"> <font size="-1"><b>Details</b></font></td>
* <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 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, 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>
* <td width="120"><font size="-1"><b>Details</b></font></td>
* <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
* 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,
* 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>
*
* </tr>
* <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"> <em>Acceptable:</em><br>
* &lt;image_link&gt;http://example.com/images/1006.jpg&lt;/image_link&gt;<br>
*
@ -302,44 +303,42 @@ public interface GlobalInterface extends Serializable {
*
* </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"> Reference Items, Events, Housing,
* Jobs, News and Articles, People profiles, Products, Reviews, Services,
* Travel, Vehicles, Wanted Ads.</font></td>
* <td><font size="-1"> Reference Items, Events, Housing, Jobs, News and Articles, People profiles, Products, Reviews, Services, Travel, Vehicles, Wanted
* Ads.</font></td>
* </tr>
* <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"> url</font></td>
* </tr>
*
* </tbody></table>
* </tbody>
* </table>
*
* @param imageLinks URLs to images. Limit 10.
*/
public void setImageLinks(URL[] imageLinks);
/**Images for this item.
* <br>
/**
* Images for this item. <br>
*
* <table border="1" cellpadding="5" cellspacing="0" width="640">
* <tbody><tr valign="top">
* <td colspan="2" bgcolor="#dddddd" valign="top"> <font size="-1"><b><a name="image_link"></a>image_link</b></font></td>
* <tbody>
* <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">
* <td width="120"> <font size="-1"><b>Details</b></font></td>
* <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 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, 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>
* <td width="120"><font size="-1"><b>Details</b></font></td>
* <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
* 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,
* 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>
*
* </tr>
* <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"> <em>Acceptable:</em><br>
* &lt;image_link&gt;http://example.com/images/1006.jpg&lt;/image_link&gt;<br>
*
@ -351,28 +350,30 @@ public interface GlobalInterface extends Serializable {
*
* </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"> Reference Items, Events, Housing,
* Jobs, News and Articles, People profiles, Products, Reviews, Services,
* Travel, Vehicles, Wanted Ads.</font></td>
* <td><font size="-1"> Reference Items, Events, Housing, Jobs, News and Articles, People profiles, Products, Reviews, Services, Travel, Vehicles, Wanted
* Ads.</font></td>
* </tr>
* <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"> url</font></td>
* </tr>
*
* </tbody></table>
* </tbody>
* </table>
*
* @return URLs to images
*/
public URL[] getImageLinks();
/**Labels for this item.
* <br>
/**
* Labels for this item. <br>
*
* <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>
@ -382,11 +383,10 @@ public interface GlobalInterface extends Serializable {
*
* <font size="-1"><b>Details</b></font></td>
* <td>
* <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;
* <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;
*
* 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 valign="top">
@ -399,42 +399,35 @@ public interface GlobalInterface extends Serializable {
* </font>
*
* <font size="-1">&lt;g:label&gt;Leather&lt;/g:label&gt;<br>
* </font>
* <font size="-1">&lt;g:label&gt;Power locks&lt;/g:label&gt;<br>
* </font> <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 size="-1"><em>For a concert in an Events information type:</em></font><br>
* </font> <font size="-1">&lt;g:label&gt;ABS&lt;/g:label&gt;<br>
* <br>
* </font> <font size="-1"><em>For a concert in an Events information type:</em></font><br>
*
* <font size="-1">&lt;g:label&gt;VIP&lt;/g:label&gt;<br>
*
* </font>
* <font size="-1">&lt;g:label&gt;front row&lt;/g:label&gt;<br>
* </font>
* <font size="-1">&lt;g:label&gt;backstage&lt;/g:label&gt;<br>
* </font> <font size="-1">&lt;g:label&gt;front row&lt;/g:label&gt;<br>
* </font> <font size="-1">&lt;g:label&gt;backstage&lt;/g:label&gt;<br>
*
* </font>
*
* <font size="-1">&lt;g:label&gt;KROCK 101.5&lt;/g:label&gt;<br>
* </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;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>
* </font> <font size="-1">&lt;g:label&gt; leater, power locks, sunroof, ABS &lt;/g:label&gt;</font></td>
* </tr>
* <tr valign="top">
* <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 Ads.</font></td>
* <font size="-1">Reference Items, Events, Housing, Jobs, News and Articles, People profiles, Products, Reviews, Services, Travel, Vehicles, Wanted
* Ads.</font></td>
* </tr>
* <tr valign="top">
* <td width="120">
@ -444,16 +437,19 @@ public interface GlobalInterface extends Serializable {
* <font size="-1">string</font></td>
*
* </tr>
* </tbody></table>
* </tbody>
* </table>
*
* @param labels labels for this entry. Limit 10.
*/
public void setLabels(String[] labels);
/**Labels for this item.
* <br>
/**
* Labels for this item. <br>
*
* <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>
@ -463,11 +459,10 @@ public interface GlobalInterface extends Serializable {
*
* <font size="-1"><b>Details</b></font></td>
* <td>
* <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;
* <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;
*
* 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 valign="top">
@ -480,42 +475,35 @@ public interface GlobalInterface extends Serializable {
* </font>
*
* <font size="-1">&lt;g:label&gt;Leather&lt;/g:label&gt;<br>
* </font>
* <font size="-1">&lt;g:label&gt;Power locks&lt;/g:label&gt;<br>
* </font> <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 size="-1"><em>For a concert in an Events information type:</em></font><br>
* </font> <font size="-1">&lt;g:label&gt;ABS&lt;/g:label&gt;<br>
* <br>
* </font> <font size="-1"><em>For a concert in an Events information type:</em></font><br>
*
* <font size="-1">&lt;g:label&gt;VIP&lt;/g:label&gt;<br>
*
* </font>
* <font size="-1">&lt;g:label&gt;front row&lt;/g:label&gt;<br>
* </font>
* <font size="-1">&lt;g:label&gt;backstage&lt;/g:label&gt;<br>
* </font> <font size="-1">&lt;g:label&gt;front row&lt;/g:label&gt;<br>
* </font> <font size="-1">&lt;g:label&gt;backstage&lt;/g:label&gt;<br>
*
* </font>
*
* <font size="-1">&lt;g:label&gt;KROCK 101.5&lt;/g:label&gt;<br>
* </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;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>
* </font> <font size="-1">&lt;g:label&gt; leater, power locks, sunroof, ABS &lt;/g:label&gt;</font></td>
* </tr>
* <tr valign="top">
* <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 Ads.</font></td>
* <font size="-1">Reference Items, Events, Housing, Jobs, News and Articles, People profiles, Products, Reviews, Services, Travel, Vehicles, Wanted
* Ads.</font></td>
* </tr>
* <tr valign="top">
* <td width="120">
@ -525,7 +513,9 @@ public interface GlobalInterface extends Serializable {
* <font size="-1">string</font></td>
*
* </tr>
* </tbody></table>
* </tbody>
* </table>
*
* @return labels for this entry
*/
public String[] getLabels();

View file

@ -41,22 +41,19 @@ package org.rometools.feed.module.base;
import com.sun.syndication.feed.module.Module;
/**
* This is the root interface for the Google Base module.
*
* <p>
* 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 interface and see only methods related to a particular entry
* type.
* 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
* interface and see only methods related to a particular entry type.
* </p>
*
* @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 $
*/
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. */
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

View file

@ -41,9 +41,9 @@ package org.rometools.feed.module.base;
import org.rometools.feed.module.base.types.GenderEnumeration;
/** This is an interface for the GoogleBase plug in that exposes methods used for
* Person (personal ad, resume, profile) entry types.
/**
* This is an interface for the GoogleBase plug in that exposes methods used for Person (personal ad, resume, profile) entry types.
*
* @author <a href="mailto:cooper@screaming-penguin.com">Robert "kebernet" Cooper</a>
* @version $Revision: 1.2 $
*/
@ -51,24 +51,22 @@ public interface Person extends GlobalInterface {
/**
* Age of the individual.
* <table border="1" cellpadding="5" cellspacing="0" width="640">
* <tbody><tr bgcolor="#dddddd" valign="top">
* <tbody>
* <tr bgcolor="#dddddd" valign="top">
* <td colspan="2" nowrap="nowrap"><font size="-1"><strong><a name="age"></a>age</strong></font></td>
* </tr>
* <tr valign="top">
* <td width="120"><strong><font size="-1">Details</font></strong></td>
* <td><font size="-1">Minimum age requirement for the event or the age of the individual in a People profiles
* bulk upload entry.</font></td>
* <td><font size="-1">Minimum age requirement for the event or the age of the individual in a People profiles bulk upload entry.</font></td>
*
* </tr>
* <tr valign="top">
* <td><strong><font size="-1">Example</font></strong></td>
* <td><font size="-1"><em>Acceptable:</em><br>
* &lt;
* g:age&gt;18&lt;/g:age&gt;<br>
* &lt; g:age&gt;18&lt;/g:age&gt;<br>
* <em>Not acceptable:</em><br>
*
* &lt;
* g:age&gt;18 and over&lt;/g:age&gt;</font></td>
* &lt; g:age&gt;18 and over&lt;/g:age&gt;</font></td>
* </tr>
* <tr valign="top">
* <td><strong><font size="-1">Attribute of</font></strong></td>
@ -80,7 +78,9 @@ public interface Person extends GlobalInterface {
* <td><strong><font size="-1">Content type</font></strong></td>
* <td><font size="-1">integer</font></td>
* </tr>
* </tbody></table>
* </tbody>
* </table>
*
* @param age Age of the individual.
*/
public void setAge(Integer age);
@ -88,24 +88,22 @@ public interface Person extends GlobalInterface {
/**
* Age of the individual.
* <table border="1" cellpadding="5" cellspacing="0" width="640">
* <tbody><tr bgcolor="#dddddd" valign="top">
* <tbody>
* <tr bgcolor="#dddddd" valign="top">
* <td colspan="2" nowrap="nowrap"><font size="-1"><strong><a name="age"></a>age</strong></font></td>
* </tr>
* <tr valign="top">
* <td width="120"><strong><font size="-1">Details</font></strong></td>
* <td><font size="-1">Minimum age requirement for the event or the age of the individual in a People profiles
* bulk upload entry.</font></td>
* <td><font size="-1">Minimum age requirement for the event or the age of the individual in a People profiles bulk upload entry.</font></td>
*
* </tr>
* <tr valign="top">
* <td><strong><font size="-1">Example</font></strong></td>
* <td><font size="-1"><em>Acceptable:</em><br>
* &lt;
* g:age&gt;18&lt;/g:age&gt;<br>
* &lt; g:age&gt;18&lt;/g:age&gt;<br>
* <em>Not acceptable:</em><br>
*
* &lt;
* g:age&gt;18 and over&lt;/g:age&gt;</font></td>
* &lt; g:age&gt;18 and over&lt;/g:age&gt;</font></td>
* </tr>
* <tr valign="top">
* <td><strong><font size="-1">Attribute of</font></strong></td>
@ -117,7 +115,9 @@ public interface Person extends GlobalInterface {
* <td><strong><font size="-1">Content type</font></strong></td>
* <td><font size="-1">integer</font></td>
* </tr>
* </tbody></table>
* </tbody>
* </table>
*
* @return Age of the individual.
*/
public Integer getAge();
@ -125,30 +125,32 @@ public interface Person extends GlobalInterface {
/**
* Education of the individual.
* <table border="1" cellpadding="5" cellspacing="0" width="640">
* <tbody><tr valign="top">
* <td colspan="2" bgcolor="#dddddd" valign="top"> <font size="-1"><b><a name="education"></a>education</b></font></td>
* <tbody>
* <tr valign="top">
* <td colspan="2" bgcolor="#dddddd" valign="top"><font size="-1"><b><a name="education"></a>education</b></font></td>
* </tr>
* <tr valign="top">
* <td width="120"> <font size="-1"><b>Details</b></font></td>
* <td width="120"><font size="-1"><b>Details</b></font></td>
*
* <td><font size="-1"> Level of education required for an employment
* position.</font></td>
* <td><font size="-1"> Level of education required for an employment position.</font></td>
* </tr>
* <tr valign="top">
* <td width="120"> <font size="-1"><b>Example</b></font></td>
* <td> <font size="-1">&lt;g:education&gt;PhD&lt;/g:education&gt;</font></td>
* <td width="120"><font size="-1"><b>Example</b></font></td>
* <td><font size="-1">&lt;g:education&gt;PhD&lt;/g:education&gt;</font></td>
*
* </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"> Jobs</font></td>
* </tr>
* <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>
* </tbody></table>
* </tbody>
* </table>
*
* @param education Education of the individual.
*/
public void setEducation(String education);
@ -156,30 +158,32 @@ public interface Person extends GlobalInterface {
/**
* Education of the individual.
* <table border="1" cellpadding="5" cellspacing="0" width="640">
* <tbody><tr valign="top">
* <td colspan="2" bgcolor="#dddddd" valign="top"> <font size="-1"><b><a name="education"></a>education</b></font></td>
* <tbody>
* <tr valign="top">
* <td colspan="2" bgcolor="#dddddd" valign="top"><font size="-1"><b><a name="education"></a>education</b></font></td>
* </tr>
* <tr valign="top">
* <td width="120"> <font size="-1"><b>Details</b></font></td>
* <td width="120"><font size="-1"><b>Details</b></font></td>
*
* <td><font size="-1"> Level of education required for an employment
* position.</font></td>
* <td><font size="-1"> Level of education required for an employment position.</font></td>
* </tr>
* <tr valign="top">
* <td width="120"> <font size="-1"><b>Example</b></font></td>
* <td> <font size="-1">&lt;g:education&gt;PhD&lt;/g:education&gt;</font></td>
* <td width="120"><font size="-1"><b>Example</b></font></td>
* <td><font size="-1">&lt;g:education&gt;PhD&lt;/g:education&gt;</font></td>
*
* </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"> Jobs</font></td>
* </tr>
* <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>
* </tbody></table>
* </tbody>
* </table>
*
* @return Education of the individual.
*/
public String getEducation();
@ -188,29 +192,32 @@ public interface Person extends GlobalInterface {
* Individuals employer.
*
* <table border="1" cellpadding="5" cellspacing="0" width="640">
* <tbody><tr valign="top">
* <td colspan="2" bgcolor="#dddddd" valign="top"> <font size="-1"><b><a name="employer"></a>employer</b></font></td>
* <tbody>
* <tr valign="top">
* <td colspan="2" bgcolor="#dddddd" valign="top"><font size="-1"><b><a name="employer"></a>employer</b></font></td>
*
* </tr>
* <tr valign="top">
* <td width="120"> <font size="-1"><b>Details</b></font></td>
* <td width="120"><font size="-1"><b>Details</b></font></td>
* <td><font size="-1"> Company providing employment.</font></td>
* </tr>
* <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">&lt;g:employer&gt;Google, Inc&lt;/g:employer&gt;</font></td>
* <td><font size="-1">&lt;g:employer&gt;Google, Inc&lt;/g:employer&gt;</font></td>
* </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"> Jobs</font></td>
*
* </tr>
* <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>
* </tbody></table>
* </tbody>
* </table>
*
* @param employer Individuals employer.
*/
public void setEmployer(String employer);
@ -219,29 +226,32 @@ public interface Person extends GlobalInterface {
* Individuals employer.
*
* <table border="1" cellpadding="5" cellspacing="0" width="640">
* <tbody><tr valign="top">
* <td colspan="2" bgcolor="#dddddd" valign="top"> <font size="-1"><b><a name="employer"></a>employer</b></font></td>
* <tbody>
* <tr valign="top">
* <td colspan="2" bgcolor="#dddddd" valign="top"><font size="-1"><b><a name="employer"></a>employer</b></font></td>
*
* </tr>
* <tr valign="top">
* <td width="120"> <font size="-1"><b>Details</b></font></td>
* <td width="120"><font size="-1"><b>Details</b></font></td>
* <td><font size="-1"> Company providing employment.</font></td>
* </tr>
* <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">&lt;g:employer&gt;Google, Inc&lt;/g:employer&gt;</font></td>
* <td><font size="-1">&lt;g:employer&gt;Google, Inc&lt;/g:employer&gt;</font></td>
* </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"> Jobs</font></td>
*
* </tr>
* <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>
* </tbody></table>
* </tbody>
* </table>
*
* @return Individuals employer.
*/
public String getEmployer();
@ -250,33 +260,35 @@ public interface Person extends GlobalInterface {
* Ethnicity of the individual in the People profiles bulk upload entry.
*
* <table border="1" cellpadding="5" cellspacing="0" width="640">
* <tbody><tr valign="top">
* <td colspan="2" bgcolor="#dddddd" valign="top"> <font size="-1"><b><a name="ethnicity"></a>ethnicity</b></font></td>
* <tbody>
* <tr valign="top">
* <td colspan="2" bgcolor="#dddddd" valign="top"><font size="-1"><b><a name="ethnicity"></a>ethnicity</b></font></td>
* </tr>
* <tr valign="top">
* <td width="120"> <font size="-1"><b>Details</b></font></td>
* <td width="120"><font size="-1"><b>Details</b></font></td>
*
* <td><font size="-1"> Ethnicity of the individual in the People profiles
* bulk upload entry.</font></td>
* <td><font size="-1"> Ethnicity of the individual in the People profiles bulk upload entry.</font></td>
*
* </tr>
* <tr valign="top">
* <td width="120"> <font size="-1"><b>Example</b></font></td>
* <td> <font size="-1">&lt;g:ethnicity&gt;Latino&lt;/g:ethnicity&gt;</font></td>
* <td width="120"><font size="-1"><b>Example</b></font></td>
* <td><font size="-1">&lt;g:ethnicity&gt;Latino&lt;/g:ethnicity&gt;</font></td>
*
* </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"> People profiles</font></td>
* </tr>
* <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>
*
* </tbody></table>
* </tbody>
* </table>
*
* @param ethnicities Ethnicity of the individual in the People profiles bulk upload entry.
*/
public void setEthnicities(String[] ethnicities);
@ -285,33 +297,35 @@ public interface Person extends GlobalInterface {
* Ethnicity of the individual in the People profiles bulk upload entry.
*
* <table border="1" cellpadding="5" cellspacing="0" width="640">
* <tbody><tr valign="top">
* <td colspan="2" bgcolor="#dddddd" valign="top"> <font size="-1"><b><a name="ethnicity"></a>ethnicity</b></font></td>
* <tbody>
* <tr valign="top">
* <td colspan="2" bgcolor="#dddddd" valign="top"><font size="-1"><b><a name="ethnicity"></a>ethnicity</b></font></td>
* </tr>
* <tr valign="top">
* <td width="120"> <font size="-1"><b>Details</b></font></td>
* <td width="120"><font size="-1"><b>Details</b></font></td>
*
* <td><font size="-1"> Ethnicity of the individual in the People profiles
* bulk upload entry.</font></td>
* <td><font size="-1"> Ethnicity of the individual in the People profiles bulk upload entry.</font></td>
*
* </tr>
* <tr valign="top">
* <td width="120"> <font size="-1"><b>Example</b></font></td>
* <td> <font size="-1">&lt;g:ethnicity&gt;Latino&lt;/g:ethnicity&gt;</font></td>
* <td width="120"><font size="-1"><b>Example</b></font></td>
* <td><font size="-1">&lt;g:ethnicity&gt;Latino&lt;/g:ethnicity&gt;</font></td>
*
* </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"> People profiles</font></td>
* </tr>
* <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>
*
* </tbody></table>
* </tbody>
* </table>
*
* @return Ethnicity of the individual in the People profiles bulk upload entry.
*/
public String[] getEthnicities();
@ -320,33 +334,33 @@ public interface Person extends GlobalInterface {
* Gender of an individual in a People profiles bulk upload.
*
* <table border="1" cellpadding="5" cellspacing="0" width="640">
* <tbody><tr valign="top">
* <td colspan="2" bgcolor="#dddddd" valign="top"> <font size="-1"><b><a name="gender"></a>gender</b></font></td>
* <tbody>
* <tr valign="top">
* <td colspan="2" bgcolor="#dddddd" valign="top"><font size="-1"><b><a name="gender"></a>gender</b></font></td>
*
* </tr>
* <tr valign="top">
* <td width="120"> <font size="-1"><b>Details</b></font></td>
* <td width="120"><font size="-1"><b>Details</b></font></td>
*
* <td><font size="-1"> Gender of an individual in a People profiles bulk upload
* item. Acceptable values are <EFBFBD>Male<EFBFBD>, <EFBFBD>M<EFBFBD>,
* <EFBFBD>Female<EFBFBD>, or <EFBFBD>F<EFBFBD>.</font></td>
* <td><font size="-1"> Gender of an individual in a People profiles bulk upload item. Acceptable values are <EFBFBD>Male<EFBFBD>, <EFBFBD>M<EFBFBD>, <EFBFBD>Female<EFBFBD>, or <EFBFBD>F<EFBFBD>.</font></td>
* </tr>
* <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">
* &lt;gender&gt;Female&lt;/gender&gt;</font></td>
* <td><font size="-1"> &lt;gender&gt;Female&lt;/gender&gt;</font></td>
* </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"> People profiles</font></td>
*
* </tr>
* <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"> genderEnumeration</font></td>
* </tr>
* </tbody></table>
* </tbody>
* </table>
*
* @param gender Gender of an individual in a People profiles bulk upload.
*/
public void setGender(GenderEnumeration gender);
@ -355,33 +369,33 @@ public interface Person extends GlobalInterface {
* Gender of an individual in a People profiles bulk upload.
*
* <table border="1" cellpadding="5" cellspacing="0" width="640">
* <tbody><tr valign="top">
* <td colspan="2" bgcolor="#dddddd" valign="top"> <font size="-1"><b><a name="gender"></a>gender</b></font></td>
* <tbody>
* <tr valign="top">
* <td colspan="2" bgcolor="#dddddd" valign="top"><font size="-1"><b><a name="gender"></a>gender</b></font></td>
*
* </tr>
* <tr valign="top">
* <td width="120"> <font size="-1"><b>Details</b></font></td>
* <td width="120"><font size="-1"><b>Details</b></font></td>
*
* <td><font size="-1"> Gender of an individual in a People profiles bulk upload
* item. Acceptable values are <EFBFBD>Male<EFBFBD>, <EFBFBD>M<EFBFBD>,
* <EFBFBD>Female<EFBFBD>, or <EFBFBD>F<EFBFBD>.</font></td>
* <td><font size="-1"> Gender of an individual in a People profiles bulk upload item. Acceptable values are <EFBFBD>Male<EFBFBD>, <EFBFBD>M<EFBFBD>, <EFBFBD>Female<EFBFBD>, or <EFBFBD>F<EFBFBD>.</font></td>
* </tr>
* <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">
* &lt;gender&gt;Female&lt;/gender&gt;</font></td>
* <td><font size="-1"> &lt;gender&gt;Female&lt;/gender&gt;</font></td>
* </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"> People profiles</font></td>
*
* </tr>
* <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"> genderEnumeration</font></td>
* </tr>
* </tbody></table>
* </tbody>
* </table>
*
* @return Gender of an individual in a People profiles bulk upload.
*/
public GenderEnumeration getGender();
@ -390,33 +404,35 @@ public interface Person extends GlobalInterface {
* Interest of a person being profiled.
*
* <table border="1" cellpadding="5" cellspacing="0" width="640">
* <tbody><tr valign="top">
* <td colspan="2" bgcolor="#dddddd" valign="top"> <font size="-1"><b><a name="interested_in"></a>interested_in</b></font></td>
* <tbody>
* <tr valign="top">
* <td colspan="2" bgcolor="#dddddd" valign="top"><font size="-1"><b><a name="interested_in"></a>interested_in</b></font></td>
*
* </tr>
* <tr valign="top">
* <td width="120"> <font size="-1"><b>Details</b></font></td>
* <td width="120"><font size="-1"><b>Details</b></font></td>
* <td><font size="-1"> Interest of a person being profiled.</font></td>
*
* </tr>
* <tr valign="top">
* <td width="120"><font size="-1"><b>Example</b></font></td>
*
* <td><font size="-1">
* &lt;g:interested_in&gt;Long walks on the beach.&lt;/g:interested_in&gt;</font></td>
* <td><font size="-1"> &lt;g:interested_in&gt;Long walks on the beach.&lt;/g:interested_in&gt;</font></td>
* </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">People profiles</font></td>
*
* </tr>
* <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>
*
* </tbody></table>
* </tbody>
* </table>
*
* @param interestedIn Interest of a person being profiled.
*/
public void setInterestedIn(String[] interestedIn);
@ -425,33 +441,35 @@ public interface Person extends GlobalInterface {
* Interest of a person being profiled.
*
* <table border="1" cellpadding="5" cellspacing="0" width="640">
* <tbody><tr valign="top">
* <td colspan="2" bgcolor="#dddddd" valign="top"> <font size="-1"><b><a name="interested_in"></a>interested_in</b></font></td>
* <tbody>
* <tr valign="top">
* <td colspan="2" bgcolor="#dddddd" valign="top"><font size="-1"><b><a name="interested_in"></a>interested_in</b></font></td>
*
* </tr>
* <tr valign="top">
* <td width="120"> <font size="-1"><b>Details</b></font></td>
* <td width="120"><font size="-1"><b>Details</b></font></td>
* <td><font size="-1"> Interest of a person being profiled.</font></td>
*
* </tr>
* <tr valign="top">
* <td width="120"><font size="-1"><b>Example</b></font></td>
*
* <td><font size="-1">
* &lt;g:interested_in&gt;Long walks on the beach.&lt;/g:interested_in&gt;</font></td>
* <td><font size="-1"> &lt;g:interested_in&gt;Long walks on the beach.&lt;/g:interested_in&gt;</font></td>
* </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">People profiles</font></td>
*
* </tr>
* <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>
*
* </tbody></table>
* </tbody>
* </table>
*
* @return Interest of a person being profiled.
*/
public String[] getInterestedIn();
@ -459,49 +477,45 @@ public interface Person extends GlobalInterface {
/**
* Location of a person.
* <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 valign="top">
*
* <td width="120"><font size="-1">
* <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 width="120"><font size="-1"> <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>
*
* </tr>
* <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">
* <em>Acceptable:</em><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>
* <td><font size="-1"> <em>Acceptable:</em><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>
* &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>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>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>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 valign="top">
* <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 Ads.</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
* Ads.</font></td>
* </tr>
*
* <tr valign="top">
*
* <td width="120"><font size="-1">
* <b>Content type</b></font></td>
* <td><font size="-1">
* locationType</font></td>
* <td width="120"><font size="-1"> <b>Content type</b></font></td>
* <td><font size="-1"> locationType</font></td>
* </tr>
* </tbody></table>
* </tbody>
* </table>
*
* @param location Location of a person.
*/
public void setLocation(String location);
@ -509,49 +523,45 @@ public interface Person extends GlobalInterface {
/**
* Location of a person.
* <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 valign="top">
*
* <td width="120"><font size="-1">
* <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 width="120"><font size="-1"> <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>
*
* </tr>
* <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">
* <em>Acceptable:</em><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>
* <td><font size="-1"> <em>Acceptable:</em><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>
* &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>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>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>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 valign="top">
* <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 Ads.</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
* Ads.</font></td>
* </tr>
*
* <tr valign="top">
*
* <td width="120"><font size="-1">
* <b>Content type</b></font></td>
* <td><font size="-1">
* locationType</font></td>
* <td width="120"><font size="-1"> <b>Content type</b></font></td>
* <td><font size="-1"> locationType</font></td>
* </tr>
* </tbody></table>
* </tbody>
* </table>
*
* @return Location of a person.
*/
public String getLocation();
@ -561,35 +571,30 @@ public interface Person extends GlobalInterface {
*
* <table border="1" cellpadding="5" cellspacing="0" width="640">
*
* <tbody><tr valign="top">
* <td colspan="2" bgcolor="#dddddd"><font size="-1">
* <b><a name="marital_status"></a>marital_status</b></font></td>
* <tbody>
* <tr valign="top">
* <td colspan="2" bgcolor="#dddddd"><font size="-1"> <b><a name="marital_status"></a>marital_status</b></font></td>
* </tr>
* <tr valign="top">
* <td width="120"><font size="-1">
*
* <b>Details</b></font></td>
* <td><font size="-1"> Marital status of an individual
* in a People profiles bulk upload entry.
* For example -single, divorced, separated, widowed, married, and <EFBFBD>in
* relationship.<EFBFBD></font></td>
* <td><font size="-1"> Marital status of an individual in a People profiles bulk upload entry. For example -single, divorced, separated, widowed, married,
* and <EFBFBD>in relationship.<EFBFBD></font></td>
*
* </tr>
* <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">
* &lt;g:marital_status&gt;single&lt;/g:marital_status&gt;<br>
* <td><font size="-1"> &lt;g:marital_status&gt;single&lt;/g:marital_status&gt;<br>
*
* </font></td></tr>
* </font></td>
* </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">
* People profiles</font></td>
* <td><font size="-1"> People profiles</font></td>
* </tr>
* <tr valign="top">
* <td width="120"><font size="-1">
@ -599,7 +604,9 @@ public interface Person extends GlobalInterface {
*
* string</font></td>
* </tr>
* </tbody></table>
* </tbody>
* </table>
*
* @param maritalStatus Marital status of an individual.
*/
public void setMaritalStatus(String maritalStatus);
@ -609,35 +616,30 @@ public interface Person extends GlobalInterface {
*
* <table border="1" cellpadding="5" cellspacing="0" width="640">
*
* <tbody><tr valign="top">
* <td colspan="2" bgcolor="#dddddd"><font size="-1">
* <b><a name="marital_status"></a>marital_status</b></font></td>
* <tbody>
* <tr valign="top">
* <td colspan="2" bgcolor="#dddddd"><font size="-1"> <b><a name="marital_status"></a>marital_status</b></font></td>
* </tr>
* <tr valign="top">
* <td width="120"><font size="-1">
*
* <b>Details</b></font></td>
* <td><font size="-1"> Marital status of an individual
* in a People profiles bulk upload entry.
* For example -single, divorced, separated, widowed, married, and <EFBFBD>in
* relationship.<EFBFBD></font></td>
* <td><font size="-1"> Marital status of an individual in a People profiles bulk upload entry. For example -single, divorced, separated, widowed, married,
* and <EFBFBD>in relationship.<EFBFBD></font></td>
*
* </tr>
* <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">
* &lt;g:marital_status&gt;single&lt;/g:marital_status&gt;<br>
* <td><font size="-1"> &lt;g:marital_status&gt;single&lt;/g:marital_status&gt;<br>
*
* </font></td></tr>
* </font></td>
* </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">
* People profiles</font></td>
* <td><font size="-1"> People profiles</font></td>
* </tr>
* <tr valign="top">
* <td width="120"><font size="-1">
@ -647,7 +649,9 @@ public interface Person extends GlobalInterface {
*
* string</font></td>
* </tr>
* </tbody></table>
* </tbody>
* </table>
*
* @return Marital status of an individual.
*/
public String getMaritalStatus();
@ -656,30 +660,26 @@ public interface Person extends GlobalInterface {
* Occupation of an individual.
*
* <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="occupation"></a>occupation</b></font></td>
* <td colspan="2" bgcolor="#dddddd" valign="top"><font size="-1"> <b><a name="occupation"></a>occupation</b></font></td>
* </tr>
* <tr valign="top">
* <td width="120"><font size="-1">
*
* <b>Details</b></font></td>
* <td><font size="-1">
* Industry the individual in a People profiles bulk upload
* is employed in.</font></td>
* <td><font size="-1"> Industry the individual in a People profiles bulk upload is employed in.</font></td>
*
* </tr>
* <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"> &lt;g:occupation&gt;Sales&lt;/g:occupation&gt;</font></td>
* </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">
*
* People profiles</font></td>
@ -688,11 +688,12 @@ public interface Person extends GlobalInterface {
* <td width="120"><font size="-1">
*
* <b>Content type</b></font></td>
* <td><font size="-1">
* string</font></td>
* <td><font size="-1"> string</font></td>
*
* </tr>
* </tbody></table>
* </tbody>
* </table>
*
* @param occupation Occupation of an individual.
*/
public void setOccupation(String occupation);
@ -701,30 +702,26 @@ public interface Person extends GlobalInterface {
* Occupation of an individual.
*
* <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="occupation"></a>occupation</b></font></td>
* <td colspan="2" bgcolor="#dddddd" valign="top"><font size="-1"> <b><a name="occupation"></a>occupation</b></font></td>
* </tr>
* <tr valign="top">
* <td width="120"><font size="-1">
*
* <b>Details</b></font></td>
* <td><font size="-1">
* Industry the individual in a People profiles bulk upload
* is employed in.</font></td>
* <td><font size="-1"> Industry the individual in a People profiles bulk upload is employed in.</font></td>
*
* </tr>
* <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"> &lt;g:occupation&gt;Sales&lt;/g:occupation&gt;</font></td>
* </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">
*
* People profiles</font></td>
@ -733,11 +730,12 @@ public interface Person extends GlobalInterface {
* <td width="120"><font size="-1">
*
* <b>Content type</b></font></td>
* <td><font size="-1">
* string</font></td>
* <td><font size="-1"> string</font></td>
*
* </tr>
* </tbody></table>
* </tbody>
* </table>
*
* @return Occupation of an individual.
*/
public String getOccupation();
@ -746,41 +744,38 @@ public interface Person extends GlobalInterface {
* Individual's sexual orientation.
*
* <table border="1" cellpadding="5" cellspacing="0" width="640">
* <tbody><tr valign="top">
* <td colspan="2" bgcolor="#dddddd" valign="top"><font size="-1">
* <b><a name="sexual_orientation"></a>sexual_orientation</b></font></td>
* <tbody>
* <tr valign="top">
* <td colspan="2" bgcolor="#dddddd" valign="top"><font size="-1"> <b><a name="sexual_orientation"></a>sexual_orientation</b></font></td>
* </tr>
* <tr valign="top">
* <td width="120"><font size="-1">
*
* <b>Details</b></font></td>
*
* <td><font size="-1">
* Sexual orientation of an individual in a People profiles information type..</font></td>
* <td><font size="-1"> Sexual orientation of an individual in a People profiles information type..</font></td>
* </tr>
* <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"> &lt;g:sexual_orientation&gt;straight&lt;/g:sexual_orientation&gt;</font></td>
*
* </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">
*
* Personal</font></td>
* </tr>
* <tr valign="top">
*
* <td width="120"><font size="-1">
* <b>Content type</b></font></td>
* <td><font size="-1">
* string</font></td>
* <td width="120"><font size="-1"> <b>Content type</b></font></td>
* <td><font size="-1"> string</font></td>
*
* </tr>
* </tbody></table>
* </tbody>
* </table>
*
* @param sexualOrientation Individual's sexual orientation.
*/
public void setSexualOrientation(String sexualOrientation);
@ -789,41 +784,38 @@ public interface Person extends GlobalInterface {
* Individual's sexual orientation.
*
* <table border="1" cellpadding="5" cellspacing="0" width="640">
* <tbody><tr valign="top">
* <td colspan="2" bgcolor="#dddddd" valign="top"><font size="-1">
* <b><a name="sexual_orientation"></a>sexual_orientation</b></font></td>
* <tbody>
* <tr valign="top">
* <td colspan="2" bgcolor="#dddddd" valign="top"><font size="-1"> <b><a name="sexual_orientation"></a>sexual_orientation</b></font></td>
* </tr>
* <tr valign="top">
* <td width="120"><font size="-1">
*
* <b>Details</b></font></td>
*
* <td><font size="-1">
* Sexual orientation of an individual in a People profiles information type..</font></td>
* <td><font size="-1"> Sexual orientation of an individual in a People profiles information type..</font></td>
* </tr>
* <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"> &lt;g:sexual_orientation&gt;straight&lt;/g:sexual_orientation&gt;</font></td>
*
* </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">
*
* Personal</font></td>
* </tr>
* <tr valign="top">
*
* <td width="120"><font size="-1">
* <b>Content type</b></font></td>
* <td><font size="-1">
* string</font></td>
* <td width="120"><font size="-1"> <b>Content type</b></font></td>
* <td><font size="-1"> string</font></td>
*
* </tr>
* </tbody></table>
* </tbody>
* </table>
*
* @return Individual's sexual orientation.
*/
public String getSexualOrientation();

File diff suppressed because it is too large Load diff

View file

@ -39,15 +39,14 @@
*/
package org.rometools.feed.module.base;
import org.rometools.feed.module.base.types.FloatUnit;
import java.net.URL;
import java.util.Date;
import org.rometools.feed.module.base.types.FloatUnit;
/**
* This is an interface for the GoogleBase plug in that exposes methods used for
* critical reviews of other things.
* This is an interface for the GoogleBase plug in that exposes methods used for critical reviews of other things.
*
* @author <a href="mailto:cooper@screaming-penguin.com">Robert "kebernet" Cooper</a>
* @version $Revision: 1.1 $
*/
@ -58,38 +57,33 @@ public interface Review extends GlobalInterface {
*
* <table border="1" cellpadding="5" cellspacing="0" width="640">
*
* <tbody><tr valign="top">
* <td colspan="2" bgcolor="#dddddd" valign="top"><font size="-1">
* <b><a name="author"></a>author</b></font></td>
* <tbody>
* <tr valign="top">
* <td colspan="2" bgcolor="#dddddd" valign="top"><font size="-1"> <b><a name="author"></a>author</b></font></td>
* </tr>
* <tr valign="top">
* <td width="120"><font size="-1">
* <b>Details</b></font></td>
* <td width="120"><font size="-1"> <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 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"> &lt;g:author&gt;John Steinbeck&lt;/g:author&gt;</font></td>
*
* </tr>
* <tr valign="top">
* <td width="120"><font size="-1">
* <b>Attribute of</b></font></td>
* <td><font size="-1">
* Reference Items, News and Articles</font></td>
* <td width="120"><font size="-1"> <b>Attribute of</b></font></td>
* <td><font size="-1"> Reference Items, News and Articles</font></td>
* </tr>
*
* <tr valign="top">
*
* <td width="120"><font size="-1">
* <b>Content type</b></font></td>
* <td><font size="-1">
* string</font></td>
* <td width="120"><font size="-1"> <b>Content type</b></font></td>
* <td><font size="-1"> string</font></td>
* </tr>
* </tbody></table>
* </tbody>
* </table>
*
* @param authors Author of the item.
*/
public void setAuthors(String[] authors);
@ -100,38 +94,33 @@ public interface Review extends GlobalInterface {
*
* <table border="1" cellpadding="5" cellspacing="0" width="640">
*
* <tbody><tr valign="top">
* <td colspan="2" bgcolor="#dddddd" valign="top"><font size="-1">
* <b><a name="author"></a>author</b></font></td>
* <tbody>
* <tr valign="top">
* <td colspan="2" bgcolor="#dddddd" valign="top"><font size="-1"> <b><a name="author"></a>author</b></font></td>
* </tr>
* <tr valign="top">
* <td width="120"><font size="-1">
* <b>Details</b></font></td>
* <td width="120"><font size="-1"> <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 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"> &lt;g:author&gt;John Steinbeck&lt;/g:author&gt;</font></td>
*
* </tr>
* <tr valign="top">
* <td width="120"><font size="-1">
* <b>Attribute of</b></font></td>
* <td><font size="-1">
* Reference Items, News and Articles</font></td>
* <td width="120"><font size="-1"> <b>Attribute of</b></font></td>
* <td><font size="-1"> Reference Items, News and Articles</font></td>
* </tr>
*
* <tr valign="top">
*
* <td width="120"><font size="-1">
* <b>Content type</b></font></td>
* <td><font size="-1">
* string</font></td>
* <td width="120"><font size="-1"> <b>Content type</b></font></td>
* <td><font size="-1"> string</font></td>
* </tr>
* </tbody></table>
* </tbody>
* </table>
*
* @return Author of the item.
*/
public String[] getAuthors();
@ -140,13 +129,14 @@ public interface Review extends GlobalInterface {
* Additional instructions to explain the items delivery process.
*
* <table border="1" cellpadding="5" cellspacing="0" width="640">
* <tbody><tr valign="top">
* <td colspan="2" bgcolor="#dddddd" valign="top"> <font size="-1"><b><a name="delivery_notes"></a>delivery_notes</b></font></td>
* <tbody>
* <tr valign="top">
* <td colspan="2" bgcolor="#dddddd" valign="top"><font size="-1"><b><a name="delivery_notes"></a>delivery_notes</b></font></td>
* </tr>
* <tr valign="top">
* <td width="120"> <font size="-1"><b>Details</b></font></td>
* <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>
* <td><font size="-1">Additional instructions to explain the items delivery process.</font></td>
* </tr>
* <tr valign="top">
* <td width="120"><font size="-1"><b>Example</b></font></td>
@ -157,19 +147,18 @@ public interface Review extends GlobalInterface {
*
* </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">Events, Products, Reviews, Services, Travel, Vehicles, Wanted
* Ads. </font></td>
* <font size="-1">Events, Products, Reviews, Services, Travel, Vehicles, Wanted Ads. </font></td>
* </tr>
* <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>
* <td><font size="-1">string</font></td>
* </tr>
* </tbody></table>
* </tbody>
* </table>
*
* @param deliveryNotes Additional instructions to explain the items delivery process.
*/
public void setDeliveryNotes(String deliveryNotes);
@ -178,13 +167,14 @@ public interface Review extends GlobalInterface {
* Additional instructions to explain the items delivery process.
*
* <table border="1" cellpadding="5" cellspacing="0" width="640">
* <tbody><tr valign="top">
* <td colspan="2" bgcolor="#dddddd" valign="top"> <font size="-1"><b><a name="delivery_notes"></a>delivery_notes</b></font></td>
* <tbody>
* <tr valign="top">
* <td colspan="2" bgcolor="#dddddd" valign="top"><font size="-1"><b><a name="delivery_notes"></a>delivery_notes</b></font></td>
* </tr>
* <tr valign="top">
* <td width="120"> <font size="-1"><b>Details</b></font></td>
* <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>
* <td><font size="-1">Additional instructions to explain the items delivery process.</font></td>
* </tr>
* <tr valign="top">
* <td width="120"><font size="-1"><b>Example</b></font></td>
@ -195,19 +185,18 @@ public interface Review extends GlobalInterface {
*
* </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">Events, Products, Reviews, Services, Travel, Vehicles, Wanted
* Ads. </font></td>
* <font size="-1">Events, Products, Reviews, Services, Travel, Vehicles, Wanted Ads. </font></td>
* </tr>
* <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>
* <td><font size="-1">string</font></td>
* </tr>
* </tbody></table>
* </tbody>
* </table>
*
* @return Additional instructions to explain the items delivery process.
*/
public String getDeliveryNotes();
@ -215,38 +204,36 @@ public interface Review extends GlobalInterface {
/**
* The maximum distance you will deliver an item in any direction.
* <table border="1" cellpadding="5" cellspacing="0" width="640">
* <tbody><tr valign="top">
* <td colspan="2" bgcolor="#dddddd" valign="top"> <font size="-1"><b><a name="delivery_radius"></a>delivery_radius</b></font></td>
* <tbody>
* <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">
* <td width="120"> <font size="-1"><b>Details</b></font></td>
* <td> <font size="-1">The maximum
* distance you will deliver an item in any direction. </font></td>
* <td width="120"><font size="-1"><b>Details</b></font></td>
* <td><font size="-1">The maximum distance you will deliver an item in any direction. </font></td>
* </tr>
* <tr valign="top">
* <td width="120"><font size="-1"><b>Example</b></font></td>
*
* <td>
* <font size="-1">&lt;g:delivery_radius&gt;10&lt;g:/delivery_radius&gt;
* </font>
* <br><font size="-1">&lt;g:delivery_radius&gt;10km&lt;/g:delivery_radius&gt;</font></td>
* <font size="-1">&lt;g:delivery_radius&gt;10&lt;g:/delivery_radius&gt; </font> <br>
* <font size="-1">&lt;g:delivery_radius&gt;10km&lt;/g:delivery_radius&gt;</font></td>
* </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">Events, Products, Reviews, Services, Travel, Vehicles, Wanted
* Ads. </font></td>
* <font size="-1">Events, Products, Reviews, Services, Travel, Vehicles, Wanted Ads. </font></td>
* </tr>
* <tr valign="top">
* <td width="120"> <font size="-1"><b>Content
* type</b></font></td>
* <td> <font size="-1">floatUnit</font></td>
* <td width="120"><font size="-1"><b>Content type</b></font></td>
* <td><font size="-1">floatUnit</font></td>
* </tr>
*
* </tbody></table>
* </tbody>
* </table>
*
* @param deliveryRadius The maximum distance you will deliver an item in any direction.
*/
public void setDeliveryRadius(FloatUnit deliveryRadius);
@ -254,38 +241,36 @@ public interface Review extends GlobalInterface {
/**
* The maximum distance you will deliver an item in any direction.
* <table border="1" cellpadding="5" cellspacing="0" width="640">
* <tbody><tr valign="top">
* <td colspan="2" bgcolor="#dddddd" valign="top"> <font size="-1"><b><a name="delivery_radius"></a>delivery_radius</b></font></td>
* <tbody>
* <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">
* <td width="120"> <font size="-1"><b>Details</b></font></td>
* <td> <font size="-1">The maximum
* distance you will deliver an item in any direction. </font></td>
* <td width="120"><font size="-1"><b>Details</b></font></td>
* <td><font size="-1">The maximum distance you will deliver an item in any direction. </font></td>
* </tr>
* <tr valign="top">
* <td width="120"><font size="-1"><b>Example</b></font></td>
*
* <td>
* <font size="-1">&lt;g:delivery_radius&gt;10&lt;g:/delivery_radius&gt;
* </font>
* <br><font size="-1">&lt;g:delivery_radius&gt;10km&lt;/g:delivery_radius&gt;</font></td>
* <font size="-1">&lt;g:delivery_radius&gt;10&lt;g:/delivery_radius&gt; </font> <br>
* <font size="-1">&lt;g:delivery_radius&gt;10km&lt;/g:delivery_radius&gt;</font></td>
* </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">Events, Products, Reviews, Services, Travel, Vehicles, Wanted
* Ads. </font></td>
* <font size="-1">Events, Products, Reviews, Services, Travel, Vehicles, Wanted Ads. </font></td>
* </tr>
* <tr valign="top">
* <td width="120"> <font size="-1"><b>Content
* type</b></font></td>
* <td> <font size="-1">floatUnit</font></td>
* <td width="120"><font size="-1"><b>Content type</b></font></td>
* <td><font size="-1">floatUnit</font></td>
* </tr>
*
* </tbody></table>
* </tbody>
* </table>
*
* @return The maximum distance you will deliver an item in any direction.
*/
public FloatUnit getDeliveryRadius();
@ -295,38 +280,34 @@ public interface Review extends GlobalInterface {
*
* <table border="1" cellpadding="5" cellspacing="0" width="640">
*
* <tbody><tr valign="top">
* <td colspan="2" bgcolor="#dddddd" valign="top"><font size="-1">
* <b><a name="name_of_item_being_reviewed"></a>name_of_item_being_reviewed</b></font></td>
* <tbody>
* <tr valign="top">
* <td colspan="2" bgcolor="#dddddd" valign="top"><font size="-1"> <b><a name="name_of_item_being_reviewed"></a>name_of_item_being_reviewed</b></font></td>
* </tr>
* <tr valign="top">
* <td width="120"><font size="-1">
* <b>Details</b></font></td>
* <td width="120"><font size="-1"> <b>Details</b></font></td>
*
* <td><font size="-1">
*
* The name of an item being reviewed.</font></td>
* </tr>
* <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"> &lt;g:name_of_item_being__reviewed&gt;Fleur de lys Restaurant&lt;/g:name_of_item_being_reviewed&gt;</font></td>
*
* </tr>
* <tr valign="top">
* <td width="120"><font size="-1">
* <b>Attribute of</b></font></td>
* <td><font size="-1">
* Reviews</font></td>
* <td width="120"><font size="-1"> <b>Attribute of</b></font></td>
* <td><font size="-1"> Reviews</font></td>
* </tr>
* <tr valign="top">
*
* <td width="120"><font size="-1">
* <b>Content type</b></font></td>
* <td><font size="-1">
* string</font></td>
* <td width="120"><font size="-1"> <b>Content type</b></font></td>
* <td><font size="-1"> string</font></td>
* </tr>
* </tbody></table>
* </tbody>
* </table>
*
* @param nameOfItemBeingReviewed The name of an item being reviewed.
*/
public void setNameOfItemBeingReviewed(String nameOfItemBeingReviewed);
@ -336,38 +317,34 @@ public interface Review extends GlobalInterface {
*
* <table border="1" cellpadding="5" cellspacing="0" width="640">
*
* <tbody><tr valign="top">
* <td colspan="2" bgcolor="#dddddd" valign="top"><font size="-1">
* <b><a name="name_of_item_being_reviewed"></a>name_of_item_being_reviewed</b></font></td>
* <tbody>
* <tr valign="top">
* <td colspan="2" bgcolor="#dddddd" valign="top"><font size="-1"> <b><a name="name_of_item_being_reviewed"></a>name_of_item_being_reviewed</b></font></td>
* </tr>
* <tr valign="top">
* <td width="120"><font size="-1">
* <b>Details</b></font></td>
* <td width="120"><font size="-1"> <b>Details</b></font></td>
*
* <td><font size="-1">
*
* The name of an item being reviewed.</font></td>
* </tr>
* <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"> &lt;g:name_of_item_being__reviewed&gt;Fleur de lys Restaurant&lt;/g:name_of_item_being_reviewed&gt;</font></td>
*
* </tr>
* <tr valign="top">
* <td width="120"><font size="-1">
* <b>Attribute of</b></font></td>
* <td><font size="-1">
* Reviews</font></td>
* <td width="120"><font size="-1"> <b>Attribute of</b></font></td>
* <td><font size="-1"> Reviews</font></td>
* </tr>
* <tr valign="top">
*
* <td width="120"><font size="-1">
* <b>Content type</b></font></td>
* <td><font size="-1">
* string</font></td>
* <td width="120"><font size="-1"> <b>Content type</b></font></td>
* <td><font size="-1"> string</font></td>
* </tr>
* </tbody></table>
* </tbody>
* </table>
*
* @return The name of an item being reviewed.
*/
public String getNameOfItemBeingReviewed();
@ -376,30 +353,26 @@ public interface Review extends GlobalInterface {
* Date the item was published.
*
* <table border="1" cellpadding="5" cellspacing="0" width="640">
* <tbody><tr valign="top">
* <td colspan="2" bgcolor="#dddddd"><font size="-1">
* <b><a name="publish_date"></a>publish_date</b></font></td>
* <tbody>
* <tr valign="top">
* <td colspan="2" bgcolor="#dddddd"><font size="-1"> <b><a name="publish_date"></a>publish_date</b></font></td>
*
* </tr>
* <tr valign="top">
* <td width="120"><font size="-1">
* <b>Details</b></font></td>
* <td width="120"><font size="-1"> <b>Details</b></font></td>
*
* <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:
* <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:
* YYYY-MM-DD</font></td>
*
* </tr>
* <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"> &lt;g:publish_date&gt;2005-12-20&lt;/g:publish_date&gt;</font></td>
* </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">
*
* Reference Items</font></td>
@ -408,11 +381,12 @@ public interface Review extends GlobalInterface {
* <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>
* </tbody></table>
* </tbody>
* </table>
*
* @param publishDate Date the item was published.
*/
public void setPublishDate(Date publishDate);
@ -421,30 +395,26 @@ public interface Review extends GlobalInterface {
* Date the item was published.
*
* <table border="1" cellpadding="5" cellspacing="0" width="640">
* <tbody><tr valign="top">
* <td colspan="2" bgcolor="#dddddd"><font size="-1">
* <b><a name="publish_date"></a>publish_date</b></font></td>
* <tbody>
* <tr valign="top">
* <td colspan="2" bgcolor="#dddddd"><font size="-1"> <b><a name="publish_date"></a>publish_date</b></font></td>
*
* </tr>
* <tr valign="top">
* <td width="120"><font size="-1">
* <b>Details</b></font></td>
* <td width="120"><font size="-1"> <b>Details</b></font></td>
*
* <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:
* <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:
* YYYY-MM-DD</font></td>
*
* </tr>
* <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"> &lt;g:publish_date&gt;2005-12-20&lt;/g:publish_date&gt;</font></td>
* </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">
*
* Reference Items</font></td>
@ -453,11 +423,12 @@ public interface Review extends GlobalInterface {
* <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>
* </tbody></table>
* </tbody>
* </table>
*
* @return Date the item was published.
*/
public Date getPublishDate();
@ -465,25 +436,20 @@ public interface Review extends GlobalInterface {
/**
* Rating of the product or service on a scale of 1-5, with 5 as the best.
* <table border="1" cellpadding="5" cellspacing="0" width="640">
* <tbody><tr valign="top">
* <td colspan="2" bgcolor="#dddddd" valign="top"><font size="-1">
* <b><a name="rating"></a>rating</b></font></td>
* <tbody>
* <tr valign="top">
* <td colspan="2" bgcolor="#dddddd" valign="top"><font size="-1"> <b><a name="rating"></a>rating</b></font></td>
*
* </tr>
* <tr valign="top">
* <td width="120"><font size="-1">
* <b>Details</b></font></td>
* <td><font size="-1">
* Rating of the product or service
* on a scale of 1-5, with 5 as the best. Numeric values only.</font></td>
* <td width="120"><font size="-1"> <b>Details</b></font></td>
* <td><font size="-1"> Rating of the product or service on a scale of 1-5, with 5 as the best. Numeric values only.</font></td>
* </tr>
*
* <tr valign="top">
*
* <td width="120"><font size="-1">
* <b>Example</b></font></td>
* <td><font size="-1">
* <em>Acceptable:</em><br>
* <td width="120"><font size="-1"> <b>Example</b></font></td>
* <td><font size="-1"> <em>Acceptable:</em><br>
* &lt;g:rating&gt;4&lt;/g:rating&gt;<br>
*
* <em>Not acceptable:</em><br>
@ -491,21 +457,20 @@ public interface Review extends GlobalInterface {
* &lt;g:rating&gt;good&lt;/g:rating&gt;</font></td>
* </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">
* Reviews</font></td>
* <td><font size="-1"> Reviews</font></td>
*
* </tr>
* <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>
* </tbody></table>
* </tbody>
* </table>
*
* @param rating Rating of the product or service on a scale of 1-5, with 5 as the best.
*/
public void setRating(Float rating);
@ -513,25 +478,20 @@ public interface Review extends GlobalInterface {
/**
* Rating of the product or service on a scale of 1-5, with 5 as the best.
* <table border="1" cellpadding="5" cellspacing="0" width="640">
* <tbody><tr valign="top">
* <td colspan="2" bgcolor="#dddddd" valign="top"><font size="-1">
* <b><a name="rating"></a>rating</b></font></td>
* <tbody>
* <tr valign="top">
* <td colspan="2" bgcolor="#dddddd" valign="top"><font size="-1"> <b><a name="rating"></a>rating</b></font></td>
*
* </tr>
* <tr valign="top">
* <td width="120"><font size="-1">
* <b>Details</b></font></td>
* <td><font size="-1">
* Rating of the product or service
* on a scale of 1-5, with 5 as the best. Numeric values only.</font></td>
* <td width="120"><font size="-1"> <b>Details</b></font></td>
* <td><font size="-1"> Rating of the product or service on a scale of 1-5, with 5 as the best. Numeric values only.</font></td>
* </tr>
*
* <tr valign="top">
*
* <td width="120"><font size="-1">
* <b>Example</b></font></td>
* <td><font size="-1">
* <em>Acceptable:</em><br>
* <td width="120"><font size="-1"> <b>Example</b></font></td>
* <td><font size="-1"> <em>Acceptable:</em><br>
* &lt;g:rating&gt;4&lt;/g:rating&gt;<br>
*
* <em>Not acceptable:</em><br>
@ -539,21 +499,20 @@ public interface Review extends GlobalInterface {
* &lt;g:rating&gt;good&lt;/g:rating&gt;</font></td>
* </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">
* Reviews</font></td>
* <td><font size="-1"> Reviews</font></td>
*
* </tr>
* <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>
* </tbody></table>
* </tbody>
* </table>
*
* @return Rating of the product or service on a scale of 1-5, with 5 as the best.
*/
public Float getRating();
@ -562,9 +521,9 @@ public interface Review extends GlobalInterface {
* The category of the item being reviewed.
*
* <table border="1" cellpadding="5" cellspacing="0" width="640">
* <tbody><tr valign="top">
* <td colspan="2" bgcolor="#dddddd" valign="top"><font size="-1">
* <b><a name="review_type"></a>review_type</b></font></td>
* <tbody>
* <tr valign="top">
* <td colspan="2" bgcolor="#dddddd" valign="top"><font size="-1"> <b><a name="review_type"></a>review_type</b></font></td>
* </tr>
* <tr valign="top">
* <td width="120"><font size="-1">
@ -574,32 +533,28 @@ public interface Review extends GlobalInterface {
* <td><font size="-1"> The category of the item being reviewed.</font></td>
* </tr>
* <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">
* &lt;g:review_type&gt;toy&lt;/g:review_type&gt;<br>
* <td><font size="-1"> &lt;g:review_type&gt;toy&lt;/g:review_type&gt;<br>
*
* &lt;g:review_type&gt;music&lt;/g:review_type&gt;<br>
* &lt;g:review_type&gt;restaraunt&lt;/g:review_type&gt;</font></td>
* </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">
* Reviews</font></td>
* <td><font size="-1"> Reviews</font></td>
* </tr>
* <tr valign="top">
*
* <td width="120"><font size="-1">
* <b>Content type</b></font></td>
* <td><font size="-1">
* string</font></td>
* <td width="120"><font size="-1"> <b>Content type</b></font></td>
* <td><font size="-1"> string</font></td>
*
* </tr>
* </tbody></table>
* </tbody>
* </table>
*
* @param reviewType The category of the item being reviewed.
*/
public void setReviewType(String reviewType);
@ -608,9 +563,9 @@ public interface Review extends GlobalInterface {
* The category of the item being reviewed.
*
* <table border="1" cellpadding="5" cellspacing="0" width="640">
* <tbody><tr valign="top">
* <td colspan="2" bgcolor="#dddddd" valign="top"><font size="-1">
* <b><a name="review_type"></a>review_type</b></font></td>
* <tbody>
* <tr valign="top">
* <td colspan="2" bgcolor="#dddddd" valign="top"><font size="-1"> <b><a name="review_type"></a>review_type</b></font></td>
* </tr>
* <tr valign="top">
* <td width="120"><font size="-1">
@ -620,129 +575,108 @@ public interface Review extends GlobalInterface {
* <td><font size="-1"> The category of the item being reviewed.</font></td>
* </tr>
* <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">
* &lt;g:review_type&gt;toy&lt;/g:review_type&gt;<br>
* <td><font size="-1"> &lt;g:review_type&gt;toy&lt;/g:review_type&gt;<br>
*
* &lt;g:review_type&gt;music&lt;/g:review_type&gt;<br>
* &lt;g:review_type&gt;restaraunt&lt;/g:review_type&gt;</font></td>
* </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">
* Reviews</font></td>
* <td><font size="-1"> Reviews</font></td>
* </tr>
* <tr valign="top">
*
* <td width="120"><font size="-1">
* <b>Content type</b></font></td>
* <td><font size="-1">
* string</font></td>
* <td width="120"><font size="-1"> <b>Content type</b></font></td>
* <td><font size="-1"> string</font></td>
*
* </tr>
* </tbody></table>
* </tbody>
* </table>
*
* @return The category of the item being reviewed.
*/
public String getReviewType();
/**
* The type of rating being provided: editorial (a
* review written by a member of your staff) or user ( a review written by a
* user of your site).
* The type of rating being provided: editorial (a review written by a member of your staff) or user ( a review written by a user of your site).
* <table border="1" cellpadding="5" cellspacing="0" width="640">
* <tbody><tr valign="top">
* <td colspan="2" bgcolor="#dddddd" valign="top"><font size="-1">
* <b><a name="reviewer_type"></a>reviewer_type</b></font></td>
* <tbody>
* <tr valign="top">
* <td colspan="2" bgcolor="#dddddd" valign="top"><font size="-1"> <b><a name="reviewer_type"></a>reviewer_type</b></font></td>
* </tr>
* <tr valign="top">
*
* <td width="120"><font size="-1">
* <b>Details</b></font></td>
* <td width="120"><font size="-1"> <b>Details</b></font></td>
*
* <td><font size="-1"> The type of rating being provided: editorial (a
* review written by a member of your staff) or user ( a review written by a
* user of your site)</font></td>
* <td><font size="-1"> The type of rating being provided: editorial (a review written by a member of your staff) or user ( a review written by a user of
* your site)</font></td>
* </tr>
* <tr valign="top">
* <td width="120"><font size="-1">
*
* <b>Example</b></font></td>
* <td><font size="-1">
* &lt;g:reviewer_type&gt;editorial&lt;/g:reviewer_type&gt;</font></td>
* <td><font size="-1"> &lt;g:reviewer_type&gt;editorial&lt;/g:reviewer_type&gt;</font></td>
*
* </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">
* Reviews</font></td>
* <td><font size="-1"> Reviews</font></td>
* </tr>
*
* <tr valign="top">
* <td width="120"><font size="-1">
* <b>Content type</b></font></td>
* <td><font size="-1">
* string</font></td>
* <td width="120"><font size="-1"> <b>Content type</b></font></td>
* <td><font size="-1"> string</font></td>
*
* </tr>
* </tbody></table>
* @param reviewerType The type of rating being provided: editorial (a
* review written by a member of your staff) or user ( a review written by a
* user of your site).
* </tbody>
* </table>
*
* @param reviewerType The type of rating being provided: editorial (a review written by a member of your staff) or user ( a review written by a user of
* your site).
*/
public void setReviewerType(String reviewerType);
/**
* The type of rating being provided: editorial (a
* review written by a member of your staff) or user ( a review written by a
* user of your site).
* The type of rating being provided: editorial (a review written by a member of your staff) or user ( a review written by a user of your site).
* <table border="1" cellpadding="5" cellspacing="0" width="640">
* <tbody><tr valign="top">
* <td colspan="2" bgcolor="#dddddd" valign="top"><font size="-1">
* <b><a name="reviewer_type"></a>reviewer_type</b></font></td>
* <tbody>
* <tr valign="top">
* <td colspan="2" bgcolor="#dddddd" valign="top"><font size="-1"> <b><a name="reviewer_type"></a>reviewer_type</b></font></td>
* </tr>
* <tr valign="top">
*
* <td width="120"><font size="-1">
* <b>Details</b></font></td>
* <td width="120"><font size="-1"> <b>Details</b></font></td>
*
* <td><font size="-1"> The type of rating being provided: editorial (a
* review written by a member of your staff) or user ( a review written by a
* user of your site)</font></td>
* <td><font size="-1"> The type of rating being provided: editorial (a review written by a member of your staff) or user ( a review written by a user of
* your site)</font></td>
* </tr>
* <tr valign="top">
* <td width="120"><font size="-1">
*
* <b>Example</b></font></td>
* <td><font size="-1">
* &lt;g:reviewer_type&gt;editorial&lt;/g:reviewer_type&gt;</font></td>
* <td><font size="-1"> &lt;g:reviewer_type&gt;editorial&lt;/g:reviewer_type&gt;</font></td>
*
* </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">
* Reviews</font></td>
* <td><font size="-1"> Reviews</font></td>
* </tr>
*
* <tr valign="top">
* <td width="120"><font size="-1">
* <b>Content type</b></font></td>
* <td><font size="-1">
* string</font></td>
* <td width="120"><font size="-1"> <b>Content type</b></font></td>
* <td><font size="-1"> string</font></td>
*
* </tr>
* </tbody></table>
* @return The type of rating being provided: editorial (a
* review written by a member of your staff) or user ( a review written by a
* user of your site).
* </tbody>
* </table>
*
* @return The type of rating being provided: editorial (a review written by a member of your staff) or user ( a review written by a user of your site).
*/
public String getReviewerType();
@ -750,29 +684,26 @@ public interface Review extends GlobalInterface {
* The web page of an item being reviewed.
*
* <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="url_of_item_being_reviewed"></a>url_of_item_being_reviewed</b></font></td>
* <td colspan="2" bgcolor="#dddddd" valign="top"><font size="-1"> <b><a name="url_of_item_being_reviewed"></a>url_of_item_being_reviewed</b></font></td>
* </tr>
* <tr valign="top">
* <td width="120"><font size="-1">
*
* <b>Details</b></font></td>
* <td><font size="-1">
* The web page of an item being reviewed.</font></td>
* <td><font size="-1"> The web page of an item being reviewed.</font></td>
*
* </tr>
* <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"> &lt;g:url_of_item_being_reviewed&gt;http://www.fleurdelyssf.com/&lt;/g:url_of_item_being_reviewed&gt;</font></td>
* </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">
*
* Reviews</font></td>
@ -781,11 +712,12 @@ public interface Review extends GlobalInterface {
* <td width="120"><font size="-1">
*
* <b>Content type</b></font></td>
* <td><font size="-1">
* uri</font></td>
* <td><font size="-1"> uri</font></td>
* </tr>
*
* </tbody></table>
* </tbody>
* </table>
*
* @param urlOfItemBeingReviewed The web page of an item being reviewed.
*/
public void setUrlOfItemBeingReviewed(URL urlOfItemBeingReviewed);
@ -794,29 +726,26 @@ public interface Review extends GlobalInterface {
* The web page of an item being reviewed.
*
* <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="url_of_item_being_reviewed"></a>url_of_item_being_reviewed</b></font></td>
* <td colspan="2" bgcolor="#dddddd" valign="top"><font size="-1"> <b><a name="url_of_item_being_reviewed"></a>url_of_item_being_reviewed</b></font></td>
* </tr>
* <tr valign="top">
* <td width="120"><font size="-1">
*
* <b>Details</b></font></td>
* <td><font size="-1">
* The web page of an item being reviewed.</font></td>
* <td><font size="-1"> The web page of an item being reviewed.</font></td>
*
* </tr>
* <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"> &lt;g:url_of_item_being_reviewed&gt;http://www.fleurdelyssf.com/&lt;/g:url_of_item_being_reviewed&gt;</font></td>
* </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">
*
* Reviews</font></td>
@ -825,11 +754,12 @@ public interface Review extends GlobalInterface {
* <td width="120"><font size="-1">
*
* <b>Content type</b></font></td>
* <td><font size="-1">
* uri</font></td>
* <td><font size="-1"> uri</font></td>
* </tr>
*
* </tbody></table>
* </tbody>
* </table>
*
* @return The web page of an item being reviewed.
*/
public URL getUrlOfItemBeingReviewed();

View file

@ -41,10 +41,8 @@ package org.rometools.feed.module.base;
import java.util.Date;
/**
* This is an interface for the GoogleBase plug in that exposes methods used for
* Scholarly publication, research studies and reference materials.
* This is an interface for the GoogleBase plug in that exposes methods used for Scholarly publication, research studies and reference materials.
*
* @author <a href="mailto:cooper@screaming-penguin.com">Robert "kebernet" Cooper</a>
* @version $Revision: 1.2 $
@ -54,38 +52,33 @@ public interface ScholarlyArticle extends GlobalInterface {
* Array of Author Names. Limit 10.
* <table border="1" cellpadding="5" cellspacing="0" width="640">
*
* <tbody><tr valign="top">
* <td colspan="2" bgcolor="#dddddd" valign="top"><font size="-1">
* <b><a name="author"></a>author</b></font></td>
* <tbody>
* <tr valign="top">
* <td colspan="2" bgcolor="#dddddd" valign="top"><font size="-1"> <b><a name="author"></a>author</b></font></td>
* </tr>
* <tr valign="top">
* <td width="120"><font size="-1">
* <b>Details</b></font></td>
* <td width="120"><font size="-1"> <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 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"> &lt;g:author&gt;John Steinbeck&lt;/g:author&gt;</font></td>
*
* </tr>
* <tr valign="top">
* <td width="120"><font size="-1">
* <b>Attribute of</b></font></td>
* <td><font size="-1">
* Reference Items, News and Articles</font></td>
* <td width="120"><font size="-1"> <b>Attribute of</b></font></td>
* <td><font size="-1"> Reference Items, News and Articles</font></td>
* </tr>
*
* <tr valign="top">
*
* <td width="120"><font size="-1">
* <b>Content type</b></font></td>
* <td><font size="-1">
* string</font></td>
* <td width="120"><font size="-1"> <b>Content type</b></font></td>
* <td><font size="-1"> string</font></td>
* </tr>
* </tbody></table>
* </tbody>
* </table>
*
* @param authors Array of Author Names. Limit 10.
*/
public void setAuthors(String[] authors);
@ -94,38 +87,33 @@ public interface ScholarlyArticle extends GlobalInterface {
* Array of Author Names. Limit 10.
* <table border="1" cellpadding="5" cellspacing="0" width="640">
*
* <tbody><tr valign="top">
* <td colspan="2" bgcolor="#dddddd" valign="top"><font size="-1">
* <b><a name="author"></a>author</b></font></td>
* <tbody>
* <tr valign="top">
* <td colspan="2" bgcolor="#dddddd" valign="top"><font size="-1"> <b><a name="author"></a>author</b></font></td>
* </tr>
* <tr valign="top">
* <td width="120"><font size="-1">
* <b>Details</b></font></td>
* <td width="120"><font size="-1"> <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 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"> &lt;g:author&gt;John Steinbeck&lt;/g:author&gt;</font></td>
*
* </tr>
* <tr valign="top">
* <td width="120"><font size="-1">
* <b>Attribute of</b></font></td>
* <td><font size="-1">
* Reference Items, News and Articles</font></td>
* <td width="120"><font size="-1"> <b>Attribute of</b></font></td>
* <td><font size="-1"> Reference Items, News and Articles</font></td>
* </tr>
*
* <tr valign="top">
*
* <td width="120"><font size="-1">
* <b>Content type</b></font></td>
* <td><font size="-1">
* string</font></td>
* <td width="120"><font size="-1"> <b>Content type</b></font></td>
* <td><font size="-1"> string</font></td>
* </tr>
* </tbody></table>
* </tbody>
* </table>
*
* @return Array of author names.
*/
public String[] getAuthors();
@ -135,41 +123,38 @@ public interface ScholarlyArticle extends GlobalInterface {
*
* <table border="1" cellpadding="5" cellspacing="0" width="640">
*
* <tbody><tr valign="top">
* <td colspan="2" bgcolor="#dddddd" valign="top"><font size="-1">
* <b><a name="pages"></a>pages</b></font></td>
* <tbody>
* <tr valign="top">
* <td colspan="2" bgcolor="#dddddd" valign="top"><font size="-1"> <b><a name="pages"></a>pages</b></font></td>
*
* </tr>
* <tr valign="top">
* <td width="120"><font size="-1">
* <b>Details</b></font></td>
* <td width="120"><font size="-1"> <b>Details</b></font></td>
* <td><font size="-1">
*
* The number of pages in the publication.</font></td>
* </tr>
*
* <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"> &lt;g:pages&gt;18&lt;/g:pages&gt;</font></td>
*
* </tr>
* <tr valign="top">
*
* <td width="120"><font size="-1">
* <b>Attribute of</b></font></td>
* <td><font size="-1">
* Reference Items, News and Articles</font></td>
* <td width="120"><font size="-1"> <b>Attribute of</b></font></td>
* <td><font size="-1"> Reference Items, News and Articles</font></td>
* </tr>
* <tr valign="top">
*
* <td width="120"><font size="-1">
*
* <b>Content type</b></font></td>
* <td><font size="-1">
* integer</font></td>
* <td><font size="-1"> integer</font></td>
* </tr>
* </tbody></table>
* </tbody>
* </table>
*
* @param pages Number of pages in the article
*/
public void setPages(Integer pages);
@ -179,41 +164,38 @@ public interface ScholarlyArticle extends GlobalInterface {
*
* <table border="1" cellpadding="5" cellspacing="0" width="640">
*
* <tbody><tr valign="top">
* <td colspan="2" bgcolor="#dddddd" valign="top"><font size="-1">
* <b><a name="pages"></a>pages</b></font></td>
* <tbody>
* <tr valign="top">
* <td colspan="2" bgcolor="#dddddd" valign="top"><font size="-1"> <b><a name="pages"></a>pages</b></font></td>
*
* </tr>
* <tr valign="top">
* <td width="120"><font size="-1">
* <b>Details</b></font></td>
* <td width="120"><font size="-1"> <b>Details</b></font></td>
* <td><font size="-1">
*
* The number of pages in the publication.</font></td>
* </tr>
*
* <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"> &lt;g:pages&gt;18&lt;/g:pages&gt;</font></td>
*
* </tr>
* <tr valign="top">
*
* <td width="120"><font size="-1">
* <b>Attribute of</b></font></td>
* <td><font size="-1">
* Reference Items, News and Articles</font></td>
* <td width="120"><font size="-1"> <b>Attribute of</b></font></td>
* <td><font size="-1"> Reference Items, News and Articles</font></td>
* </tr>
* <tr valign="top">
*
* <td width="120"><font size="-1">
*
* <b>Content type</b></font></td>
* <td><font size="-1">
* integer</font></td>
* <td><font size="-1"> integer</font></td>
* </tr>
* </tbody></table>
* </tbody>
* </table>
*
* @return Number of pages in the article
*/
public Integer getPages();
@ -223,41 +205,38 @@ public interface ScholarlyArticle extends GlobalInterface {
*
* <table border="1" cellpadding="5" cellspacing="0" width="640">
*
* <tbody><tr valign="top">
* <td colspan="2" bgcolor="#dddddd"><font size="-1">
* <b><a name="publication_name"></a>publication_name</b></font></td>
* <tbody>
* <tr valign="top">
* <td colspan="2" bgcolor="#dddddd"><font size="-1"> <b><a name="publication_name"></a>publication_name</b></font></td>
* </tr>
*
* <tr valign="top">
* <td width="120"><font size="-1">
* <b>Details</b></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 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"> &lt;g:publication_name&gt; Journal of Appropriate Technology&lt;/g:publication_name&gt;</font></td>
*
* </tr>
* <tr valign="top">
*
* <td width="120"><font size="-1">
* <b>Attribute of</b></font></td>
* <td><font size="-1">
* Research studies and publications</font></td>
* <td width="120"><font size="-1"> <b>Attribute of</b></font></td>
* <td><font size="-1"> Research studies and publications</font></td>
* </tr>
* <tr valign="top">
*
* <td width="120"><font size="-1">
*
* <b>Content type</b></font></td>
* <td><font size="-1">
* string</font></td>
* <td><font size="-1"> string</font></td>
* </tr>
* </tbody></table>
* </tbody>
* </table>
*
* @param publicationName Name of the publication.
*/
public void setPublicationName(String publicationName);
@ -267,41 +246,38 @@ public interface ScholarlyArticle extends GlobalInterface {
*
* <table border="1" cellpadding="5" cellspacing="0" width="640">
*
* <tbody><tr valign="top">
* <td colspan="2" bgcolor="#dddddd"><font size="-1">
* <b><a name="publication_name"></a>publication_name</b></font></td>
* <tbody>
* <tr valign="top">
* <td colspan="2" bgcolor="#dddddd"><font size="-1"> <b><a name="publication_name"></a>publication_name</b></font></td>
* </tr>
*
* <tr valign="top">
* <td width="120"><font size="-1">
* <b>Details</b></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 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"> &lt;g:publication_name&gt; Journal of Appropriate Technology&lt;/g:publication_name&gt;</font></td>
*
* </tr>
* <tr valign="top">
*
* <td width="120"><font size="-1">
* <b>Attribute of</b></font></td>
* <td><font size="-1">
* Research studies and publications</font></td>
* <td width="120"><font size="-1"> <b>Attribute of</b></font></td>
* <td><font size="-1"> Research studies and publications</font></td>
* </tr>
* <tr valign="top">
*
* <td width="120"><font size="-1">
*
* <b>Content type</b></font></td>
* <td><font size="-1">
* string</font></td>
* <td><font size="-1"> string</font></td>
* </tr>
* </tbody></table>
* </tbody>
* </table>
*
* @return Name of the publication.
*/
public String getPublicationName();
@ -309,41 +285,37 @@ public interface ScholarlyArticle extends GlobalInterface {
/**
* Volume of the publication.
* <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 valign="top">
* <td width="120"><font size="-1">
* <b>Details</b></font></td>
* <td width="120"><font size="-1"> <b>Details</b></font></td>
* <td><font size="-1">
*
* Volume of the publication.</font></td>
*
* </tr>
* <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">&lt;g:publication_volume&gt;VI&lt;/g:publication_volume&gt;</font></td>
*
* </tr>
* <tr valign="top">
*
* <td width="120"><font size="-1">
* <b>Attribute of</b></font></td>
* <td><font size="-1">
* Reference Items</font></td>
* <td width="120"><font size="-1"> <b>Attribute of</b></font></td>
* <td><font size="-1"> Reference Items</font></td>
* </tr>
*
* <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>
* <td><font size="-1"> string</font></td>
* </tr>
* </tbody></table>
* </tbody>
* </table>
*
* @param publicationVolume Volume of the publication.
*/
public void setPublicationVolume(String publicationVolume);
@ -351,41 +323,37 @@ public interface ScholarlyArticle extends GlobalInterface {
/**
* Volume of the publication.
* <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 valign="top">
* <td width="120"><font size="-1">
* <b>Details</b></font></td>
* <td width="120"><font size="-1"> <b>Details</b></font></td>
* <td><font size="-1">
*
* Volume of the publication.</font></td>
*
* </tr>
* <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">&lt;g:publication_volume&gt;VI&lt;/g:publication_volume&gt;</font></td>
*
* </tr>
* <tr valign="top">
*
* <td width="120"><font size="-1">
* <b>Attribute of</b></font></td>
* <td><font size="-1">
* Reference Items</font></td>
* <td width="120"><font size="-1"> <b>Attribute of</b></font></td>
* <td><font size="-1"> Reference Items</font></td>
* </tr>
*
* <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>
* <td><font size="-1"> string</font></td>
* </tr>
* </tbody></table>
* </tbody>
* </table>
*
* @return Volume of the publication.
*/
public String getPublicationVolume();
@ -394,17 +362,16 @@ public interface ScholarlyArticle extends GlobalInterface {
* Date article was published.
*
* <table border="1" cellpadding="5" cellspacing="0" width="640">
* <tbody><tr valign="top">
* <td colspan="2" bgcolor="#dddddd"><font size="-1">
* <b><a name="publish_date"></a>publish_date</b></font></td>
* <tbody>
* <tr valign="top">
* <td colspan="2" bgcolor="#dddddd"><font size="-1"> <b><a name="publish_date"></a>publish_date</b></font></td>
*
* </tr>
* <tr valign="top">
* <td width="120"><font size="-1">
*
* <b>Details</b></font></td>
* <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:
* <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:
* YYYY-MM-DD</font></td>
*
* </tr>
@ -416,11 +383,9 @@ public interface ScholarlyArticle extends GlobalInterface {
* </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">
* Reference Items</font></td>
* <td><font size="-1"> Reference Items</font></td>
* </tr>
* <tr valign="top">
* <td width="120"><font size="-1">
@ -430,7 +395,9 @@ public interface ScholarlyArticle extends GlobalInterface {
*
* date</font></td>
* </tr>
* </tbody></table>
* </tbody>
* </table>
*
* @param publishDate Date article was published
*/
public void setPublishDate(Date publishDate);
@ -439,17 +406,16 @@ public interface ScholarlyArticle extends GlobalInterface {
* Date article was published.
*
* <table border="1" cellpadding="5" cellspacing="0" width="640">
* <tbody><tr valign="top">
* <td colspan="2" bgcolor="#dddddd"><font size="-1">
* <b><a name="publish_date"></a>publish_date</b></font></td>
* <tbody>
* <tr valign="top">
* <td colspan="2" bgcolor="#dddddd"><font size="-1"> <b><a name="publish_date"></a>publish_date</b></font></td>
*
* </tr>
* <tr valign="top">
* <td width="120"><font size="-1">
*
* <b>Details</b></font></td>
* <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:
* <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:
* YYYY-MM-DD</font></td>
*
* </tr>
@ -461,11 +427,9 @@ public interface ScholarlyArticle extends GlobalInterface {
* </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">
* Reference Items</font></td>
* <td><font size="-1"> Reference Items</font></td>
* </tr>
* <tr valign="top">
* <td width="120"><font size="-1">
@ -475,7 +439,9 @@ public interface ScholarlyArticle extends GlobalInterface {
*
* date</font></td>
* </tr>
* </tbody></table>
* </tbody>
* </table>
*
* @return Date article was published
*/
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;
/**
* This interface contains all the other schema elements that the document
* doesn't associate with a particular type.
* This interface contains all the other schema elements that the document 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 void setLicenses(String[] licenses);

View file

@ -20,16 +20,17 @@
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 $
* @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 */
public ValidationException(String message) {
super( message );
public ValidationException(final String message) {
super(message);
}
}

File diff suppressed because it is too large Load diff

View file

@ -41,9 +41,8 @@ package org.rometools.feed.module.base;
import org.rometools.feed.module.base.types.FloatUnit;
/**This is an interface for the GoogleBase plug in that exposes methods used for
* wanted ads.
/**
* This is an interface for the GoogleBase plug in that exposes methods used for wanted ads.
*
* @author <a href="mailto:cooper@screaming-penguin.com">Robert "kebernet" Cooper</a>
* @version $Revision: 1.1 $
@ -53,13 +52,14 @@ public interface Wanted extends GlobalInterface {
* Additional instructions to explain the items delivery process.
*
* <table border="1" cellpadding="5" cellspacing="0" width="640">
* <tbody><tr valign="top">
* <td colspan="2" bgcolor="#dddddd" valign="top"> <font size="-1"><b><a name="delivery_notes"></a>delivery_notes</b></font></td>
* <tbody>
* <tr valign="top">
* <td colspan="2" bgcolor="#dddddd" valign="top"><font size="-1"><b><a name="delivery_notes"></a>delivery_notes</b></font></td>
* </tr>
* <tr valign="top">
* <td width="120"> <font size="-1"><b>Details</b></font></td>
* <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>
* <td><font size="-1">Additional instructions to explain the items delivery process.</font></td>
* </tr>
* <tr valign="top">
* <td width="120"><font size="-1"><b>Example</b></font></td>
@ -70,19 +70,18 @@ public interface Wanted extends GlobalInterface {
*
* </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">Events, Products, Reviews, Services, Travel, Vehicles, Wanted
* Ads. </font></td>
* <font size="-1">Events, Products, Reviews, Services, Travel, Vehicles, Wanted Ads. </font></td>
* </tr>
* <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>
* <td><font size="-1">string</font></td>
* </tr>
* </tbody></table>
* </tbody>
* </table>
*
* @param deliveryNotes Additional instructions to explain the items delivery process.
*/
public void setDeliveryNotes(String deliveryNotes);
@ -91,13 +90,14 @@ public interface Wanted extends GlobalInterface {
* Additional instructions to explain the items delivery process.
*
* <table border="1" cellpadding="5" cellspacing="0" width="640">
* <tbody><tr valign="top">
* <td colspan="2" bgcolor="#dddddd" valign="top"> <font size="-1"><b><a name="delivery_notes"></a>delivery_notes</b></font></td>
* <tbody>
* <tr valign="top">
* <td colspan="2" bgcolor="#dddddd" valign="top"><font size="-1"><b><a name="delivery_notes"></a>delivery_notes</b></font></td>
* </tr>
* <tr valign="top">
* <td width="120"> <font size="-1"><b>Details</b></font></td>
* <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>
* <td><font size="-1">Additional instructions to explain the items delivery process.</font></td>
* </tr>
* <tr valign="top">
* <td width="120"><font size="-1"><b>Example</b></font></td>
@ -108,19 +108,18 @@ public interface Wanted extends GlobalInterface {
*
* </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">Events, Products, Reviews, Services, Travel, Vehicles, Wanted
* Ads. </font></td>
* <font size="-1">Events, Products, Reviews, Services, Travel, Vehicles, Wanted Ads. </font></td>
* </tr>
* <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>
* <td><font size="-1">string</font></td>
* </tr>
* </tbody></table>
* </tbody>
* </table>
*
* @return Additional instructions to explain the items delivery process.
*/
public String getDeliveryNotes();
@ -128,38 +127,36 @@ public interface Wanted extends GlobalInterface {
/**
* The maximum distance you will deliver an item in any direction.
* <table border="1" cellpadding="5" cellspacing="0" width="640">
* <tbody><tr valign="top">
* <td colspan="2" bgcolor="#dddddd" valign="top"> <font size="-1"><b><a name="delivery_radius"></a>delivery_radius</b></font></td>
* <tbody>
* <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">
* <td width="120"> <font size="-1"><b>Details</b></font></td>
* <td> <font size="-1">The maximum
* distance you will deliver an item in any direction. </font></td>
* <td width="120"><font size="-1"><b>Details</b></font></td>
* <td><font size="-1">The maximum distance you will deliver an item in any direction. </font></td>
* </tr>
* <tr valign="top">
* <td width="120"><font size="-1"><b>Example</b></font></td>
*
* <td>
* <font size="-1">&lt;g:delivery_radius&gt;10&lt;g:/delivery_radius&gt;
* </font>
* <br><font size="-1">&lt;g:delivery_radius&gt;10km&lt;/g:delivery_radius&gt;</font></td>
* <font size="-1">&lt;g:delivery_radius&gt;10&lt;g:/delivery_radius&gt; </font> <br>
* <font size="-1">&lt;g:delivery_radius&gt;10km&lt;/g:delivery_radius&gt;</font></td>
* </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">Events, Products, Reviews, Services, Travel, Vehicles, Wanted
* Ads. </font></td>
* <font size="-1">Events, Products, Reviews, Services, Travel, Vehicles, Wanted Ads. </font></td>
* </tr>
* <tr valign="top">
* <td width="120"> <font size="-1"><b>Content
* type</b></font></td>
* <td> <font size="-1">floatUnit</font></td>
* <td width="120"><font size="-1"><b>Content type</b></font></td>
* <td><font size="-1">floatUnit</font></td>
* </tr>
*
* </tbody></table>
* </tbody>
* </table>
*
* @param deliveryRadius The maximum distance you will deliver an item in any direction.
*/
public void setDeliveryRadius(FloatUnit deliveryRadius);
@ -167,88 +164,82 @@ public interface Wanted extends GlobalInterface {
/**
* The maximum distance you will deliver an item in any direction.
* <table border="1" cellpadding="5" cellspacing="0" width="640">
* <tbody><tr valign="top">
* <td colspan="2" bgcolor="#dddddd" valign="top"> <font size="-1"><b><a name="delivery_radius"></a>delivery_radius</b></font></td>
* <tbody>
* <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">
* <td width="120"> <font size="-1"><b>Details</b></font></td>
* <td> <font size="-1">The maximum
* distance you will deliver an item in any direction. </font></td>
* <td width="120"><font size="-1"><b>Details</b></font></td>
* <td><font size="-1">The maximum distance you will deliver an item in any direction. </font></td>
* </tr>
* <tr valign="top">
* <td width="120"><font size="-1"><b>Example</b></font></td>
*
* <td>
* <font size="-1">&lt;g:delivery_radius&gt;10&lt;g:/delivery_radius&gt;
* </font>
* <br><font size="-1">&lt;g:delivery_radius&gt;10km&lt;/g:delivery_radius&gt;</font></td>
* <font size="-1">&lt;g:delivery_radius&gt;10&lt;g:/delivery_radius&gt; </font> <br>
* <font size="-1">&lt;g:delivery_radius&gt;10km&lt;/g:delivery_radius&gt;</font></td>
* </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">Events, Products, Reviews, Services, Travel, Vehicles, Wanted
* Ads. </font></td>
* <font size="-1">Events, Products, Reviews, Services, Travel, Vehicles, Wanted Ads. </font></td>
* </tr>
* <tr valign="top">
* <td width="120"> <font size="-1"><b>Content
* type</b></font></td>
* <td> <font size="-1">floatUnit</font></td>
* <td width="120"><font size="-1"><b>Content type</b></font></td>
* <td><font size="-1">floatUnit</font></td>
* </tr>
*
* </tbody></table>
* </tbody>
* </table>
*
* @return The maximum distance you will deliver an item in any direction.
*/
public FloatUnit getDeliveryRadius();
/**
/**
* Location of the property.
* <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 valign="top">
*
* <td width="120"><font size="-1">
* <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 width="120"><font size="-1"> <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>
*
* </tr>
* <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">
* <em>Acceptable:</em><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>
* <td><font size="-1"> <em>Acceptable:</em><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>
* &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>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>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>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 valign="top">
* <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 Ads.</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
* Ads.</font></td>
* </tr>
*
* <tr valign="top">
*
* <td width="120"><font size="-1">
* <b>Content type</b></font></td>
* <td><font size="-1">
* locationType</font></td>
* <td width="120"><font size="-1"> <b>Content type</b></font></td>
* <td><font size="-1"> locationType</font></td>
* </tr>
* </tbody></table>
* </tbody>
* </table>
*
* @param location Location of the property.
*/
public void setLocation(String location);
@ -256,49 +247,45 @@ public interface Wanted extends GlobalInterface {
/**
* Location of the property.
* <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 valign="top">
*
* <td width="120"><font size="-1">
* <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 width="120"><font size="-1"> <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>
*
* </tr>
* <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">
* <em>Acceptable:</em><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>
* <td><font size="-1"> <em>Acceptable:</em><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>
* &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>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>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>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 valign="top">
* <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 Ads.</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
* Ads.</font></td>
* </tr>
*
* <tr valign="top">
*
* <td width="120"><font size="-1">
* <b>Content type</b></font></td>
* <td><font size="-1">
* locationType</font></td>
* <td width="120"><font size="-1"> <b>Content type</b></font></td>
* <td><font size="-1"> locationType</font></td>
* </tr>
* </tbody></table>
* </tbody>
* </table>
*
* @return Location of the property.
*/
public String getLocation();

View file

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

View file

@ -20,16 +20,6 @@
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.URL;
import java.text.ParseException;
@ -38,8 +28,19 @@ import java.util.Iterator;
import java.util.List;
import java.util.logging.Level;
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 $
@ -48,71 +49,73 @@ import org.jdom.Namespace;
public class CustomTagParser implements ModuleParser {
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 */
public CustomTagParser() {
}
public Module parse(Element element) {
CustomTags module = new CustomTagsImpl();
ArrayList tags = new ArrayList();
List elements = element.getChildren();
Iterator it = elements.iterator();
while( it.hasNext() ){
Element child = (Element) it.next();
if( child.getNamespace().equals( NS ) ){
String type = child.getAttributeValue( "type" );
try{
if( type == null ){
public Module parse(final Element element) {
final CustomTags module = new CustomTagsImpl();
final ArrayList tags = new ArrayList();
final List elements = element.getChildren();
final Iterator it = elements.iterator();
while (it.hasNext()) {
final Element child = (Element) it.next();
if (child.getNamespace().equals(NS)) {
final String type = child.getAttributeValue("type");
try {
if (type == null) {
continue;
} else if( type.equals( "string") ){
tags.add( new CustomTagImpl( child.getName(), child.getText() ) );
} else if( type.equals( "int") ){
tags.add( new CustomTagImpl( child.getName(), new Integer( child.getTextTrim() )));
} else if( type.equals( "float") ){
tags.add( new CustomTagImpl( child.getName(), new Float( child.getTextTrim() ) ) );
} else if( type.equals("intUnit") ){
tags.add( new CustomTagImpl( child.getName(), new IntUnit( child.getTextTrim()) ) );
} else if( type.equals( "floatUnit") ){
tags.add( new CustomTagImpl( child.getName(), new FloatUnit( child.getTextTrim()) ) );
} else if( type.equals( "date") ){
try{
tags.add( new CustomTagImpl( child.getName(), new ShortDate( GoogleBaseParser.SHORT_DT_FMT.parse( child.getTextTrim()))) );
} catch( ParseException e ){
log.log( Level.WARNING, "Unable to parse date type on "+child.getName(), e );
} else if (type.equals("string")) {
tags.add(new CustomTagImpl(child.getName(), child.getText()));
} else if (type.equals("int")) {
tags.add(new CustomTagImpl(child.getName(), new Integer(child.getTextTrim())));
} else if (type.equals("float")) {
tags.add(new CustomTagImpl(child.getName(), new Float(child.getTextTrim())));
} else if (type.equals("intUnit")) {
tags.add(new CustomTagImpl(child.getName(), new IntUnit(child.getTextTrim())));
} else if (type.equals("floatUnit")) {
tags.add(new CustomTagImpl(child.getName(), new FloatUnit(child.getTextTrim())));
} else if (type.equals("date")) {
try {
tags.add(new CustomTagImpl(child.getName(), new ShortDate(GoogleBaseParser.SHORT_DT_FMT.parse(child.getTextTrim()))));
} catch (final ParseException e) {
log.log(Level.WARNING, "Unable to parse date type on " + child.getName(), e);
}
} else if( type.equals( "dateTime") ){
try{
tags.add( new CustomTagImpl( child.getName(), GoogleBaseParser.LONG_DT_FMT.parse( child.getTextTrim() )));
} catch(ParseException e){
log.log( Level.WARNING, "Unable to parse date type on "+child.getName(), e );
} else if (type.equals("dateTime")) {
try {
tags.add(new CustomTagImpl(child.getName(), GoogleBaseParser.LONG_DT_FMT.parse(child.getTextTrim())));
} catch (final ParseException e) {
log.log(Level.WARNING, "Unable to parse date type on " + child.getName(), e);
}
} else if( type.equals( "dateTimeRange") ){
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()))));
} catch(Exception e){
log.log( Level.WARNING, "Unable to parse date type on "+child.getName(), e );
} else if (type.equals("dateTimeRange")) {
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()))));
} catch (final Exception e) {
log.log(Level.WARNING, "Unable to parse date type on " + child.getName(), e);
}
} else if( type.equals( "url") ){
try{
tags.add( new CustomTagImpl( child.getName(), new URL( child.getTextTrim() )) );
} catch( MalformedURLException e){
log.log( Level.WARNING, "Unable to parse URL type on "+child.getName(), e );
} else if (type.equals("url")) {
try {
tags.add(new CustomTagImpl(child.getName(), new URL(child.getTextTrim())));
} catch (final MalformedURLException e) {
log.log(Level.WARNING, "Unable to parse URL type on " + child.getName(), e);
}
} else if( type.equals( "boolean") ){
tags.add( new CustomTagImpl( child.getName(), new Boolean( child.getTextTrim().toLowerCase()) ));
} else if( type.equals( "location") ) {
tags.add( new CustomTagImpl( child.getName(), new CustomTagImpl.Location( child.getText() )));
} else if (type.equals("boolean")) {
tags.add(new CustomTagImpl(child.getName(), new Boolean(child.getTextTrim().toLowerCase())));
} else if (type.equals("location")) {
tags.add(new CustomTagImpl(child.getName(), new CustomTagImpl.Location(child.getText())));
} else {
throw new Exception( "Unknown type: "+ type );
throw new Exception("Unknown type: " + type);
}
} catch(Exception e){
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 );
module.setValues(tags);
return module;
}

View file

@ -39,9 +39,15 @@
*/
package org.rometools.feed.module.base.io;
import com.sun.syndication.feed.module.Module;
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;
import org.jdom2.Element;
import org.jdom2.Namespace;
import org.rometools.feed.module.base.GoogleBase;
import org.rometools.feed.module.base.GoogleBaseImpl;
import org.rometools.feed.module.base.types.CurrencyEnumeration;
@ -56,18 +62,8 @@ import org.rometools.feed.module.base.types.ShortDate;
import org.rometools.feed.module.base.types.Size;
import org.rometools.feed.module.base.types.YearType;
import org.jdom.Element;
import org.jdom.Namespace;
import java.beans.PropertyDescriptor;
import java.net.URL;
import java.util.Date;
import java.util.HashMap;
import java.util.HashSet;
import java.util.Set;
import com.sun.syndication.feed.module.Module;
import com.sun.syndication.io.ModuleGenerator;
/**
*
@ -75,7 +71,7 @@ import java.util.Set;
* @version $Revision: 1.1 $
*/
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 */
public GoogleBaseGenerator() {
@ -87,69 +83,69 @@ public class GoogleBaseGenerator implements ModuleGenerator {
}
public Set getNamespaces() {
HashSet set = new HashSet();
final HashSet set = new HashSet();
set.add(GoogleBaseGenerator.NS);
return set;
}
public void generate(Module module,Element element) {
GoogleBaseImpl mod = (GoogleBaseImpl)module;
HashMap props2tags = new HashMap(GoogleBaseParser.PROPS2TAGS);
PropertyDescriptor[] pds = GoogleBaseParser.pds;
public void generate(final Module module, final Element element) {
final GoogleBaseImpl mod = (GoogleBaseImpl) module;
final HashMap props2tags = new HashMap(GoogleBaseParser.PROPS2TAGS);
final PropertyDescriptor[] pds = GoogleBaseParser.pds;
for(int i = 0; i < pds.length; i++) {
String tagName = (String)props2tags.get(pds[i].getName());
for (final PropertyDescriptor pd : pds) {
final String tagName = (String) props2tags.get(pd.getName());
if(tagName == null) {
if (tagName == null) {
continue;
}
Object[] values = null;
try {
if(pds[i].getPropertyType().isArray()) {
values = (Object[])pds[i].getReadMethod().invoke(mod,(Object[])null);
if (pd.getPropertyType().isArray()) {
values = (Object[]) pd.getReadMethod().invoke(mod, (Object[]) null);
} else {
values = new Object[] {
pds[i].getReadMethod().invoke(mod,(Object[])null)
};
values = new Object[] { pd.getReadMethod().invoke(mod, (Object[]) null) };
}
for(int j = 0; (values != null)&&(j < values.length); j++) {
if(values[j] != null) {
element.addContent(this.generateTag(values[j],tagName));
for (int j = 0; values != null && j < values.length; j++) {
if (values[j] != null) {
element.addContent(generateTag(values[j], tagName));
}
}
} catch(Exception e) {
} catch (final Exception e) {
e.printStackTrace();
}
}
}
public Element generateTag(Object o,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) {
return this.generateSimpleElement(tagName,o.toString());
} else if(o instanceof ShortDate) {
return this.generateSimpleElement(tagName,GoogleBaseParser.SHORT_DT_FMT.format(o));
} else if(o instanceof Date) {
return this.generateSimpleElement(tagName,GoogleBaseParser.LONG_DT_FMT.format(o));
} else if(o instanceof ShippingType) {
ShippingType st = (ShippingType)o;
Element element = new Element(tagName,GoogleBaseGenerator.NS);
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) {
return generateSimpleElement(tagName, o.toString());
} else if (o instanceof ShortDate) {
return generateSimpleElement(tagName, GoogleBaseParser.SHORT_DT_FMT.format(o));
} else if (o instanceof Date) {
return generateSimpleElement(tagName, GoogleBaseParser.LONG_DT_FMT.format(o));
} else if (o instanceof ShippingType) {
final ShippingType st = (ShippingType) o;
final Element element = new Element(tagName, GoogleBaseGenerator.NS);
element.addContent(this.generateSimpleElement("country",st.getCountry()));
element.addContent(generateSimpleElement("country", st.getCountry()));
element.addContent(this.generateSimpleElement("service", st.getService().toString() ));
element.addContent(generateSimpleElement("service", st.getService().toString()));
element.addContent(this.generateSimpleElement("price",st.getPrice().toString()));
element.addContent(generateSimpleElement("price", st.getPrice().toString()));
return element;
} else if(o instanceof DateTimeRange) {
DateTimeRange dtr = (DateTimeRange)o;
Element element = new Element(tagName,GoogleBaseGenerator.NS);
element.addContent(this.generateSimpleElement("start",GoogleBaseParser.LONG_DT_FMT.format(dtr.getStart())));
element.addContent(this.generateSimpleElement("end",GoogleBaseParser.LONG_DT_FMT.format(dtr.getEnd())));
} else if (o instanceof DateTimeRange) {
final DateTimeRange dtr = (DateTimeRange) o;
final Element element = new Element(tagName, GoogleBaseGenerator.NS);
element.addContent(generateSimpleElement("start", GoogleBaseParser.LONG_DT_FMT.format(dtr.getStart())));
element.addContent(generateSimpleElement("end", GoogleBaseParser.LONG_DT_FMT.format(dtr.getEnd())));
return element;
}
@ -157,8 +153,8 @@ public class GoogleBaseGenerator implements ModuleGenerator {
throw new RuntimeException("Unknown class type to handle: " + o.getClass().getName());
}
protected Element generateSimpleElement(String name,String value) {
Element element = new Element(name,GoogleBaseGenerator.NS);
protected Element generateSimpleElement(final String name, final String value) {
final Element element = new Element(name, GoogleBaseGenerator.NS);
element.addContent(value);
return element;

View file

@ -39,10 +39,25 @@
*/
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.GoogleBaseImpl;
import com.sun.syndication.io.ModuleParser;
import org.rometools.feed.module.base.types.CurrencyEnumeration;
import org.rometools.feed.module.base.types.DateTimeRange;
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.YearType;
import org.jdom.Element;
import org.jdom.Namespace;
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 com.sun.syndication.feed.module.Module;
import com.sun.syndication.io.ModuleParser;
/**
* DOCUMENT ME!
*
* @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.3 $
*/
public class GoogleBaseParser implements ModuleParser {
@ -98,12 +92,12 @@ public class GoogleBaseParser implements ModuleParser {
try {
pds = Introspector.getBeanInfo(GoogleBaseImpl.class).getPropertyDescriptors();
PROPS2TAGS.load(GoogleBaseParser.class.getResourceAsStream("/org/rometools/feed/module/base/io/tags.properties"));
} catch(IOException e) {
} catch (final IOException e) {
e.printStackTrace();
log.log(Level.SEVERE,"Unable to read properties file for Google Base tags!",e);
} catch(IntrospectionException e) {
log.log(Level.SEVERE, "Unable to read properties file for Google Base tags!", e);
} catch (final IntrospectionException e) {
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();
}
public Module parse(Element element) {
HashMap tag2pd = new HashMap();
GoogleBaseImpl module = new GoogleBaseImpl();
public Module parse(final Element element) {
final HashMap tag2pd = new HashMap();
final GoogleBaseImpl module = new GoogleBaseImpl();
try {
for(int i = 0; i < pds.length; i++) {
PropertyDescriptor pd = pds[i];
String tagName = GoogleBaseParser.PROPS2TAGS.getProperty(pd.getName());
for (final PropertyDescriptor pd : pds) {
final String tagName = GoogleBaseParser.PROPS2TAGS.getProperty(pd.getName());
if(tagName == null) {
log.log(Level.FINE,"Property: " + pd.getName() + " doesn't have a tag mapping. ");
if (tagName == null) {
log.log(Level.FINE, "Property: " + pd.getName() + " doesn't have a tag mapping. ");
} else {
tag2pd.put(tagName,pd);
tag2pd.put(tagName, pd);
}
}
} catch(Exception e) {
throw new RuntimeException("Exception building tag to property mapping. ",e);
} catch (final Exception e) {
throw new RuntimeException("Exception building tag to property mapping. ", e);
}
List children = element.getChildren();
Iterator it = children.iterator();
final List children = element.getChildren();
final Iterator it = children.iterator();
while(it.hasNext()) {
Element child = (Element)it.next();
while (it.hasNext()) {
final Element child = (Element) it.next();
if(child.getNamespace().equals(GoogleBaseParser.NS)) {
PropertyDescriptor pd = (PropertyDescriptor)tag2pd.get(child.getName());
if (child.getNamespace().equals(GoogleBaseParser.NS)) {
final PropertyDescriptor pd = (PropertyDescriptor) tag2pd.get(child.getName());
if(pd != null) {
if (pd != null) {
try {
this.handleTag(child,pd,module);
} catch(Exception e) {
log.log(Level.WARNING,"Unable to handle tag: " + child.getName(),e);
handleTag(child, pd, module);
} catch (final Exception e) {
log.log(Level.WARNING, "Unable to handle tag: " + child.getName(), e);
e.printStackTrace();
}
}
@ -156,13 +149,13 @@ public class GoogleBaseParser implements ModuleParser {
return module;
}
public static String stripNonValidCharacters(char[] validCharacters,String input) {
StringBuffer newString = new StringBuffer();
public static String stripNonValidCharacters(final char[] validCharacters, final String input) {
final StringBuffer newString = new StringBuffer();
for(int i = 0; i < input.length(); i++) {
for(int j = 0; j < validCharacters.length; j++) {
if(input.charAt(i) == validCharacters[j]) {
newString.append(validCharacters[j]);
for (int i = 0; i < input.length(); i++) {
for (final char validCharacter : validCharacters) {
if (input.charAt(i) == validCharacter) {
newString.append(validCharacter);
}
}
}
@ -174,72 +167,74 @@ public class GoogleBaseParser implements ModuleParser {
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;
if((pd.getPropertyType() == Integer.class)||(pd.getPropertyType().getComponentType() == Integer.class)) {
tagValue = new Integer(GoogleBaseParser.stripNonValidCharacters(GoogleBaseParser.INTEGER_CHARS,tag.getText()));
} else if((pd.getPropertyType() == Float.class)||(pd.getPropertyType().getComponentType() == Float.class)) {
tagValue = new Float(GoogleBaseParser.stripNonValidCharacters(GoogleBaseParser.FLOAT_CHARS,tag.getText()));
} else if((pd.getPropertyType() == String.class)||(pd.getPropertyType().getComponentType() == String.class)) {
if (pd.getPropertyType() == Integer.class || pd.getPropertyType().getComponentType() == Integer.class) {
tagValue = new Integer(GoogleBaseParser.stripNonValidCharacters(GoogleBaseParser.INTEGER_CHARS, tag.getText()));
} else if (pd.getPropertyType() == Float.class || pd.getPropertyType().getComponentType() == Float.class) {
tagValue = new Float(GoogleBaseParser.stripNonValidCharacters(GoogleBaseParser.FLOAT_CHARS, tag.getText()));
} else if (pd.getPropertyType() == String.class || pd.getPropertyType().getComponentType() == String.class) {
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());
} 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());
} else if((pd.getPropertyType() == Date.class)||(pd.getPropertyType().getComponentType() == Date.class)) {
String text = tag.getText().trim();
} else if (pd.getPropertyType() == Date.class || pd.getPropertyType().getComponentType() == Date.class) {
final String text = tag.getText().trim();
if(text.length() > 10) {
if (text.length() > 10) {
tagValue = GoogleBaseParser.LONG_DT_FMT.parse(text);
} else {
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());
} 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());
} 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()));
} else if((pd.getPropertyType() == ShippingType.class)||(pd.getPropertyType().getComponentType() == ShippingType.class)) {
FloatUnit price = new FloatUnit(tag.getChild("price",GoogleBaseParser.NS).getText().trim());
ShippingType.ServiceEnumeration service = ShippingType.ServiceEnumeration.findByValue(tag.getChild("service",GoogleBaseParser.NS).getText().trim());
} 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()));
} else if (pd.getPropertyType() == ShippingType.class || pd.getPropertyType().getComponentType() == ShippingType.class) {
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;
}
String country = tag.getChild("country",GoogleBaseParser.NS).getText().trim();
tagValue = new ShippingType(price,service,country);
} else if((pd.getPropertyType() == PaymentTypeEnumeration.class)||(pd.getPropertyType().getComponentType() == PaymentTypeEnumeration.class)) {
final String country = tag.getChild("country", GoogleBaseParser.NS).getText().trim();
tagValue = new ShippingType(price, service, country);
} else if (pd.getPropertyType() == PaymentTypeEnumeration.class || pd.getPropertyType().getComponentType() == PaymentTypeEnumeration.class) {
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());
} 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());
} 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());
} 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());
} 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());
}
if(!pd.getPropertyType().isArray()) {
pd.getWriteMethod().invoke(module,new Object[] {tagValue});
if (!pd.getPropertyType().isArray()) {
pd.getWriteMethod().invoke(module, new Object[] { tagValue });
} else {
Object[] current = (Object[])pd.getReadMethod().invoke(module,(Object[])null);
int newSize = (current == null) ? 1 : (current.length + 1);
Object setValue = Array.newInstance(pd.getPropertyType().getComponentType(),newSize);
final Object[] current = (Object[]) pd.getReadMethod().invoke(module, (Object[]) null);
final int newSize = current == null ? 1 : current.length + 1;
final Object setValue = Array.newInstance(pd.getPropertyType().getComponentType(), newSize);
int i = 0;
for(; (current != null)&&(i < current.length); i++) {
Array.set(setValue,i,current[i]);
for (; current != null && i < current.length; i++) {
Array.set(setValue, i, current[i]);
}
Array.set(setValue,i,tagValue);
pd.getWriteMethod().invoke(module,new Object[] {setValue});
Array.set(setValue, i, tagValue);
pd.getWriteMethod().invoke(module, new Object[] { setValue });
}
}
}

View file

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

View file

@ -41,7 +41,6 @@ package org.rometools.feed.module.base.types;
import java.util.HashMap;
/**
* An Enumeration of valid currency types.
*
@ -51,7 +50,7 @@ import java.util.HashMap;
public class CurrencyEnumeration {
private static final HashMap lookup = new HashMap();
//<xs:restriction base="xs:string">
// <xs:restriction base="xs:string">
// <xs:enumeration value="AED"/>
public static final CurrencyEnumeration AED = new CurrencyEnumeration("AED");
@ -568,31 +567,33 @@ public class CurrencyEnumeration {
// <xs:enumeration value="ZWD"/>
public static final CurrencyEnumeration ZWD = new CurrencyEnumeration("ZWD");
//</xs:restriction>
private String value;
// </xs:restriction>
private final String value;
/**
* Creates a new instance of CurrencyEnumeration
*
* @param value DOCUMENT ME!
*/
private CurrencyEnumeration(String value) {
private CurrencyEnumeration(final String value) {
this.value = value;
lookup.put(value,this);
lookup.put(value, this);
}
public String getValue() {
return this.value;
return value;
}
@Override
public Object clone() {
return this;
}
public static CurrencyEnumeration findByValue(String value) {
return (CurrencyEnumeration)lookup.get(value.trim().toUpperCase());
public static CurrencyEnumeration findByValue(final String value) {
return (CurrencyEnumeration) lookup.get(value.trim().toUpperCase());
}
@Override
public String toString() {
return value;
}

View file

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

View file

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

View file

@ -39,7 +39,8 @@
*/
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>
* @version $Revision: 1.1 $
@ -49,19 +50,19 @@ public class GenderEnumeration implements CloneableType {
public static final GenderEnumeration MALE = new GenderEnumeration("Male");
/** Women */
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;
}
/** 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) {
return null;
}
String gender = value.toUpperCase();
final String gender = value.toUpperCase();
if (gender.charAt(0) == 'M') {
return GenderEnumeration.MALE;
@ -74,14 +75,16 @@ public class GenderEnumeration implements CloneableType {
/** Returns the value of the instance */
public String getValue() {
return this.value;
return value;
}
/** Returns a reference to the same object. :P */
@Override
public Object clone() {
return this;
}
@Override
public String toString() {
return value;
}

View file

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

View file

@ -57,10 +57,10 @@ public class PaymentTypeEnumeration {
public static final PaymentTypeEnumeration DISCOVER = new PaymentTypeEnumeration("Discover");
public static final PaymentTypeEnumeration WIRE_TRANSFER = new PaymentTypeEnumeration("Wire transfer");
public static final PaymentTypeEnumeration PAYPAL = new PaymentTypeEnumeration("Paypal");
private String value;
private final String value;
/** Creates a new instance of PaymentTypeEnumeration */
private PaymentTypeEnumeration(String value) {
private PaymentTypeEnumeration(final String value) {
this.value = value;
lookup.put(this.value.toUpperCase(), this);
}
@ -69,14 +69,16 @@ public class PaymentTypeEnumeration {
return value;
}
public static PaymentTypeEnumeration findByValue(String value) {
public static PaymentTypeEnumeration findByValue(final String value) {
return (PaymentTypeEnumeration) lookup.get(value.toUpperCase());
}
@Override
public Object clone() {
return this;
}
@Override
public String toString() {
return value;
}

View file

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

View file

@ -43,6 +43,7 @@ import java.util.HashMap;
/**
* This class represents a specific shipping option for an item.
*
* @author <a href="mailto:cooper@screaming-penguin.com">Robert "kebernet" Cooper</a>
* @version $Revision: 1.1 $
*/
@ -50,23 +51,24 @@ public class ShippingType implements CloneableType {
/**
* price of the shipping.
*/
private FloatUnit price;
private final FloatUnit price;
/**
* Service used.
*/
private ServiceEnumeration service;
private final ServiceEnumeration service;
/**
* Country to ship to
*/
private String country;
private final String country;
/**
* Creates a new instance of ShippingType
*
* @param price The price of the shipping option
* @param service Shipping service used.
* @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.service = service;
this.country = country;
@ -74,6 +76,7 @@ public class ShippingType implements CloneableType {
/**
* Returns the destination country.
*
* @return Returns the destination country.
*/
public String getCountry() {
@ -82,6 +85,7 @@ public class ShippingType implements CloneableType {
/**
* Returns the price of this shipping option.
*
* @return Returns the price of this shipping option.
*/
public FloatUnit getPrice() {
@ -90,6 +94,7 @@ public class ShippingType implements CloneableType {
/**
* Returns the ServiceEnumeration instance for the shipping service used.
*
* @return Returns the ServiceEnumeration instance for the shipping service used.
*/
public ServiceEnumeration getService() {
@ -98,27 +103,35 @@ public class ShippingType implements CloneableType {
/**
* Clones this object.
*
* @return Duplicate ShippingType object.
*/
@Override
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.
*
* @return String representation of this object.
*/
@Override
public String toString() {
return this.country + " " + this.price + " " + this.service;
return country + " " + price + " " + service;
}
public boolean equals( Object o ){
if( !(o instanceof ShippingType))
return false;
if( this.toString().equals( o.toString() ) )
return true;
@Override
public boolean equals(final Object o) {
if (!(o instanceof ShippingType)) {
return false;
}
if (toString().equals(o.toString())) {
return true;
}
return false;
}
/**
* Enumeration class of valid options for ServiceType.
*/
@ -143,40 +156,45 @@ public class ShippingType implements CloneableType {
/**
* String value
*/
private String value;
private final String value;
/**
* Creates a new instance of ServiceEnumeration.
*
* @param value String value to encapsulate.
*/
private ServiceEnumeration(String value) {
private ServiceEnumeration(final String value) {
this.value = value;
lookup.put(this.value.toUpperCase(), this);
}
/**
* String value of this Service.
*
* @return String value of this Service.
*/
public String getValue() {
return this.value;
return value;
}
/**
* Looks up a ServiceEnumeration based on the string value.
*
* @param value String value to search for.
* @return ServiceEnumeration or null.
*/
public static ServiceEnumeration findByValue(String value) {
public static ServiceEnumeration findByValue(final String value) {
return (ServiceEnumeration) lookup.get(value.toUpperCase());
}
/**
* String value of this Service.
*
* @return String value of this Service.
*/
@Override
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;
/**
* 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 developers.
* 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
* developers.
*
* Move along. Nothing to see here.
*
* @author <a href="mailto:cooper@screaming-penguin.com">Robert "kebernet" Cooper</a>
* @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.
*
* @param date Date value to read from.
*/
public ShortDate(Date date) {
public ShortDate(final Date date) {
super(date.getTime());
}
/**
* Creates a new ShortDate based on a millisecond time.
*
* @param time Millisecond time to start with.
*/
public ShortDate(long time) {
public ShortDate(final long time) {
super(time);
}
/**
* Returns a duplicate of this object.
*
* @return Duplicate of the object.
*/
@Override
public Object clone() {
return new ShortDate(this.getTime());
return new ShortDate(getTime());
}
}

View file

@ -41,8 +41,8 @@ package org.rometools.feed.module.base.types;
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>
* @version $Revision: 1.2 $
@ -55,43 +55,46 @@ public class Size implements CloneableType {
/**
* length
*/
private FloatUnit length;
private final FloatUnit length;
/**
* width
*/
private FloatUnit width;
private final FloatUnit width;
/**
* Creates a new Size object parsing a string value.
*
* @param source String value to parse
*/
public Size(String source) {
StringTokenizer tok = new StringTokenizer(source, "Xx");
this.length = new FloatUnit( tok.nextToken());
this.width = new FloatUnit( tok.nextToken());
public Size(final String source) {
final StringTokenizer tok = new StringTokenizer(source, "Xx");
length = new FloatUnit(tok.nextToken());
width = new FloatUnit(tok.nextToken());
if (tok.hasMoreTokens()) {
this.height = new FloatUnit( tok.nextToken());
height = new FloatUnit(tok.nextToken());
}
}
/**
* Creates a new instance of Size
*
* @param length lenght value
* @param width width value
*/
public Size(FloatUnit length, FloatUnit width) {
public Size(final FloatUnit length, final FloatUnit width) {
this.length = length;
this.width = width;
}
/**
* Creates a new instance of Size.
*
* @param length Length value.
* @param width Width 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.width = width;
this.height = height;
@ -99,6 +102,7 @@ public class Size implements CloneableType {
/**
* Height value.
*
* @return Height value.
*/
public FloatUnit getHeight() {
@ -107,6 +111,7 @@ public class Size implements CloneableType {
/**
* Length value.
*
* @return Length value.
*/
public FloatUnit getLength() {
@ -115,6 +120,7 @@ public class Size implements CloneableType {
/**
* Width value.
*
* @return Width value.
*/
public FloatUnit getWidth() {
@ -123,20 +129,24 @@ public class Size implements CloneableType {
/**
* Duplicates this object.
*
* @return A duplicate Size object.
*/
@Override
public Object clone() {
if (this.height != null) {
return new Size(this.length, this.width, this.height);
if (height != null) {
return new Size(length, width, height);
} else {
return new Size(this.length, this.width);
return new Size(length, width);
}
}
/**
* Returns a string representation of this object.
*
* @return A string representation of this object.
*/
@Override
public String toString() {
if (height != null) {
return length + "x" + width + "x" + height;
@ -144,11 +154,15 @@ public class Size implements CloneableType {
return length + "x" + width;
}
}
public boolean equals( Object o ){
if( !(o instanceof Size))
@Override
public boolean equals(final Object o) {
if (!(o instanceof Size)) {
return false;
if( this.toString().equals( o.toString() ) )
}
if (toString().equals(o.toString())) {
return true;
}
return false;
}
}

View file

@ -42,8 +42,8 @@ package org.rometools.feed.module.base.types;
import java.util.Calendar;
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>
* @version $Revision: 1.1 $
@ -56,43 +56,52 @@ public class YearType implements CloneableType {
/**
* Creates a new year from a string value.
*
* @param year String to parse.
*/
public YearType(String year) {
public YearType(final String year) {
this.year = Integer.parseInt(year.trim());
}
/**
* Creates a new instance of YearType
*
* @param date Date to get the year from.
*/
public YearType(Date date) {
Calendar cal = Calendar.getInstance();
public YearType(final Date date) {
final Calendar cal = Calendar.getInstance();
cal.setTime(date);
this.year = cal.get( Calendar.YEAR );
year = cal.get(Calendar.YEAR);
}
/**
* Duplicates this object.
*
* @return Cloned Year.
*/
@Override
public Object clone() {
return new YearType(Integer.toString(this.year));
return new YearType(Integer.toString(year));
}
/**
* Returns a String representation of this object.
*
* @return Returns a String representation of this object.
*/
@Override
public String toString() {
return Integer.toString(year);
}
public boolean equals( Object o ){
if( !(o instanceof YearType))
@Override
public boolean equals(final Object o) {
if (!(o instanceof YearType)) {
return false;
if( this.toString().equals( o.toString() ) )
}
if (toString().equals(o.toString())) {
return true;
}
return false;
}
}

View file

@ -40,9 +40,10 @@
package org.rometools.feed.module.cc;
import com.sun.syndication.feed.module.Module;
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>
@ -52,8 +53,10 @@ public interface CreativeCommons extends Module {
public static final String URI = "rome:CreativeCommons";
public License[] getAllLicenses();
public void setAllLicenses(License[] licenses);
public License[] getLicenses();
public void setLicenses(License[] license );
public void setLicenses(License[] license);
}

View file

@ -40,11 +40,13 @@
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.impl.EqualsBean;
import com.sun.syndication.feed.impl.ToStringBean;
import org.rometools.feed.module.cc.types.License;
import java.lang.reflect.Array;
/**
* @version $Revision: 1.1 $
@ -53,20 +55,20 @@ import java.lang.reflect.Array;
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 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/";
private License[] allLicenses;
private License[] licenses;
protected Object arrayCopy(Object[] source) {
if(source == null) {
protected Object arrayCopy(final Object[] source) {
if (source == 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];
}
@ -77,7 +79,7 @@ public class CreativeCommonsImpl implements CreativeCommons {
return allLicenses;
}
public void setAllLicenses(License[] allLicenses) {
public void setAllLicenses(final License[] allLicenses) {
this.allLicenses = allLicenses;
}
@ -85,41 +87,42 @@ public class CreativeCommonsImpl implements CreativeCommons {
return CreativeCommons.class;
}
public String getUri() {
return CreativeCommons.URI;
}
@Override
public Object clone() {
CreativeCommonsImpl clone = new CreativeCommonsImpl();
clone.copyFrom( this );
final CreativeCommonsImpl clone = new CreativeCommonsImpl();
clone.copyFrom(this);
return clone;
}
public void copyFrom(CopyFrom object) {
CreativeCommons source = (CreativeCommons) object;
this.setAllLicenses( (License[]) arrayCopy( source.getAllLicenses() ));
this.setLicenses( source.getLicenses() );
public void copyFrom(final CopyFrom object) {
final CreativeCommons source = (CreativeCommons) object;
setAllLicenses((License[]) arrayCopy(source.getAllLicenses()));
setLicenses(source.getLicenses());
}
public boolean equals(Object obj) {
EqualsBean eBean = new EqualsBean(this.getClass(),this);
@Override
public boolean equals(final Object obj) {
final EqualsBean eBean = new EqualsBean(this.getClass(), this);
return eBean.beanEquals(obj);
}
public License[] getLicenses() {
return licenses;
}
public void setLicenses(License[] licenses) {
public void setLicenses(final License[] licenses) {
this.licenses = licenses;
}
@Override
public String toString() {
ToStringBean tsb = new ToStringBean( CreativeCommonsImpl.class, this );
final ToStringBean tsb = new ToStringBean(CreativeCommonsImpl.class, this);
return tsb.toString();
}
}

View file

@ -40,31 +40,33 @@
package org.rometools.feed.module.cc.io;
import com.sun.syndication.feed.module.Module;
import com.sun.syndication.io.ModuleGenerator;
import java.util.HashSet;
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.CreativeCommonsImpl;
import org.rometools.feed.module.cc.types.License;
import java.util.HashSet;
import java.util.Set;
import org.jdom.Element;
import org.jdom.Namespace;
import com.sun.syndication.feed.module.Module;
import com.sun.syndication.io.ModuleGenerator;
/**
* @version $Revision: 1.1 $
* @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 RSS2 = Namespace.getNamespace( "creativeCommons", CreativeCommonsImpl.RSS2_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 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 HashSet NAMESPACES = new HashSet();
static{
NAMESPACES.add( RSS1 );
NAMESPACES.add( RSS2 );
NAMESPACES.add( RDF );
static {
NAMESPACES.add(RSS1);
NAMESPACES.add(RSS2);
NAMESPACES.add(RDF);
}
/**
@ -74,15 +76,15 @@ public class CCModuleGenerator implements ModuleGenerator{
super();
}
public void generate(Module module, Element element) {
public void generate(final Module module, final Element element) {
Element root = element;
while( root.getParentElement() != null ){
while (root.getParentElement() != null) {
root = root.getParentElement();
}
if( root.getNamespace().equals( RDF )|| root.getNamespace().equals( RSS )){
generateRSS1( (CreativeCommons) module, element);
if (root.getNamespace().equals(RDF) || root.getNamespace().equals(RSS)) {
generateRSS1((CreativeCommons) module, element);
} else {
generateRSS2( (CreativeCommons) module, element);
generateRSS2((CreativeCommons) module, element);
}
}
@ -94,49 +96,49 @@ public class CCModuleGenerator implements ModuleGenerator{
return CreativeCommons.URI;
}
private void generateRSS1( CreativeCommons module, Element element ){
//throw new RuntimeException( "Generating RSS1 Feeds not currently Supported.");
private void generateRSS1(final CreativeCommons module, final Element element) {
// throw new RuntimeException( "Generating RSS1 Feeds not currently Supported.");
System.out.println(element.getName());
if( element.getName().equals("channel")){
if (element.getName().equals("channel")) {
// Do all licenses list.
License[] all = module.getAllLicenses();
for( int i=0; i < all.length ; i++){
Element license = new Element( "License", RSS1 );
license.setAttribute( "about", all[i].getValue(), RDF );
License.Behaviour[] permits = all[i].getPermits();
for( int j=0; permits != null && j < permits.length; j++ ){
Element permit = new Element( "permits", RSS1 );
permit.setAttribute( "resource", permits[j].toString(), RDF);
license.addContent( permit );
final License[] all = module.getAllLicenses();
for (final License element2 : all) {
final Element license = new Element("License", RSS1);
license.setAttribute("about", element2.getValue(), RDF);
final License.Behaviour[] permits = element2.getPermits();
for (int j = 0; permits != null && j < permits.length; j++) {
final Element permit = new Element("permits", RSS1);
permit.setAttribute("resource", permits[j].toString(), RDF);
license.addContent(permit);
}
License.Behaviour[] requires = all[i].getPermits();
for( int j=0; requires != null && j < requires.length; j++ ){
Element permit = new Element( "requires", RSS1 );
permit.setAttribute( "resource", permits[j].toString(), RDF);
license.addContent( permit );
final License.Behaviour[] requires = element2.getPermits();
for (int j = 0; requires != null && j < requires.length; j++) {
final Element permit = new Element("requires", RSS1);
permit.setAttribute("resource", permits[j].toString(), RDF);
license.addContent(permit);
}
System.out.println("Is Root?"+element.getParentElement());
element.getParentElement().addContent( license );
System.out.println("Is Root?" + element.getParentElement());
element.getParentElement().addContent(license);
}
}
//Do local licenses
License[] licenses = module.getLicenses();
for( int i=0; i < licenses.length; i++ ){
Element license = new Element( "license", RSS1 );
license.setAttribute( "resource", licenses[i].getValue(), RDF);
element.addContent( license );
// Do local licenses
final License[] licenses = module.getLicenses();
for (final License license2 : licenses) {
final Element license = new Element("license", RSS1);
license.setAttribute("resource", license2.getValue(), RDF);
element.addContent(license);
}
}
private void generateRSS2( CreativeCommons module, Element element ){
License[] licenses = module.getLicenses();
for( int i=0; licenses != null && i < licenses.length; i++ ){
Element license = new Element( "license", RSS2 );
license.setText( licenses[i].getValue() );
element.addContent( license );
private void generateRSS2(final CreativeCommons module, final Element element) {
final License[] licenses = module.getLicenses();
for (int i = 0; licenses != null && i < licenses.length; i++) {
final Element license = new Element("license", RSS2);
license.setText(licenses[i].getValue());
element.addContent(license);
}
}
}

View file

@ -40,17 +40,17 @@
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.Iterator;
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 $
@ -58,68 +58,70 @@ import org.jdom.Namespace;
*/
public class ModuleParserRSS1 implements ModuleParser {
private static final Namespace NS = Namespace.getNamespace( CreativeCommonsImpl.RSS1_URI );
static final Namespace RDF = Namespace.getNamespace( CreativeCommonsImpl.RDF_URI );
private static final Namespace NS = Namespace.getNamespace(CreativeCommonsImpl.RSS1_URI);
static final Namespace RDF = Namespace.getNamespace(CreativeCommonsImpl.RDF_URI);
/**
* Creates a new instance of ModuleParserRSS1
*/
public ModuleParserRSS1() {
}
public Module parse(Element element) {
CreativeCommonsImpl module = new CreativeCommonsImpl();
public Module parse(final Element element) {
final CreativeCommonsImpl module = new CreativeCommonsImpl();
{
// Parsing Channel level.
Element root =element;
while(root.getParentElement() != null )
Element root = element;
while (root.getParentElement() != null) {
root = root.getParentElement();
List licenseList = root.getChildren( "License", NS );
ArrayList licenses = new ArrayList();
Iterator it = licenseList.iterator();
while( it.hasNext() ){
Element licenseTag = (Element) it.next();
String licenseURI = licenseTag.getAttributeValue("about", RDF);
if( licenseURI == null )
}
final List licenseList = root.getChildren("License", NS);
final ArrayList licenses = new ArrayList();
final Iterator it = licenseList.iterator();
while (it.hasNext()) {
final Element licenseTag = (Element) it.next();
final String licenseURI = licenseTag.getAttributeValue("about", RDF);
if (licenseURI == null) {
continue;
License license = License.findByValue( licenseURI );
}
License license = License.findByValue(licenseURI);
{
ArrayList permitsValues = new ArrayList();
ArrayList requiresValues = new ArrayList();
List permitsTags = licenseTag.getChildren("permits", NS );
final ArrayList permitsValues = new ArrayList();
final ArrayList requiresValues = new ArrayList();
final List permitsTags = licenseTag.getChildren("permits", NS);
Iterator sit = permitsTags.iterator();
while(sit.hasNext() ){
Element permitTag = (Element) sit.next();
permitsValues.add( License.Behaviour.findByValue( permitTag.getAttributeValue( "resource", RDF) ));
while (sit.hasNext()) {
final Element permitTag = (Element) sit.next();
permitsValues.add(License.Behaviour.findByValue(permitTag.getAttributeValue("resource", RDF)));
}
List requiresTags = licenseTag.getChildren( "requires", NS);
final List requiresTags = licenseTag.getChildren("requires", NS);
sit = requiresTags.iterator();
while(sit.hasNext()){
Element requireTag = (Element) sit.next();
requiresValues.add( License.Behaviour.findByValue(requireTag.getAttributeValue("resource", RDF)));
while (sit.hasNext()) {
final Element requireTag = (Element) sit.next();
requiresValues.add(License.Behaviour.findByValue(requireTag.getAttributeValue("resource", RDF)));
}
license = new License( licenseURI,
(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 );
Iterator lit = licenseTags.iterator();
while( lit.hasNext() ){
Element licenseTag = (Element) lit.next();
licenses.add( License.findByValue( licenseTag.getAttributeValue( "resource", RDF)));
final ArrayList licenses = new ArrayList();
final List licenseTags = element.getChildren("license", NS);
final Iterator lit = licenseTags.iterator();
while (lit.hasNext()) {
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 ){
if (module.getLicenses() != null || module.getAllLicenses() != null) {
return module;
} else {
return null;

View file

@ -40,16 +40,17 @@
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.Iterator;
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;
/**
*
@ -58,55 +59,59 @@ import org.jdom.Namespace;
*/
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 */
public ModuleParserRSS2() {
}
public Module parse(Element element) {
CreativeCommonsImpl module = new CreativeCommonsImpl();
//Do channel global
public Module parse(final Element element) {
final CreativeCommonsImpl module = new CreativeCommonsImpl();
// Do channel global
{
Element root = element;
while( !root.getName().equals("channel") && !root.getName().equals("feed") )
while (!root.getName().equals("channel") && !root.getName().equals("feed")) {
root = root.getParentElement();
ArrayList licenses = new ArrayList();
}
final ArrayList licenses = new ArrayList();
List items = null;
if( root.getName().equals("channel"))
if (root.getName().equals("channel")) {
items = root.getChildren("item");
else
} else {
items = root.getChildren("entry");
}
Iterator iit = items.iterator();
while( iit.hasNext() ){
Element item = (Element) iit.next();
List licenseTags = item.getChildren( "license", NS );
Iterator lit = licenseTags.iterator();
while(lit.hasNext() ){
Element licenseTag = (Element) lit.next();
License license = License.findByValue( licenseTag.getTextTrim() );
if( !licenses.contains( license ));
licenses.add( license );
final Iterator iit = items.iterator();
while (iit.hasNext()) {
final Element item = (Element) iit.next();
final List licenseTags = item.getChildren("license", NS);
final Iterator lit = licenseTags.iterator();
while (lit.hasNext()) {
final Element licenseTag = (Element) lit.next();
final License license = License.findByValue(licenseTag.getTextTrim());
if (!licenses.contains(license)) {
;
}
licenses.add(license);
}
}
if( licenses.size() > 0 ){
module.setAllLicenses( (License[]) licenses.toArray( new License[0] ) );
if (licenses.size() > 0) {
module.setAllLicenses((License[]) licenses.toArray(new License[0]));
}
}
// do element local
ArrayList licenses = new ArrayList();
List licenseTags = element.getChildren( "license", NS );
Iterator it = licenseTags.iterator();
while( it.hasNext() ){
Element licenseTag = (Element) it.next();
licenses.add( License.findByValue(licenseTag.getTextTrim() ));
final ArrayList licenses = new ArrayList();
final List licenseTags = element.getChildren("license", NS);
final Iterator it = licenseTags.iterator();
while (it.hasNext()) {
final Element licenseTag = (Element) it.next();
licenses.add(License.findByValue(licenseTag.getTextTrim()));
}
if( licenses.size() > 0 ){
module.setLicenses( (License[]) licenses.toArray( new License[0]));
if (licenses.size() > 0) {
module.setLicenses((License[]) licenses.toArray(new License[0]));
}
if( module.getLicenses() != null && module.getAllLicenses() != null ){
if (module.getLicenses() != null && module.getAllLicenses() != null) {
return module;
} else {
return null;

View file

@ -3,7 +3,7 @@
*
* 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
* License at your discretion.
*
@ -39,12 +39,13 @@
*/
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.Iterator;
import java.util.StringTokenizer;
import com.sun.syndication.feed.impl.EqualsBean;
import com.sun.syndication.feed.impl.ToStringBean;
/**
* @version $Revision: 1.1 $
* @author <a href="mailto:cooper@screaming-penguin.com">Robert "kebernet" Cooper</a>
@ -52,129 +53,112 @@ import java.util.StringTokenizer;
public class License {
private static final String CC_START = "http://creativecommons.org/licenses/";
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[] {
Behaviour.DISTRIBUTION,Behaviour.REPRODUCTION
});
public static final License NO_DERIVS_NONCOMMERCIAL = new License("http://creativecommons.org/licenses/nd-nc/1.0/",new Behaviour[] {
Behaviour.NONCOMMERCIAL
},new Behaviour[] {Behaviour.DISTRIBUTION,Behaviour.REPRODUCTION});
public static final License NONCOMMERCIAL = new License("http://creativecommons.org/licenses/nc/1.0/",new Behaviour[] {
Behaviour.NONCOMMERCIAL
},new Behaviour[] {
Behaviour.DERIVATIVE,Behaviour.DISTRIBUTION,Behaviour.REPRODUCTION
});
public static final License SHARE_ALIKE = new License("http://creativecommons.org/licenses/sa/1.0/",new Behaviour[] {
Behaviour.COPYLEFT
},new Behaviour[] {
Behaviour.DERIVATIVE,Behaviour.DISTRIBUTION,Behaviour.REPRODUCTION
});
public static final License SHARE_ALIKE_NONCOMMERCIAL = new License("http://creativecommons.org/licenses/nc-sa/1.0/",new Behaviour[] {
Behaviour.COPYLEFT,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,Behaviour.ATTRIBUTION
},new Behaviour[] {
Behaviour.DERIVATIVE,Behaviour.DISTRIBUTION,Behaviour.REPRODUCTION
});
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;
public static final License NO_DERIVS = new License("http://creativecommons.org/licenses/nd/1.0/", new Behaviour[0], new Behaviour[] {
Behaviour.DISTRIBUTION, Behaviour.REPRODUCTION });
public static final License NO_DERIVS_NONCOMMERCIAL = new License("http://creativecommons.org/licenses/nd-nc/1.0/",
new Behaviour[] { Behaviour.NONCOMMERCIAL }, new Behaviour[] { Behaviour.DISTRIBUTION, Behaviour.REPRODUCTION });
public static final License NONCOMMERCIAL = new License("http://creativecommons.org/licenses/nc/1.0/", new Behaviour[] { Behaviour.NONCOMMERCIAL },
new Behaviour[] { Behaviour.DERIVATIVE, Behaviour.DISTRIBUTION, Behaviour.REPRODUCTION });
public static final License SHARE_ALIKE = new License("http://creativecommons.org/licenses/sa/1.0/", new Behaviour[] { Behaviour.COPYLEFT },
new Behaviour[] { Behaviour.DERIVATIVE, Behaviour.DISTRIBUTION, Behaviour.REPRODUCTION });
public static final License SHARE_ALIKE_NONCOMMERCIAL = new License("http://creativecommons.org/licenses/nc-sa/1.0/", new Behaviour[] { Behaviour.COPYLEFT,
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,
Behaviour.ATTRIBUTION }, new Behaviour[] { Behaviour.DERIVATIVE, Behaviour.DISTRIBUTION, Behaviour.REPRODUCTION });
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 final String uri;
private final Behaviour[] permits;
private final Behaviour[] requires;
/**
* 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.permits = permits;
this.uri = uri;
License.lookupLicense.put(uri,this);
License.lookupLicense.put(uri, this);
if(this.uri.endsWith("/")) {
//System.out.println(uri.substring(0,this.uri.lastIndexOf("/")));
License.lookupLicense.put(uri.substring(0,this.uri.lastIndexOf("/")),this);
if (this.uri.endsWith("/")) {
// System.out.println(uri.substring(0,this.uri.lastIndexOf("/")));
License.lookupLicense.put(uri.substring(0, this.uri.lastIndexOf("/")), this);
}
}
public static License findByValue(String uri) {
License found = (License)License.lookupLicense.get(uri);
public static License findByValue(final String 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
// current licenses, then make a new one with the same permissions.
if(found == null && uri.startsWith("http://") && uri.toLowerCase().indexOf("creativecommons.org") != -1) {
Iterator it = License.lookupLicense.keySet().iterator();
while(it.hasNext()&&(found == null)) {
try{
String key = (String)it.next();
if(key.startsWith( CC_START ) ){
String licensePath = key.substring( CC_START.length(), key.length() );
StringTokenizer tok = new StringTokenizer( licensePath, "/");
String license = tok.nextToken();
String version = tok.nextToken();
if( uri.toLowerCase().indexOf("creativecommons.org/licenses/"+license) != -1){
License current = (License) lookupLicense.get( key );
found = new License( uri, current.getRequires(), current.getPermits() );
if (found == null && uri.startsWith("http://") && uri.toLowerCase().indexOf("creativecommons.org") != -1) {
final Iterator it = License.lookupLicense.keySet().iterator();
while (it.hasNext() && found == null) {
try {
final String key = (String) it.next();
if (key.startsWith(CC_START)) {
final String licensePath = key.substring(CC_START.length(), key.length());
final StringTokenizer tok = new StringTokenizer(licensePath, "/");
final String license = tok.nextToken();
final String version = tok.nextToken();
if (uri.toLowerCase().indexOf("creativecommons.org/licenses/" + license) != -1) {
final License current = (License) lookupLicense.get(key);
found = new License(uri, current.getRequires(), current.getPermits());
}
}
} catch(Exception e){
} catch (final Exception e) {
e.printStackTrace();
}
}
}
//OK, we got here. If we haven't found a match, return a new License with unknown permissions.
if( found == null ){
found = new License( uri, null, null );
// OK, we got here. If we haven't found a match, return a new License with unknown permissions.
if (found == null) {
found = new License(uri, null, null);
}
return found;
}
public Behaviour[] getPermits() {
return this.permits;
return permits;
}
public Behaviour[] getRequires() {
return this.requires;
return requires;
}
@Override
public String toString() {
ToStringBean tsb = new ToStringBean( License.class, this );
final ToStringBean tsb = new ToStringBean(License.class, this);
return tsb.toString();
}
public String getValue() {
return this.uri;
return uri;
}
public boolean equals(Object obj) {
EqualsBean eBean = new EqualsBean(License.class,this);
@Override
public boolean equals(final Object obj) {
final EqualsBean eBean = new EqualsBean(License.class, this);
return eBean.beanEquals(obj);
}
@Override
public int hashCode() {
EqualsBean equals = new EqualsBean(License.class,this);
final EqualsBean equals = new EqualsBean(License.class, this);
return equals.beanHashCode();
}
public static class Behaviour {
private static final HashMap lookup = new HashMap();
public static final Behaviour REPRODUCTION = new Behaviour("http://web.resource.org/cc/Reproduction");
@ -184,19 +168,20 @@ public class License {
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 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;
Behaviour.lookup.put(uri,this);
Behaviour.lookup.put(uri, this);
}
public static Behaviour findByValue(String uri) {
return (Behaviour)Behaviour.lookup.get(uri);
public static Behaviour findByValue(final String uri) {
return (Behaviour) Behaviour.lookup.get(uri);
}
@Override
public String toString() {
return this.uri;
return uri;
}
}
}

View file

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

View file

@ -40,9 +40,9 @@
*/
package org.rometools.feed.module.content;
import com.sun.syndication.feed.module.Module;
import java.util.List;
import com.sun.syndication.feed.module.Module;
/**
* @version $Revision: 1.1 $
@ -52,14 +52,16 @@ public interface ContentModule extends Module {
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#";
/** 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
*/
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
*/
public void setEncodeds(List encodeds);
@ -68,26 +70,32 @@ public interface ContentModule extends Module {
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
* @return List of ContentItems.
*/
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
* @param List of ContentItems.
*/
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
*/
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
*/
public void setContents(List contents);

View file

@ -43,10 +43,10 @@
*/
package org.rometools.feed.module.content;
import com.sun.syndication.feed.CopyFrom;
import java.util.ArrayList;
import java.util.List;
import com.sun.syndication.feed.CopyFrom;
/**
* @version $Revision: 1.4 $
@ -61,24 +61,24 @@ public class ContentModuleImpl extends com.sun.syndication.feed.module.ModuleImp
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);
}
public List getEncodeds() {
this.encodeds = this.encodeds == null ? new ArrayList() : this.encodeds;
return this.encodeds;
encodeds = encodeds == null ? new ArrayList() : encodeds;
return encodeds;
}
public void setEncodeds(List encodeds) {
public void setEncodeds(final List encodeds) {
this.encodeds = encodeds;
}
public void copyFrom(CopyFrom obj) {
ContentModule cm = (ContentModule) obj;
this.setEncodeds(cm.getEncodeds());
this.setContentItems(cm.getContentItems());
this.setContents(cm.getContents());
public void copyFrom(final CopyFrom obj) {
final ContentModule cm = (ContentModule) obj;
setEncodeds(cm.getEncodeds());
setContentItems(cm.getContentItems());
setContents(cm.getContents());
}
public Class getInterface() {
@ -86,24 +86,24 @@ public class ContentModuleImpl extends com.sun.syndication.feed.module.ModuleImp
}
public List getContentItems() {
this.contentItems = this.contentItems == null ? new ArrayList() : this.contentItems;
return this.contentItems;
contentItems = contentItems == null ? new ArrayList() : contentItems;
return contentItems;
}
public void setContentItems(List list) {
this.contentItems = list;
public void setContentItems(final List list) {
contentItems = list;
}
public List getContents() {
this.contents = this.contents == null ? new ArrayList() : this.contents;
return this.contents;
contents = contents == null ? new ArrayList() : contents;
return contents;
}
public void setContents(List contents) {
public void setContents(final List contents) {
this.contents = contents;
}
public String toString(String str) {
public String toString(final String str) {
return contentItems.toString();
}
}

View file

@ -41,20 +41,20 @@
*/
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.Collections;
import java.util.HashSet;
import java.util.List;
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 $
* @author <a href="mailto:cooper@screaming-penguin.com">Robert "kebernet" Cooper</a>
@ -65,7 +65,7 @@ public class ContentModuleGenerator implements com.sun.syndication.io.ModuleGene
private static final Set NAMESPACES;
static {
Set nss = new HashSet();
final Set nss = new HashSet();
nss.add(CONTENT_NS);
NAMESPACES = Collections.unmodifiableSet(nss);
}
@ -74,11 +74,11 @@ public class ContentModuleGenerator implements com.sun.syndication.io.ModuleGene
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.
Element root = element;
while ((root.getParent() != null) && root.getParent() instanceof Element) {
while (root.getParent() != null && root.getParent() instanceof Element) {
root = (Element) root.getParent();
}
@ -88,9 +88,9 @@ public class ContentModuleGenerator implements com.sun.syndication.io.ModuleGene
return;
}
ContentModule cm = (ContentModule) module;
final ContentModule cm = (ContentModule) module;
List encodeds = cm.getEncodeds();
final List encodeds = cm.getEncodeds();
//
if (encodeds != null) {
@ -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)) {
Element items = new Element("items", CONTENT_NS);
Element bag = new Element("Bag", RDF_NS);
if (contentItems != null && contentItems.size() > 0) {
final Element items = new Element("items", CONTENT_NS);
final Element bag = new Element("Bag", RDF_NS);
items.addContent(bag);
for (int i = 0; i < contentItems.size(); i++) {
ContentItem contentItem = (ContentItem) contentItems.get(i);
Element li = new Element("li", RDF_NS);
Element item = new Element("item", CONTENT_NS);
final ContentItem contentItem = (ContentItem) contentItems.get(i);
final Element li = new Element("li", RDF_NS);
final Element item = new Element("item", CONTENT_NS);
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);
}
if (contentItem.getContentFormat() != null) {
//System.out.println( "Format");
Element format = new Element("format", CONTENT_NS);
Attribute formatResource = new Attribute("resource", contentItem.getContentFormat(), RDF_NS);
// System.out.println( "Format");
final Element format = new Element("format", CONTENT_NS);
final Attribute formatResource = new Attribute("resource", contentItem.getContentFormat(), RDF_NS);
format.setAttribute(formatResource);
item.addContent(format);
}
if (contentItem.getContentEncoding() != null) {
//System.out.println( "Encoding");
Element encoding = new Element("encoding", CONTENT_NS);
Attribute encodingResource = new Attribute("resource", contentItem.getContentEncoding(), RDF_NS);
// System.out.println( "Encoding");
final Element encoding = new Element("encoding", CONTENT_NS);
final Attribute encodingResource = new Attribute("resource", contentItem.getContentEncoding(), RDF_NS);
encoding.setAttribute(encodingResource);
item.addContent(encoding);
}
if (contentItem.getContentValue() != null) {
Element value = new Element("value", RDF_NS);
final Element value = new Element("value", RDF_NS);
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);
}
if (contentItem.getContentValueNamespaces() != null) {
List namespaces = contentItem.getContentValueNamespaces();
final List namespaces = contentItem.getContentValueNamespaces();
for (int ni = 0; ni < namespaces.size(); ni++) {
value.addNamespaceDeclaration((Namespace) namespaces.get(ni));
}
}
List detached = new ArrayList();
final List detached = new ArrayList();
for (int c = 0;
c < contentItem.getContentValueDOM().size(); c++) {
detached.add(((Content) ((Content) contentItem.getContentValueDOM().get(c)).clone()).detach());
for (int c = 0; c < contentItem.getContentValueDOM().size(); c++) {
detached.add(((Content) contentItem.getContentValueDOM().get(c)).clone().detach());
}
value.setContent(detached);
@ -163,22 +162,22 @@ public class ContentModuleGenerator implements com.sun.syndication.io.ModuleGene
li.addContent(item);
bag.addContent(li);
} //end contentItems loop
} // end contentItems loop
element.addContent(items);
}
}
protected Element generateSimpleElement(String name, String value) {
Element element = new Element(name, CONTENT_NS);
protected Element generateSimpleElement(final String name, final String value) {
final Element element = new Element(name, CONTENT_NS);
element.addContent(value);
return element;
}
protected Element generateCDATAElement(String name, String value) {
Element element = new Element(name, CONTENT_NS);
CDATA cdata = new CDATA(value);
protected Element generateCDATAElement(final String name, final String value) {
final Element element = new Element(name, CONTENT_NS);
final CDATA cdata = new CDATA(value);
element.addContent(cdata);
return element;

View file

@ -43,17 +43,17 @@
*/
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.ContentModule;
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 $
* @author <a href="mailto:cooper@screaming-penguin.com">Robert "kebernet" Cooper</a>
@ -70,45 +70,45 @@ public class ContentModuleParser implements com.sun.syndication.io.ModuleParser
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;
ContentModule cm = new ContentModuleImpl();
List encodeds = element.getChildren("encoded", CONTENT_NS);
ArrayList contentStrings = new ArrayList();
ArrayList encodedStrings = new ArrayList();
final ContentModule cm = new ContentModuleImpl();
final List encodeds = element.getChildren("encoded", CONTENT_NS);
final ArrayList contentStrings = new ArrayList();
final ArrayList encodedStrings = new ArrayList();
if (encodeds.size() > 0) {
foundSomething = true;
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());
contentStrings.add(encodedElement.getText());
}
}
ArrayList contentItems = new ArrayList();
List items = element.getChildren("items", CONTENT_NS);
final ArrayList contentItems = new ArrayList();
final List items = element.getChildren("items", CONTENT_NS);
for (int i = 0; i < items.size(); i++) {
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++) {
ContentItem ci = new ContentItem();
Element li = (Element) lis.get(j);
Element item = li.getChild("item", CONTENT_NS);
Element format = item.getChild("format", CONTENT_NS);
Element encoding = item.getChild("encoding", CONTENT_NS);
Element value = item.getChild("value", RDF_NS);
final ContentItem ci = new ContentItem();
final Element li = (Element) lis.get(j);
final Element item = li.getChild("item", CONTENT_NS);
final Element format = item.getChild("format", CONTENT_NS);
final Element encoding = item.getChild("encoding", CONTENT_NS);
final Element value = item.getChild("value", RDF_NS);
if (value != null) {
if (value.getAttributeValue("parseType", RDF_NS) != null) {
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));
contentStrings.add(getXmlInnerText(value));
ci.setContentValueNamespaces(value.getAdditionalNamespaces());
@ -117,7 +117,7 @@ public class ContentModuleParser implements com.sun.syndication.io.ModuleParser
contentStrings.add(value.getText());
}
ci.setContentValueDOM(((Element) value.clone()).getContent());
ci.setContentValueDOM(value.clone().getContent());
}
if (format != null) {
@ -129,7 +129,7 @@ public class ContentModuleParser implements com.sun.syndication.io.ModuleParser
}
if (item != null) {
Attribute about = item.getAttribute("about", RDF_NS);
final Attribute about = item.getAttribute("about", RDF_NS);
if (about != null) {
ci.setContentAbout(about.getValue());
@ -144,13 +144,13 @@ public class ContentModuleParser implements com.sun.syndication.io.ModuleParser
cm.setContentItems(contentItems);
cm.setContents(contentStrings);
return (foundSomething) ? cm : null;
return foundSomething ? cm : null;
}
protected String getXmlInnerText(Element e) {
StringBuffer sb = new StringBuffer();
XMLOutputter xo = new XMLOutputter();
List children = e.getContent();
protected String getXmlInnerText(final Element e) {
final StringBuffer sb = new StringBuffer();
final XMLOutputter xo = new XMLOutputter();
final List children = e.getContent();
sb.append(xo.outputString(children));
return sb.toString();

View file

@ -38,7 +38,7 @@ public class FeedBurnerImpl implements FeedBurner {
return awareness;
}
public void setAwareness(String awareness) {
public void setAwareness(final String awareness) {
this.awareness = awareness;
}
@ -46,7 +46,7 @@ public class FeedBurnerImpl implements FeedBurner {
return origLink;
}
public void setOrigLink(String origLink) {
public void setOrigLink(final String origLink) {
this.origLink = origLink;
}
@ -54,7 +54,7 @@ public class FeedBurnerImpl implements FeedBurner {
return origEnclosureLink;
}
public void setOrigEnclosureLink(String origEnclosureLink) {
public void setOrigEnclosureLink(final String origEnclosureLink) {
this.origEnclosureLink = origEnclosureLink;
}
@ -62,20 +62,21 @@ public class FeedBurnerImpl implements FeedBurner {
return FeedBurner.URI;
}
public void copyFrom(CopyFrom object) {
FeedBurner source = (FeedBurner) object;
this.setAwareness(source.getAwareness());
this.setOrigLink(source.getOrigLink());
this.setOrigEnclosureLink(source.getOrigEnclosureLink());
public void copyFrom(final CopyFrom object) {
final FeedBurner source = (FeedBurner) object;
setAwareness(source.getAwareness());
setOrigLink(source.getOrigLink());
setOrigEnclosureLink(source.getOrigEnclosureLink());
}
public Class getInterface() {
return FeedBurner.class;
}
@Override
public Object clone() {
FeedBurnerImpl fbi = new FeedBurnerImpl();
fbi.copyFrom( this );
final FeedBurnerImpl fbi = new FeedBurnerImpl();
fbi.copyFrom(this);
return fbi;
}
}

View file

@ -16,17 +16,15 @@
*/
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.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.
@ -43,34 +41,34 @@ public class FeedBurnerModuleGenerator implements ModuleGenerator {
}
public Set getNamespaces() {
HashSet set = new HashSet();
final HashSet set = new HashSet();
set.add(FeedBurnerModuleGenerator.NS);
return set;
}
public void generate(Module module, Element element) {
public void generate(final Module module, final Element element) {
if (!(module instanceof FeedBurner)) {
return;
}
FeedBurner feedBurner = (FeedBurner) module;
final FeedBurner feedBurner = (FeedBurner) module;
if (feedBurner.getAwareness() != null) {
element.addContent(this.generateSimpleElement("awareness", feedBurner.getAwareness()));
element.addContent(generateSimpleElement("awareness", feedBurner.getAwareness()));
}
if (feedBurner.getOrigLink() != null) {
element.addContent(this.generateSimpleElement("origLink", feedBurner.getOrigLink()));
element.addContent(generateSimpleElement("origLink", feedBurner.getOrigLink()));
}
if (feedBurner.getOrigEnclosureLink() != null) {
element.addContent(this.generateSimpleElement("origEnclosureLink", feedBurner.getOrigEnclosureLink()));
element.addContent(generateSimpleElement("origEnclosureLink", feedBurner.getOrigEnclosureLink()));
}
}
protected Element generateSimpleElement(String name, String value) {
Element element = new Element(name, FeedBurnerModuleGenerator.NS);
protected Element generateSimpleElement(final String name, final String value) {
final Element element = new Element(name, FeedBurnerModuleGenerator.NS);
element.addContent(value);
return element;

View file

@ -16,15 +16,13 @@
*/
package org.rometools.feed.module.feedburner.io;
import com.sun.syndication.feed.module.Module;
import com.sun.syndication.io.ModuleParser;
import org.jdom.Element;
import org.jdom.Namespace;
import org.jdom2.Element;
import org.jdom2.Namespace;
import org.rometools.feed.module.feedburner.FeedBurner;
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.
@ -40,8 +38,8 @@ public class FeedBurnerModuleParser implements ModuleParser {
return FeedBurner.URI;
}
public Module parse(Element element) {
FeedBurnerImpl fbi = new FeedBurnerImpl();
public Module parse(final Element element) {
final FeedBurnerImpl fbi = new FeedBurnerImpl();
boolean returnObj = false;
Element tag = element.getChild("awareness", FeedBurnerModuleParser.NS);

View file

@ -16,15 +16,26 @@
*/
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.io.ModuleGenerator;
import org.rometools.feed.module.georss.geometries.*;
/**
* GMLGenerator produces georss elements in georss GML format.
*
@ -37,16 +48,17 @@ public class GMLGenerator implements ModuleGenerator {
private static final Set NAMESPACES;
static {
Set nss = new HashSet();
final Set nss = new HashSet();
nss.add(GeoRSSModule.GML_NS);
NAMESPACES = Collections.unmodifiableSet(nss);
}
private Element createPosListElement(PositionList posList) {
Element posElement = new Element("posList", GeoRSSModule.GML_NS);
StringBuffer sb = new StringBuffer();
for (int i=0; i<posList.size(); ++i)
private Element createPosListElement(final PositionList posList) {
final Element posElement = new Element("posList", GeoRSSModule.GML_NS);
final StringBuffer sb = new StringBuffer();
for (int i = 0; i < posList.size(); ++i) {
sb.append(posList.getLatitude(i)).append(" ").append(posList.getLongitude(i)).append(" ");
}
posElement.addContent(sb.toString());
return posElement;
@ -73,10 +85,9 @@ public class GMLGenerator implements ModuleGenerator {
/*
* (non-Javadoc)
*
* @see com.sun.syndication.io.ModuleGenerator#generate(com.sun.syndication.feed.module.Module,
* org.jdom.Element)
* @see com.sun.syndication.io.ModuleGenerator#generate(com.sun.syndication.feed.module.Module, org.jdom2.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
// in every item.
Element root = element;
@ -86,38 +97,37 @@ public class GMLGenerator implements ModuleGenerator {
root.addNamespaceDeclaration(GeoRSSModule.SIMPLE_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);
GeoRSSModule geoRSSModule = (GeoRSSModule) module;
AbstractGeometry geometry = geoRSSModule.getGeometry();
final GeoRSSModule geoRSSModule = (GeoRSSModule) module;
final AbstractGeometry geometry = geoRSSModule.getGeometry();
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);
Element posElement = new Element("pos", GeoRSSModule.GML_NS);
posElement.addContent(String.valueOf(pos.getLatitude()) + " "
+ String.valueOf(pos.getLongitude()));
final Element posElement = new Element("pos", GeoRSSModule.GML_NS);
posElement.addContent(String.valueOf(pos.getLatitude()) + " " + String.valueOf(pos.getLongitude()));
pointElement.addContent(posElement);
}
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));
whereElement.addContent(lineElement);
} 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) {
Element exteriorElement = new Element("exterior", GeoRSSModule.GML_NS);
final Element exteriorElement = new Element("exterior", GeoRSSModule.GML_NS);
polygonElement.addContent(exteriorElement);
Element ringElement = new Element("LinearRing", GeoRSSModule.GML_NS);
final Element ringElement = new Element("LinearRing", GeoRSSModule.GML_NS);
exteriorElement.addContent(ringElement);
ringElement.addContent(createPosListElement(((LinearRing) ring).getPositionList()));
@ -125,14 +135,14 @@ public class GMLGenerator implements ModuleGenerator {
System.err.println("GeoRSS GML format can't handle rings of type: " + ring.getClass().getName());
}
}
List interiorList = ((Polygon) geometry).getInterior();
Iterator it = interiorList.iterator();
final List interiorList = ((Polygon) geometry).getInterior();
final Iterator it = interiorList.iterator();
while (it.hasNext()) {
AbstractRing ring = (AbstractRing)it.next();
final AbstractRing ring = (AbstractRing) it.next();
if (ring instanceof LinearRing) {
Element interiorElement = new Element("interior", GeoRSSModule.GML_NS);
final Element interiorElement = new Element("interior", GeoRSSModule.GML_NS);
polygonElement.addContent(interiorElement);
Element ringElement = new Element("LinearRing", GeoRSSModule.GML_NS);
final Element ringElement = new Element("LinearRing", GeoRSSModule.GML_NS);
interiorElement.addContent(ringElement);
ringElement.addContent(createPosListElement(((LinearRing) ring).getPositionList()));
@ -142,18 +152,16 @@ public class GMLGenerator implements ModuleGenerator {
}
whereElement.addContent(polygonElement);
} else if (geometry instanceof Envelope) {
Envelope envelope = (Envelope)geometry;
Element envelopeElement = new Element("Envelope", GeoRSSModule.GML_NS);
final Envelope envelope = (Envelope) geometry;
final Element envelopeElement = new Element("Envelope", GeoRSSModule.GML_NS);
whereElement.addContent(envelopeElement);
Element lowerElement = new Element("lowerCorner", GeoRSSModule.GML_NS);
lowerElement.addContent(String.valueOf(envelope.getMinLatitude()) + " "
+ String.valueOf(envelope.getMinLongitude()));
final Element lowerElement = new Element("lowerCorner", GeoRSSModule.GML_NS);
lowerElement.addContent(String.valueOf(envelope.getMinLatitude()) + " " + String.valueOf(envelope.getMinLongitude()));
envelopeElement.addContent(lowerElement);
Element upperElement = new Element("upperCorner", GeoRSSModule.GML_NS);
upperElement.addContent(String.valueOf(envelope.getMaxLatitude()) + " "
+ String.valueOf(envelope.getMaxLongitude()));
final Element upperElement = new Element("upperCorner", GeoRSSModule.GML_NS);
upperElement.addContent(String.valueOf(envelope.getMaxLatitude()) + " " + String.valueOf(envelope.getMaxLongitude()));
envelopeElement.addContent(upperElement);
} else {

View file

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

View file

@ -16,19 +16,20 @@
*/
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.LinearRing;
import org.rometools.feed.module.georss.geometries.Point;
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.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.
@ -51,45 +52,41 @@ public class GMLParser implements ModuleParser {
/*
* (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) {
Module geoRssModule = parseGML(element);
public Module parse(final Element element) {
final Module geoRssModule = parseGML(element);
return geoRssModule;
}
private static PositionList parsePosList(Element element) {
String coordinates = element.getText();
String[] coord = GeoRSSUtils.trimWhitespace(coordinates).split(" ");
PositionList posList = new PositionList();
for (int i=0; i<coord.length; i += 2) {
posList.add(Double.parseDouble(coord[i]), Double.parseDouble(coord[i+1]));
private static PositionList parsePosList(final Element element) {
final String coordinates = element.getText();
final String[] coord = GeoRSSUtils.trimWhitespace(coordinates).split(" ");
final PositionList posList = new PositionList();
for (int i = 0; i < coord.length; i += 2) {
posList.add(Double.parseDouble(coord[i]), Double.parseDouble(coord[i + 1]));
}
return posList;
}
static Module parseGML(Element element) {
static Module parseGML(final Element element) {
GeoRSSModule geoRSSModule = null;
Element pointElement = element.getChild("Point",
GeoRSSModule.GML_NS);
Element lineStringElement = element.getChild("LineString",
GeoRSSModule.GML_NS);
Element polygonElement = element.getChild("Polygon",
GeoRSSModule.GML_NS);
Element envelopeElement = element.getChild("Envelope",
GeoRSSModule.GML_NS);
final Element pointElement = element.getChild("Point", GeoRSSModule.GML_NS);
final Element lineStringElement = element.getChild("LineString", GeoRSSModule.GML_NS);
final Element polygonElement = element.getChild("Polygon", GeoRSSModule.GML_NS);
final Element envelopeElement = element.getChild("Envelope", GeoRSSModule.GML_NS);
if (pointElement != null) {
Element posElement = pointElement.getChild("pos", GeoRSSModule.GML_NS);
final Element posElement = pointElement.getChild("pos", GeoRSSModule.GML_NS);
if (posElement != null) {
geoRSSModule = new GMLModuleImpl();
String coordinates = posElement.getText();
String[] coord = GeoRSSUtils.trimWhitespace(coordinates).split(" ");
Position pos = new Position(Double.parseDouble(coord[0]), Double.parseDouble(coord[1]));
final String coordinates = posElement.getText();
final String[] coord = GeoRSSUtils.trimWhitespace(coordinates).split(" ");
final Position pos = new Position(Double.parseDouble(coord[0]), Double.parseDouble(coord[1]));
geoRSSModule.setGeometry(new Point(pos));
}
} else if (lineStringElement != null) {
Element posListElement = lineStringElement.getChild("posList", GeoRSSModule.GML_NS);
final Element posListElement = lineStringElement.getChild("posList", GeoRSSModule.GML_NS);
if (posListElement != null) {
geoRSSModule = new GMLModuleImpl();
geoRSSModule.setGeometry(new LineString(parsePosList(posListElement)));
@ -98,31 +95,33 @@ public class GMLParser implements ModuleParser {
Polygon poly = null;
// The external ring
Element exteriorElement = polygonElement.getChild("exterior", GeoRSSModule.GML_NS);
final Element exteriorElement = polygonElement.getChild("exterior", GeoRSSModule.GML_NS);
if (exteriorElement != null) {
Element linearRingElement = exteriorElement.getChild("LinearRing", GeoRSSModule.GML_NS);
final Element linearRingElement = exteriorElement.getChild("LinearRing", GeoRSSModule.GML_NS);
if (linearRingElement != null) {
Element posListElement = linearRingElement.getChild("posList", GeoRSSModule.GML_NS);
final Element posListElement = linearRingElement.getChild("posList", GeoRSSModule.GML_NS);
if (posListElement != null) {
if (poly == null)
if (poly == null) {
poly = new Polygon();
}
poly.setExterior(new LinearRing(parsePosList(posListElement)));
}
}
}
// The internal rings (holes)
List interiorElementList = polygonElement.getChildren("interior", GeoRSSModule.GML_NS);
Iterator it = interiorElementList.iterator();
final List interiorElementList = polygonElement.getChildren("interior", GeoRSSModule.GML_NS);
final Iterator it = interiorElementList.iterator();
while (it.hasNext()) {
Element interiorElement = (Element)it.next();
final Element interiorElement = (Element) it.next();
if (interiorElement != null) {
Element linearRingElement = interiorElement.getChild("LinearRing", GeoRSSModule.GML_NS);
final Element linearRingElement = interiorElement.getChild("LinearRing", GeoRSSModule.GML_NS);
if (linearRingElement != null) {
Element posListElement = linearRingElement.getChild("posList", GeoRSSModule.GML_NS);
final Element posListElement = linearRingElement.getChild("posList", GeoRSSModule.GML_NS);
if (posListElement != null) {
if (poly == null)
if (poly == null) {
poly = new Polygon();
}
poly.getInterior().add(new LinearRing(parsePosList(posListElement)));
}
}
@ -135,16 +134,16 @@ public class GMLParser implements ModuleParser {
geoRSSModule.setGeometry(poly);
}
} else if (envelopeElement != null) {
Element lowerElement = envelopeElement.getChild("lowerCorner", GeoRSSModule.GML_NS);
Element upperElement = envelopeElement.getChild("upperCorner", GeoRSSModule.GML_NS);
final Element lowerElement = envelopeElement.getChild("lowerCorner", GeoRSSModule.GML_NS);
final Element upperElement = envelopeElement.getChild("upperCorner", GeoRSSModule.GML_NS);
if (lowerElement != null && upperElement != null) {
geoRSSModule = new GMLModuleImpl();
String lowerCoordinates = lowerElement.getText();
String[] lowerCoord = GeoRSSUtils.trimWhitespace(lowerCoordinates).split(" ");
String upperCoordinates = upperElement.getText();
String[] upperCoord = GeoRSSUtils.trimWhitespace(upperCoordinates).split(" ");
Envelope envelope = new Envelope(Double.parseDouble(lowerCoord[0]), Double.parseDouble(lowerCoord[1]),
Double.parseDouble(upperCoord[0]), Double.parseDouble(upperCoord[1]));
final String lowerCoordinates = lowerElement.getText();
final String[] lowerCoord = GeoRSSUtils.trimWhitespace(lowerCoordinates).split(" ");
final String upperCoordinates = upperElement.getText();
final String[] upperCoord = GeoRSSUtils.trimWhitespace(upperCoordinates).split(" ");
final Envelope envelope = new Envelope(Double.parseDouble(lowerCoord[0]), Double.parseDouble(lowerCoord[1]), Double.parseDouble(upperCoord[0]),
Double.parseDouble(upperCoord[1]));
geoRSSModule.setGeometry(envelope);
}
}

View file

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

View file

@ -33,10 +33,9 @@ public class GeoRSSPoint implements Cloneable {
}
/**
* @param latitude
* the latitude to set
* @param latitude the latitude to set
*/
public void setLatitude(double latitude) {
public void setLatitude(final double latitude) {
this.latitude = latitude;
}
@ -48,13 +47,13 @@ public class GeoRSSPoint implements Cloneable {
}
/**
* @param longitude
* the longitude to set
* @param longitude the longitude to set
*/
public void setLongitude(double longitude) {
public void setLongitude(final double longitude) {
this.longitude = longitude;
}
@Override
public Object clone() throws CloneNotSupportedException {
return super.clone();
}

View file

@ -28,20 +28,22 @@ import com.sun.syndication.feed.synd.SyndFeed;
*/
public class GeoRSSUtils {
static String trimWhitespace(String in) {
StringBuffer strbuf = new StringBuffer();
static String trimWhitespace(final String in) {
final StringBuffer strbuf = new StringBuffer();
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;
for (; i< in.length(); ++i) {
char ch=in.charAt(i);
if (Character.isWhitespace(ch))
for (; i < in.length(); ++i) {
final char ch = in.charAt(i);
if (Character.isWhitespace(ch)) {
wasWhite = true;
else {
if (wasWhite)
} else {
if (wasWhite) {
strbuf.append(' ');
}
strbuf.append(ch);
wasWhite = false;
}
@ -51,80 +53,63 @@ public class GeoRSSUtils {
}
/**
* This convenience method checks whether there is any geoRss Element and
* will return it (georss simple or W3GGeo).
* This convenience method checks whether there is any geoRss Element and 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
*/
public static GeoRSSModule getGeoRSS(SyndEntry entry) {
GeoRSSModule simple = (GeoRSSModule) entry
.getModule(GeoRSSModule.GEORSS_GEORSS_URI);
GeoRSSModule w3cGeo = (GeoRSSModule) entry
.getModule(GeoRSSModule.GEORSS_W3CGEO_URI);
GeoRSSModule gml = (GeoRSSModule) entry
.getModule(GeoRSSModule.GEORSS_GML_URI);
if (gml != null)
public static GeoRSSModule getGeoRSS(final SyndEntry entry) {
final GeoRSSModule simple = (GeoRSSModule) entry.getModule(GeoRSSModule.GEORSS_GEORSS_URI);
final GeoRSSModule w3cGeo = (GeoRSSModule) entry.getModule(GeoRSSModule.GEORSS_W3CGEO_URI);
final GeoRSSModule gml = (GeoRSSModule) entry.getModule(GeoRSSModule.GEORSS_GML_URI);
if (gml != null) {
return gml;
if (simple != null)
}
if (simple != null) {
return simple;
if (w3cGeo != null)
}
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;
*/
}
/**
* 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;
/*
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");
}
* 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;
*/
}
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(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 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.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.io.ModuleGenerator;
import org.rometools.feed.module.georss.geometries.*;
/**
* SimpleGenerator produces georss elements in georss simple format.
@ -37,19 +45,19 @@ public class SimpleGenerator implements ModuleGenerator {
private static final Set NAMESPACES;
static {
Set nss = new HashSet();
final Set nss = new HashSet();
nss.add(GeoRSSModule.SIMPLE_NS);
NAMESPACES = Collections.unmodifiableSet(nss);
}
private String posListToString(PositionList posList) {
StringBuffer sb = new StringBuffer();
for (int i=0; i<posList.size(); ++i)
private String posListToString(final PositionList posList) {
final StringBuffer sb = new StringBuffer();
for (int i = 0; i < posList.size(); ++i) {
sb.append(posList.getLatitude(i)).append(" ").append(posList.getLongitude(i)).append(" ");
}
return sb.toString();
}
/*
* (non-Javadoc)
*
@ -71,10 +79,9 @@ public class SimpleGenerator implements ModuleGenerator {
/*
* (non-Javadoc)
*
* @see com.sun.syndication.io.ModuleGenerator#generate(com.sun.syndication.feed.module.Module,
* org.jdom.Element)
* @see com.sun.syndication.io.ModuleGenerator#generate(com.sun.syndication.feed.module.Module, org.jdom2.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
// in every item.
Element root = element;
@ -83,49 +90,43 @@ public class SimpleGenerator implements ModuleGenerator {
}
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) {
Position pos = ((Point) geometry).getPosition();
final Position pos = ((Point) geometry).getPosition();
Element pointElement = new Element("point", GeoRSSModule.SIMPLE_NS);
pointElement.addContent(pos.getLatitude() + " "
+ pos.getLongitude());
final Element pointElement = new Element("point", GeoRSSModule.SIMPLE_NS);
pointElement.addContent(pos.getLatitude() + " " + pos.getLongitude());
element.addContent(pointElement);
}
else if (geometry instanceof LineString) {
PositionList posList = ((LineString) geometry).getPositionList();
} else if (geometry instanceof LineString) {
final PositionList posList = ((LineString) geometry).getPositionList();
Element lineElement = new Element("line", GeoRSSModule.SIMPLE_NS);
final Element lineElement = new Element("line", GeoRSSModule.SIMPLE_NS);
lineElement.addContent(posListToString(posList));
element.addContent(lineElement);
}
else if (geometry instanceof Polygon) {
AbstractRing ring = ((Polygon) geometry).getExterior();
} else if (geometry instanceof Polygon) {
final AbstractRing ring = ((Polygon) geometry).getExterior();
if (ring instanceof LinearRing) {
PositionList posList = ((LinearRing) ring).getPositionList();
Element polygonElement = new Element("polygon", GeoRSSModule.SIMPLE_NS);
final PositionList posList = ((LinearRing) ring).getPositionList();
final Element polygonElement = new Element("polygon", GeoRSSModule.SIMPLE_NS);
polygonElement.addContent(posListToString(posList));
element.addContent(polygonElement);
}
else {
} else {
System.err.println("GeoRSS simple format can't handle rings of type: " + ring.getClass().getName());
}
if (((Polygon) geometry).getInterior() != null || !((Polygon) geometry).getInterior().isEmpty()) {
System.err.println("GeoRSS simple format can't handle interior rings (ignored)");
}
}
else if (geometry instanceof Envelope) {
Envelope envelope = (Envelope)geometry;
Element boxElement = new Element("box", GeoRSSModule.SIMPLE_NS);
boxElement.addContent(envelope.getMinLatitude() + " " + envelope.getMinLongitude() + " " +
envelope.getMaxLatitude() + " " + envelope.getMaxLongitude());
} else if (geometry instanceof Envelope) {
final Envelope envelope = (Envelope) geometry;
final Element boxElement = new Element("box", GeoRSSModule.SIMPLE_NS);
boxElement.addContent(envelope.getMinLatitude() + " " + envelope.getMinLongitude() + " " + envelope.getMaxLatitude() + " "
+ envelope.getMaxLongitude());
element.addContent(boxElement);
}
else {
} else {
System.err.println("GeoRSS simple format can't handle geometries of type: " + geometry.getClass().getName());
}
}

View file

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

View file

@ -16,12 +16,17 @@
*/
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 org.rometools.feed.module.georss.GMLParser;
import com.sun.syndication.io.ModuleParser;
import org.rometools.feed.module.georss.geometries.*;
/**
* SimpleParser is a parser for the GeoRSS Simple format.
@ -41,63 +46,59 @@ public class SimpleParser implements ModuleParser {
return GeoRSSModule.GEORSS_GEORSS_URI;
}
private static PositionList parsePosList(Element element) {
String coordinates = element.getText();
String[] coord = GeoRSSUtils.trimWhitespace(coordinates).split(" ");
PositionList posList = new PositionList();
for (int i=0; i<coord.length; i += 2) {
posList.add(Double.parseDouble(coord[i]), Double.parseDouble(coord[i+1]));
private static PositionList parsePosList(final Element element) {
final String coordinates = element.getText();
final String[] coord = GeoRSSUtils.trimWhitespace(coordinates).split(" ");
final PositionList posList = new PositionList();
for (int i = 0; i < coord.length; i += 2) {
posList.add(Double.parseDouble(coord[i]), Double.parseDouble(coord[i + 1]));
}
return posList;
}
/*
* (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) {
Module geoRssModule = parseSimple(element);
public Module parse(final Element element) {
final Module geoRssModule = parseSimple(element);
return geoRssModule;
}
static Module parseSimple(Element element) {
static Module parseSimple(final Element element) {
GeoRSSModule geoRSSModule = null;
Element pointElement = element.getChild("point",
GeoRSSModule.SIMPLE_NS);
Element lineElement = element.getChild("line",
GeoRSSModule.SIMPLE_NS);
Element polygonElement = element.getChild("polygon",
GeoRSSModule.SIMPLE_NS);
Element boxElement = element.getChild("box",
GeoRSSModule.SIMPLE_NS);
Element whereElement = element
.getChild("where", GeoRSSModule.SIMPLE_NS);
final Element pointElement = element.getChild("point", GeoRSSModule.SIMPLE_NS);
final Element lineElement = element.getChild("line", GeoRSSModule.SIMPLE_NS);
final Element polygonElement = element.getChild("polygon", GeoRSSModule.SIMPLE_NS);
final Element boxElement = element.getChild("box", GeoRSSModule.SIMPLE_NS);
final Element whereElement = element.getChild("where", GeoRSSModule.SIMPLE_NS);
if (pointElement != null) {
geoRSSModule = new SimpleModuleImpl();
String coordinates = pointElement.getText();
String[] coord = GeoRSSUtils.trimWhitespace(coordinates).split(" ");
Position pos = new Position(Double.parseDouble(coord[0]), Double.parseDouble(coord[1]));
final String coordinates = pointElement.getText();
final String[] coord = GeoRSSUtils.trimWhitespace(coordinates).split(" ");
final Position pos = new Position(Double.parseDouble(coord[0]), Double.parseDouble(coord[1]));
geoRSSModule.setGeometry(new Point(pos));
} else if (lineElement != null) {
geoRSSModule = new SimpleModuleImpl();
PositionList posList = parsePosList(lineElement);
final PositionList posList = parsePosList(lineElement);
geoRSSModule.setGeometry(new LineString(posList));
} else if (polygonElement != null) {
geoRSSModule = new SimpleModuleImpl();
PositionList posList = parsePosList(polygonElement);
Polygon poly = new Polygon();
final PositionList posList = parsePosList(polygonElement);
final Polygon poly = new Polygon();
poly.setExterior(new LinearRing(posList));
geoRSSModule.setGeometry(poly);
} else if (boxElement != null) {
geoRSSModule = new SimpleModuleImpl();
String coordinates = boxElement.getText();
String[] coord = GeoRSSUtils.trimWhitespace(coordinates).split(" ");
Envelope envelope = new Envelope(Double.parseDouble(coord[0]), Double.parseDouble(coord[1]),
Double.parseDouble(coord[2]), Double.parseDouble(coord[3]));
final String coordinates = boxElement.getText();
final String[] coord = GeoRSSUtils.trimWhitespace(coordinates).split(" ");
final Envelope envelope = new Envelope(Double.parseDouble(coord[0]), Double.parseDouble(coord[1]), Double.parseDouble(coord[2]),
Double.parseDouble(coord[3]));
geoRSSModule.setGeometry(envelope);
} else if (whereElement != null) {
geoRSSModule = (GeoRSSModule)GMLParser.parseGML(whereElement);
geoRSSModule = (GeoRSSModule) GMLParser.parseGML(whereElement);
}
return geoRSSModule;

View file

@ -20,11 +20,13 @@ import java.util.Collections;
import java.util.HashSet;
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.io.ModuleGenerator;
import org.rometools.feed.module.georss.geometries.*;
/**
* W3CGeoGenerator produces georss elements in georss W3C geo format.
@ -40,12 +42,12 @@ public class W3CGeoGenerator implements ModuleGenerator {
private static final Set NAMESPACES;
static {
Set nss = new HashSet();
final Set nss = new HashSet();
nss.add(GeoRSSModule.W3CGEO_NS);
NAMESPACES = Collections.unmodifiableSet(nss);
}
public static void enableDefaultPointElement(){
public static void enableDefaultPointElement() {
isShort = false;
}
@ -70,10 +72,9 @@ public class W3CGeoGenerator implements ModuleGenerator {
/*
* (non-Javadoc)
*
* @see com.sun.syndication.io.ModuleGenerator#generate(com.sun.syndication.feed.module.Module,
* org.jdom.Element)
* @see com.sun.syndication.io.ModuleGenerator#generate(com.sun.syndication.feed.module.Module, org.jdom2.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
// in every item.
Element root = element;
@ -88,20 +89,19 @@ public class W3CGeoGenerator implements ModuleGenerator {
element.addContent(pointElement);
}
GeoRSSModule geoRSSModule = (GeoRSSModule) module;
AbstractGeometry geometry = geoRSSModule.getGeometry();
final GeoRSSModule geoRSSModule = (GeoRSSModule) module;
final AbstractGeometry geometry = geoRSSModule.getGeometry();
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()));
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()));
pointElement.addContent(lngElement);
}
else {
} else {
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;
/**
* W3CGeoModuleImpl is the implementation of the {@link GeoRSSModule} Interface
* for the W3C geo format.
* W3CGeoModuleImpl is the implementation of the {@link GeoRSSModule} Interface for the W3C geo format.
*
* @author Marc Wick
* @version $Id: W3CGeoModuleImpl.java,v 1.2 2007/04/18 09:59:29 marcwick Exp $
@ -31,7 +29,6 @@ public class W3CGeoModuleImpl extends GeoRSSModule {
super(GeoRSSModule.class, GeoRSSModule.GEORSS_W3CGEO_URI);
}
/*
* (non-Javadoc)
*

View file

@ -16,11 +16,12 @@
*/
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.io.ModuleParser;
import org.rometools.feed.module.georss.geometries.*;
/**
* W3CGeoParser is a parser for the W3C geo format.
@ -40,26 +41,25 @@ public class W3CGeoParser implements ModuleParser {
return GeoRSSModule.GEORSS_W3CGEO_URI;
}
static Module parseW3C(Element element) {
static Module parseW3C(final Element element) {
GeoRSSModule geoRSSModule = null;
// do we have an optional "Point" element ?
Element pointElement = element
.getChild("Point", GeoRSSModule.W3CGEO_NS);
Element pointElement = element.getChild("Point", GeoRSSModule.W3CGEO_NS);
// we don't have an optional "Point" element
if (pointElement == null) {
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);
if (lng == null)
if (lng == null) {
lng = pointElement.getChild("lon", GeoRSSModule.W3CGEO_NS);
}
if (lat != null && lng != null) {
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));
}
@ -69,10 +69,10 @@ public class W3CGeoParser implements ModuleParser {
/*
* (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) {
Module geoRssModule = parseW3C(element);
public Module parse(final Element element) {
final Module geoRssModule = parseW3C(element);
return geoRssModule;
}

View file

@ -11,6 +11,7 @@ package org.rometools.feed.module.georss.geometries;
/**
* Abstract base class for Curves (linear objects)
*
* @author runaas
*/
public abstract class AbstractCurve extends AbstractGeometricPrimitive {

View file

@ -11,6 +11,7 @@ package org.rometools.feed.module.georss.geometries;
/**
* Abstract base class for geometric primitives (non-composite geometric objects)
*
* @author runaas
*/
public abstract class AbstractGeometricPrimitive extends AbstractGeometry {

View file

@ -24,13 +24,16 @@ public abstract class AbstractGeometry implements Cloneable, Serializable {
/**
* Make a deep copy of the geometric object
*
* @return A copy of the object
*/
@Override
public Object clone() throws CloneNotSupportedException {
return super.clone();
}
public boolean equals(Object obj) {
@Override
public boolean equals(final Object obj) {
return obj != null && obj.getClass() == getClass();
}
}

View file

@ -13,6 +13,7 @@ import java.io.Serializable;
/**
* Abstract base class for rings (closed linear objects used for polygon borders)
*
* @author runaas
*/
public abstract class AbstractRing implements Cloneable, Serializable {
@ -21,6 +22,7 @@ public abstract class AbstractRing implements Cloneable, Serializable {
public AbstractRing() {
}
@Override
public Object clone() throws CloneNotSupportedException {
return super.clone();
}

View file

@ -11,6 +11,7 @@ package org.rometools.feed.module.georss.geometries;
/**
* Abstract base class for surface (area) objects
*
* @author runaas
*/
public abstract class AbstractSurface extends AbstractGeometricPrimitive {

View file

@ -10,9 +10,8 @@
package org.rometools.feed.module.georss.geometries;
/**
* Envelope, a bounding box spanned by an upper right and lower left corner point.
* Note that if the box spans the -180 180 degree meridian the numerical value of the
* minLongitude may be greater than the maxLongitude.
* Envelope, a bounding box spanned by an upper right and lower left corner point. Note that if the box spans the -180 180 degree meridian the numerical value
* of the minLongitude may be greater than the maxLongitude.
*
* @author runaas
*/
@ -23,6 +22,7 @@ public class Envelope extends AbstractGeometry {
public Envelope() {
minLatitude = minLongitude = maxLatitude = maxLongitude = Double.NaN;
}
/**
* Construct object from coordinate values
*
@ -31,7 +31,7 @@ public class Envelope extends AbstractGeometry {
* @param maxLatitude
* @param maxLongitude
*/
public Envelope(double minLatitude, double minLongitude, double maxLatitude, double maxLongitude) {
public Envelope(final double minLatitude, final double minLongitude, final double maxLatitude, final double maxLongitude) {
this.minLatitude = minLatitude;
this.minLongitude = minLongitude;
this.maxLatitude = maxLatitude;
@ -69,28 +69,28 @@ public class Envelope extends AbstractGeometry {
/**
* @param v minimum longitude
*/
public void setMinLongitude(double v) {
public void setMinLongitude(final double v) {
minLongitude = v;
}
/**
* @param v minimum latitude
*/
public void setMinLatitude(double v) {
public void setMinLatitude(final double v) {
minLatitude = v;
}
/**
* @param v maximum longitude
*/
public void setMaxLongitude(double v) {
public void setMaxLongitude(final double v) {
maxLongitude = v;
}
/**
* @param v maximum latitude
*/
public void setMaxLatitude(double v) {
public void setMaxLatitude(final double v) {
maxLatitude = v;
}
}

View file

@ -11,6 +11,7 @@ package org.rometools.feed.module.georss.geometries;
/**
* Linear object constructed by linear interpolation between points
*
* @author runaas
*/
public final class LineString extends AbstractCurve {
@ -24,23 +25,28 @@ public final class LineString extends AbstractCurve {
/**
* Construct object from a position list
*/
public LineString(PositionList posList) {
public LineString(final PositionList posList) {
this.posList = posList;
}
@Override
public Object clone() throws CloneNotSupportedException {
LineString retval = (LineString)super.clone();
if (posList != null)
retval.posList = (PositionList)posList.clone();
final LineString retval = (LineString) super.clone();
if (posList != null) {
retval.posList = (PositionList) posList.clone();
}
return retval;
}
public boolean equals(Object obj) {
if (this == obj)
@Override
public boolean equals(final Object obj) {
if (this == obj) {
return true;
if (!super.equals(obj))
}
if (!super.equals(obj)) {
return false;
return getPositionList().equals(((LineString)obj).getPositionList());
}
return getPositionList().equals(((LineString) obj).getPositionList());
}
/**
@ -49,8 +55,9 @@ public final class LineString extends AbstractCurve {
* @return the positionlist
*/
public PositionList getPositionList() {
if (posList == null)
if (posList == null) {
posList = new PositionList();
}
return posList;
}
@ -59,7 +66,7 @@ public final class LineString extends AbstractCurve {
*
* @param posList the new position list
*/
public void setPositionList(PositionList posList) {
public void setPositionList(final PositionList posList) {
this.posList = posList;
}
}

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