Updated classes to use JDOM 2

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

56
cleanup.xml Normal file
View file

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

291
formatter.xml Normal file
View file

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

View file

@ -22,22 +22,25 @@ import org.rometools.feed.module.activitystreams.types.Mood;
import org.rometools.feed.module.activitystreams.types.Verb;
/**
*
*
* @author robert.cooper
*/
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,9 +20,8 @@ import org.rometools.feed.module.activitystreams.types.ActivityObject;
import org.rometools.feed.module.activitystreams.types.Mood;
import org.rometools.feed.module.activitystreams.types.Verb;
/**
*
*
* @author robert.cooper
*/
public class ActivityStreamModuleImpl implements ActivityStreamModule {
@ -31,53 +30,53 @@ public class ActivityStreamModuleImpl implements ActivityStreamModule {
/**
* Set the value of object
*
*
* @param newobject new value of object
*/
public void setObject(ActivityObject newobject) {
this.object = newobject;
public void setObject(final ActivityObject newobject) {
object = newobject;
}
/**
* Get the value of object
*
*
* @return the value of object
*/
public ActivityObject getObject() {
return this.object;
return object;
}
/**
* Set the value of verb
*
*
* @param newverb new value of verb
*/
public void setVerb(Verb newverb) {
this.verb = newverb;
public void setVerb(final Verb newverb) {
verb = newverb;
}
/**
* Get the value of verb
*
*
* @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.");
}
}
public Mood getMood() {
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,32 +17,33 @@
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(){
throw new UnsupportedOperationException("Not supported yet.");
public ContactModule getAddress() {
throw new UnsupportedOperationException("Not supported yet.");
}
public void setAddress(ContactModule address){
throw new UnsupportedOperationException("Not supported yet.");
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 {
@ -48,38 +46,38 @@ public class Audio extends ActivityObject {
/**
* Set the value of embedCode
*
*
* @param newembedCode new value of embedCode
*/
public void setEmbedCode(String newembedCode) {
this.embedCode = newembedCode;
public void setEmbedCode(final String newembedCode) {
embedCode = newembedCode;
}
/**
* Get the value of embedCode
*
*
* @return the value of embedCode
*/
public String getEmbedCode() {
return this.embedCode;
return embedCode;
}
/**
* Set the value of streamLink
*
*
* @param newstreamLink new value of streamLink
*/
public void setStreamLink(String newstreamLink) {
this.streamLink = newstreamLink;
public void setStreamLink(final String newstreamLink) {
streamLink = newstreamLink;
}
/**
* Get the value of streamLink
*
*
* @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,36 +71,33 @@ 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");
}
/**
* Set the value of thumbnail
*
*
* @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,31 +18,28 @@
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
*/
public class Event extends ActivityObject {

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,64 +21,74 @@ 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;
* &lt;id&gt;tag:world:activity:1212121212121&lt;/id&gt;
* &lt;title&gt;Rob liked Goldeberg's Deli&lt;/title&gt;
* &lt;author&gt;
* &lt;name&gt;Rob Dolin&lt;/name&gt;
* &lt;id&gt;tag:world:person:1212121212121&lt;/id&gt;
* &lt;link rel="alternate" type="text/html" href="http://robdolin.com" /&gt;
* &lt;poco:address&gt;
* &lt;poco:locality&gt;Marina del Rey&lt;/poco:locality&gt;
* &lt;poco:region&gt;CA&lt;/poco:region&gt;
* &lt;poco:postalCode&gt;90292&lt;/poco:postalCode&gt;
* &lt;poco:country&gt;US&lt;/poco:country&gt;
* &lt;/poco:address&gt;
* &lt;/author&gt;
* &lt;activity:object&gt;
* &lt;activity:object-type&gt;http://activitystrea.ms/schema/1.0/place&lt;/object-type&gt;
* &lt;id&gt;tag:world:place:1212121212121&lt;/id&gt;
* &lt;title&gt;Goldberg's Deli&lt;/title&gt;
* &lt;link rel="alternate" type="text/html" href="http://www.deli.com" /&gt;
* &lt;geo:point&gt;33.9777 -118.4351&lt;/geo:point&gt;
* &lt;poco:address&gt;
* &lt;poco:streetAddress&gt;14016 Bora Bora Way&lt;/poco:streetAddress&gt;
* &lt;poco:locality&gt;Marina del Rey&lt;/poco:locality&gt;
* &lt;poco:region&gt;CA&lt;/poco:region&gt;
* &lt;poco:postalCode&gt;90292&lt;/poco:postalCode&gt;
* &lt;poco:country&gt;US&lt;/poco:country&gt;
* &lt;/poco:address&gt;
* &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" />
*
*</p>
* <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;
* &lt;name&gt;Rob Dolin&lt;/name&gt;
* &lt;id&gt;tag:world:person:1212121212121&lt;/id&gt;
* &lt;link rel="alternate" type="text/html" href="http://robdolin.com" /&gt;
* &lt;poco:address&gt;
* &lt;poco:locality&gt;Marina del Rey&lt;/poco:locality&gt;
* &lt;poco:region&gt;CA&lt;/poco:region&gt;
* &lt;poco:postalCode&gt;90292&lt;/poco:postalCode&gt;
* &lt;poco:country&gt;US&lt;/poco:country&gt;
* &lt;/poco:address&gt;
* &lt;/author&gt;
* &lt;activity:object&gt;
* &lt;activity:object-type&gt;http://activitystrea.ms/schema/1.0/place&lt;/object-type&gt;
* &lt;id&gt;tag:world:place:1212121212121&lt;/id&gt;
* &lt;title&gt;Goldberg's Deli&lt;/title&gt;
* &lt;link rel="alternate" type="text/html" href="http://www.deli.com" /&gt;
* &lt;geo:point&gt;33.9777 -118.4351&lt;/geo:point&gt;
* &lt;poco:address&gt;
* &lt;poco:streetAddress&gt;14016 Bora Bora Way&lt;/poco:streetAddress&gt;
* &lt;poco:locality&gt;Marina del Rey&lt;/poco:locality&gt;
* &lt;poco:region&gt;CA&lt;/poco:region&gt;
* &lt;poco:postalCode&gt;90292&lt;/poco:postalCode&gt;
* &lt;poco:country&gt;US&lt;/poco:country&gt;
* &lt;/poco:address&gt;
* &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" />
*
* </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 {
@ -43,37 +41,37 @@ public class Mood {
/**
* Set the value of iconUrl
*
*
* @param newiconUrl new value of iconUrl
*/
public void setIconUrl(String newiconUrl) {
this.iconUrl = newiconUrl;
public void setIconUrl(final String newiconUrl) {
iconUrl = newiconUrl;
}
/**
* Get the value of iconUrl
*
*
* @return the value of iconUrl
*/
public String getIconUrl() {
return this.iconUrl;
return iconUrl;
}
/**
* Set the value of text
*
*
* @param newtext new value of text
*/
public void setText(String newtext) {
this.text = newtext;
public void setText(final String newtext) {
text = newtext;
}
/**
* Get the value of text
*
*
* @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,65 +20,62 @@ 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 {
public class Person extends ActivityObject {
@Override
public String getTypeIRI() {
return "http://activitystrea.ms/schema/1.0/person";
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");
}
/**
* Set the value of avatar
*
*
* @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

@ -18,17 +18,20 @@
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 {
public class Playlist extends ActivityObject {
@Override
public String getTypeIRI() {

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
* 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>
* 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>
*
* @author robert.cooper
*/
public class Song extends ActivityObject {
@ -39,20 +40,20 @@ public class Song extends ActivityObject {
/**
* Set the value of audio
*
*
* @param newaudio new value of audio
*/
public void setAudio(Audio newaudio) {
this.audio = newaudio;
public void setAudio(final Audio newaudio) {
audio = newaudio;
}
/**
* Get the value of audio
*
*
* @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,164 +16,145 @@
*/
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"),
/**
* The "mark as liked" verb indicates that the actor indicated that it likes the object.
*
*
* The verb URI for the "mark as liked" Verb is http://activitystrea.ms/schema/1.0/like.
*/
MARK_AS_LIKED("http://activitystrea.ms/schema/1.0/like"),
/**
* The "make friend" Verb indicates the creation of a friendship that is reciprocated by the object.
*
* 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.
*
* 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 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.
*
* 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

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

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 $
*/
@ -52,39 +51,34 @@ 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><font size="-1">
* Author of the item.</font></td>
* <td width="120"><font size="-1"> <b>Details</b></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><font size="-1"> &lt;g:author&gt;John Steinbeck&lt;/g:author&gt;</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);
@ -92,304 +86,283 @@ 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><font size="-1">
* Author of the item.</font></td>
* <td width="120"><font size="-1"> <b>Details</b></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><font size="-1"> &lt;g:author&gt;John Steinbeck&lt;/g:author&gt;</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();
/**
* Source for this article.
*
*
*
*
* <table border="1" cellpadding="5" cellspacing="0" width="640">
* <tbody><tr valign="top">
*
* <td colspan="2" bgcolor="#dddddd"><font size="-1">
* <b><a name="news_source"></a>news_source</b></font></td>
* <tbody>
* <tr valign="top">
*
* <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><font size="-1">
* The source of news content.</font></td>
*
* <td width="120"><font size="-1"> <b>Details</b></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><font size="-1"> &lt;g:news_source&gt;Journal&lt;/g:news_source&gt;</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 width="120"><font size="-1">
*
* <b>Content type</b></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);
/**
* Source for this article.
*
*
* <table border="1" cellpadding="5" cellspacing="0" width="640">
* <tbody><tr valign="top">
*
* <td colspan="2" bgcolor="#dddddd"><font size="-1">
* <b><a name="news_source"></a>news_source</b></font></td>
* <tbody>
* <tr valign="top">
*
* <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><font size="-1">
* The source of news content.</font></td>
*
* <td width="120"><font size="-1"> <b>Details</b></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><font size="-1"> &lt;g:news_source&gt;Journal&lt;/g:news_source&gt;</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 width="120"><font size="-1">
*
* <b>Content type</b></font></td>
* <td><font size="-1"> string</font></td>
* </tr>
* </tbody></table>
* </tbody>
* </table>
*
* @return source for this article.
*/
public String getNewsSource();
/**
* Number of pages in the article.
*
*
* <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><font size="-1">
*
* The number of pages in the publication.</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><font size="-1"> &lt;g:pages&gt;18&lt;/g:pages&gt;</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 width="120"><font size="-1">
*
* <b>Content type</b></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);
/**
* Number of pages in the article.
*
*
* <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><font size="-1">
*
* The number of pages in the publication.</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><font size="-1"> &lt;g:pages&gt;18&lt;/g:pages&gt;</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 width="120"><font size="-1">
*
* <b>Content type</b></font></td>
* <td><font size="-1"> integer</font></td>
* </tr>
* </tbody></table>
* </tbody>
* </table>
*
* @return Number of pages in the article
*/
public Integer getPages();
/**
* 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:
* YYYY-MM-DD</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:
* 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:publish_date&gt;2005-12-20&lt;/g:publish_date&gt;</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><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><font size="-1">
*
* date</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 publishDate Date article was published
*/
public void setPublishDate(Date publishDate);
/**
* Date article was published.
*
* 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:
* YYYY-MM-DD</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:
* 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:publish_date&gt;2005-12-20&lt;/g:publish_date&gt;</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><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><font size="-1">
*
* date</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 Date article was published
*/
public Date getPublishDate();

View file

@ -40,443 +40,430 @@ 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 $
*/
public interface Course extends GlobalInterface {
/**
* The timeframe a course is running.
*
*
*
*
* <table border="1" cellpadding="5" cellspacing="0" width="640">
*
* <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>
*
* <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>
* </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">
*
* <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>
* <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>
* </tr>
* <tr valign="top">
* <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>
* <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:end&gt;2005-12-29T10:30:59&lt;/g:end&gt;<br>
* &lt;/g:course_date_range&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><font size="-1">
* dateTimeRange</font></td>
* <td width="120"><font size="-1">
*
* <b>Content type</b></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);
/**
* The timeframe a course is running.
*
*
*
*
* <table border="1" cellpadding="5" cellspacing="0" width="640">
*
* <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>
*
* <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>
* </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">
*
* <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>
* <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>
* </tr>
* <tr valign="top">
* <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>
* <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:end&gt;2005-12-29T10:30:59&lt;/g:end&gt;<br>
* &lt;/g:course_date_range&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><font size="-1">
* dateTimeRange</font></td>
* <td width="120"><font size="-1">
*
* <b>Content type</b></font></td>
*
* <td><font size="-1"> dateTimeRange</font></td>
* </tr>
* </tbody></table>
* </tbody>
* </table>
*
* @return The timeframe a course is running
*/
public DateTimeRange getCourseDateRange();
/**
* ID code associated with a course.
*
*
* <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>
* </tr>
* <tr valign="top">
* <td width="120"> <font size="-1"><b>Details</b></font></td>
*
* <td> <font size="-1">ID code associated with a course</font></td>
*
* </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>
*
* </tr>
* <tr valign="top">
*
* <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>
*
* </tr>
* </tbody></table>
*
*
* <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>
* </tr>
* <tr valign="top">
* <td width="120"><font size="-1"><b>Details</b></font></td>
*
* <td><font size="-1">ID code associated with a course</font></td>
*
* </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>
*
* </tr>
* <tr valign="top">
*
* <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>
*
* </tr>
* </tbody>
* </table>
*
* @param courseNumber ID code associated with a course
*/
public void setCourseNumber(String courseNumber);
/**
* ID code associated with a course.
*
*
*
* <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>
* </tr>
* <tr valign="top">
* <td width="120"> <font size="-1"><b>Details</b></font></td>
*
* <td> <font size="-1">ID code associated with a course</font></td>
*
* </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>
*
* </tr>
* <tr valign="top">
*
* <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>
*
* </tr>
* </tbody></table>
*
*
*
* <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>
* </tr>
* <tr valign="top">
* <td width="120"><font size="-1"><b>Details</b></font></td>
*
* <td><font size="-1">ID code associated with a course</font></td>
*
* </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>
*
* </tr>
* <tr valign="top">
*
* <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>
*
* </tr>
* </tbody>
* </table>
*
* @return ID code associated with a course
*/
public String getCourseNumber();
/**
* Time a class is in session.
*
*
* <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>
*
* </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>
* </tr>
* <tr valign="top">
* <td width="120"> <font size="-1"><b>Example</b></font></td>
*
* <td> <font size="-1">&lt;g:course_times&gt;MWF 08:30 - 09:45&lt;/g:course_times&gt;</font></td>
*
* </tr>
* <tr valign="top">
* <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>
* </tr>
* </tbody></table>
*
*
* <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>
*
* </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>
* </tr>
* <tr valign="top">
* <td width="120"><font size="-1"><b>Example</b></font></td>
*
* <td><font size="-1">&lt;g:course_times&gt;MWF 08:30 - 09:45&lt;/g:course_times&gt;</font></td>
*
* </tr>
* <tr valign="top">
* <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>
* </tr>
* </tbody>
* </table>
*
* @param courseTimes Time a class is in session
*/
public void setCourseTimes(String courseTimes);
/**
* Time a class is in session.
*
*
*
* <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>
*
* </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>
* </tr>
* <tr valign="top">
* <td width="120"> <font size="-1"><b>Example</b></font></td>
*
* <td> <font size="-1">&lt;g:course_times&gt;MWF 08:30 - 09:45&lt;/g:course_times&gt;</font></td>
*
* </tr>
* <tr valign="top">
* <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>
* </tr>
* </tbody></table>
*
*
*
* <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>
*
* </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>
* </tr>
* <tr valign="top">
* <td width="120"><font size="-1"><b>Example</b></font></td>
*
* <td><font size="-1">&lt;g:course_times&gt;MWF 08:30 - 09:45&lt;/g:course_times&gt;</font></td>
*
* </tr>
* <tr valign="top">
* <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>
* </tr>
* </tbody>
* </table>
*
* @return Time a class is in session
*/
public String getCourseTimes();
/**
* Salary for this position.
*
*
*
*
*
*
* <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>
* </tr>
*
* <tbody>
* <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 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>
* </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 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>
* </tr>
* <tr valign="top">
* <td width="120"><font size="-1">
*
* <b>Attribute of</b></font></td>
*
* <td><font size="-1">
* Jobs</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><font size="-1">
*
* <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);
/**
* Salary for this position.
*
*
*
*
* <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>
* </tr>
*
* <tbody>
* <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 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>
* </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 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>
* </tr>
* <tr valign="top">
* <td width="120"><font size="-1">
*
* <b>Attribute of</b></font></td>
*
* <td><font size="-1">
* Jobs</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><font size="-1">
*
* <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();
/**
* Topics of study for a course.
*
*
*
*
* <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 width="120"><font size="-1">
*
* <b>Details</b></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><font size="-1"> &lt;g:subject&gt;Trigonometry&lt;/g:subject&gt;</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><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><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);
/**
* Topics of study for a course.
*
*
*
*
* <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 width="120"><font size="-1">
*
* <b>Details</b></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><font size="-1"> &lt;g:subject&gt;Trigonometry&lt;/g:subject&gt;</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><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><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,41 +471,38 @@ 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><font size="-1"> &lt;g:university&gt;Stanford&lt;/g:university&gt;</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">
*
* <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><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 university Name of the school at which a class is offered.
*/
public void setUniversity(String university);
@ -526,41 +510,38 @@ 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><font size="-1"> &lt;g:university&gt;Stanford&lt;/g:university&gt;</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">
*
* <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><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 Name of the school at which a class is offered.
*/
public String getUniversity();

View file

@ -20,106 +20,111 @@
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 $
*/
public interface CustomTag {
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">
* <td><strong><font size="-1">Type (JavaType)</font></strong></td>
* <tbody>
* <tr valign="top">
* <td><strong><font size="-1">Type (JavaType)</font></strong></td>
*
* <td><strong><font size="-1">Description</font></strong></td>
* <td><strong><font size="-1">Examples</font></strong></td>
* </tr>
* <tr valign="top">
* <td><font size="-1">string (String)</font></td>
* <td><font size="-1">Any string</font></td>
* <td><font size="-1">Blue</font></td>
* <td><strong><font size="-1">Description</font></strong></td>
* <td><strong><font size="-1">Examples</font></strong></td>
* </tr>
* <tr valign="top">
* <td><font size="-1">string (String)</font></td>
* <td><font size="-1">Any string</font></td>
* <td><font size="-1">Blue</font></td>
*
* </tr>
* <tr valign="top">
* <td><font size="-1">int (Integer)</font></td>
* <td><font size="-1">Whole number values</font></td>
* <td><font size="-1">1000</font></td>
* </tr>
* <tr valign="top">
* </tr>
* <tr valign="top">
* <td><font size="-1">int (Integer)</font></td>
* <td><font size="-1">Whole number values</font></td>
* <td><font size="-1">1000</font></td>
* </tr>
* <tr valign="top">
*
* <td><font size="-1">float (Float)</font></td>
* <td><font size="-1">Numbers with decimal digits</font></td>
* <td><font size="-1">3.5</font></td>
* </tr>
* <tr valign="top">
* <td><font size="-1">intUnit (IntUnit)</font></td>
* <td><font size="-1">float (Float)</font></td>
* <td><font size="-1">Numbers with decimal digits</font></td>
* <td><font size="-1">3.5</font></td>
* </tr>
* <tr valign="top">
* <td><font size="-1">intUnit (IntUnit)</font></td>
*
* <td><font size="-1">Whole number value and a string</font></td>
* <td><font size="-1">Whole number value and a string</font></td>
*
* <td><font size="-1">10 km</font></td>
* </tr>
* <tr valign="top">
* <td><font size="-1">floatUnit (FloatUnit)</font></td>
* <td><font size="-1">Numbers with decimal digits and a string</font></td>
* <td><font size="-1">10 km</font></td>
* </tr>
* <tr valign="top">
* <td><font size="-1">floatUnit (FloatUnit)</font></td>
* <td><font size="-1">Numbers with decimal digits and a string</font></td>
*
* <td><font size="-1">1.5 km</font></td>
* </tr>
* <td><font size="-1">1.5 km</font></td>
* </tr>
*
* <tr valign="top">
* <td><font size="-1">date (ShortDate)</font></td>
* <td><font size="-1">Date of an event, in format YYYY-MM-DD</font></td>
* <td><font size="-1">2005-12-12</font></td>
* </tr>
* <td><font size="-1">date (ShortDate)</font></td>
* <td><font size="-1">Date of an event, in format YYYY-MM-DD</font></td>
* <td><font size="-1">2005-12-12</font></td>
* </tr>
*
* <tr valign="top">
* <td><font size="-1">dateTime (java.util.Date)</font></td>
* <tr valign="top">
* <td><font size="-1">dateTime (java.util.Date)</font></td>
*
* <td><font size="-1">Date and time for an event, in format YYYY-MM-DDThh:mm:ss</font></td>
* <td><font size="-1">2005-12-12T12:00:00 </font></td>
* </tr>
* <tr valign="top">
* <td><font size="-1">dateTimeRange (DateTimeRange)</font></td>
* <td><font size="-1">Date and time for an event, in format YYYY-MM-DDThh:mm:ss</font></td>
* <td><font size="-1">2005-12-12T12:00:00 </font></td>
* </tr>
* <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>
* <tr valign="top">
* <td><font size="-1">url (java.net.URL)</font></td>
* <td><font size="-1">HTTP URL </font></td>
* </tr>
* <tr valign="top">
* <td><font size="-1">url (java.net.URL)</font></td>
* <td><font size="-1">HTTP URL </font></td>
*
* <td><font size="-1">http://www.google.com</font></td>
* </tr>
* <td><font size="-1">http://www.google.com</font></td>
* </tr>
*
* <tr valign="top">
* <td><font size="-1">boolean (Boolean)</font></td>
* <td><font size="-1">Value may be either true or false.</font></td>
* <td><font size="-1">true</font></td>
* </tr>
* <tr valign="top">
* <td><font size="-1">boolean (Boolean)</font></td>
* <td><font size="-1">Value may be either true or false.</font></td>
* <td><font size="-1">true</font></td>
* </tr>
*
* <tr valign="top">
* <td><font size="-1">location (CustomTagImpl.Location)</font></td>
* <tr valign="top">
* <td><font size="-1">location (CustomTagImpl.Location)</font></td>
*
* <td><font size="-1">Location</font></td>
* <td><font size="-1">921 W. Dana Street, Mtn View, CA-94103 </font></td>
* </tr>
* <td><font size="-1">Location</font></td>
* <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() ))
return true;
}
return false;
@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>
* <pre>
* x.clone() != x</pre></blockquote>
* will be true, and that the expression:
* <blockquote>
* <pre>
* x.clone().getClass() == x.getClass()</pre></blockquote>
* will be <tt>true</tt>, but these are not absolute requirements.
* While it is typically the case that:
* <blockquote>
* <pre>
* x.clone().equals(x)</pre></blockquote>
* will be <tt>true</tt>, this is not an absolute requirement.
* <p>
* By convention, the returned object should be obtained by calling
* <tt>super.clone</tt>. If a class and all of its superclasses (except
* <tt>Object</tt>) obey this convention, it will be the case that
* <tt>x.clone().getClass() == x.getClass()</tt>.
* <p>
* By convention, the object returned by this method should be independent
* of this object (which is being cloned). To achieve this independence,
* it may be necessary to modify one or more fields of the object returned
* by <tt>super.clone</tt> before returning it. Typically, this means
* copying any mutable objects that comprise the internal "deep structure"
* of the object being cloned and replacing the references to these
* objects with references to the copies. If a class contains only
* primitive fields or references to immutable objects, then it is usually
* the case that no fields in the object returned by <tt>super.clone</tt>
* need to be modified.
* <p>
* The method <tt>clone</tt> for class <tt>Object</tt> performs a
* specific cloning operation. First, if the class of this object does
* not implement the interface <tt>Cloneable</tt>, then a
* <tt>CloneNotSupportedException</tt> is thrown. Note that all arrays
* are considered to implement the interface <tt>Cloneable</tt>.
* Otherwise, this method creates a new instance of the class of this
* object and initializes all its fields with exactly the contents of
* the corresponding fields of this object, as if by assignment; the
* contents of the fields are not themselves cloned. Thus, this method
* performs a "shallow copy" of this object, not a "deep copy" operation.
* <p>
* The class <tt>Object</tt> does not itself implement the interface
* <tt>Cloneable</tt>, so calling the <tt>clone</tt> method on an object
* whose class is <tt>Object</tt> will result in throwing an
* exception at run time.
* 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>
*
* @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.
* <pre>
* x.clone() != x
* </pre>
*
* </blockquote> will be true, and that the expression: <blockquote>
*
* <pre>
* x.clone().getClass() == x.getClass()
* </pre>
*
* </blockquote> will be <tt>true</tt>, but these are not absolute requirements. While it is typically the case that: <blockquote>
*
* <pre>
* x.clone().equals(x)
* </pre>
*
* </blockquote> will be <tt>true</tt>, this is not an absolute requirement.
* <p>
* By convention, the returned object should be obtained by calling <tt>super.clone</tt>. If a class and all of its superclasses (except <tt>Object</tt>)
* obey this convention, it will be the case that <tt>x.clone().getClass() == x.getClass()</tt>.
* <p>
* By convention, the object returned by this method should be independent of this object (which is being cloned). To achieve this independence, it may be
* necessary to modify one or more fields of the object returned by <tt>super.clone</tt> before returning it. Typically, this means copying any mutable
* objects that comprise the internal "deep structure" of the object being cloned and replacing the references to these objects with references to the
* copies. If a class contains only primitive fields or references to immutable objects, then it is usually the case that no fields in the object returned
* by <tt>super.clone</tt> need to be modified.
* <p>
* The method <tt>clone</tt> for class <tt>Object</tt> performs a specific cloning operation. First, if the class of this object does not implement the
* interface <tt>Cloneable</tt>, then a <tt>CloneNotSupportedException</tt> is thrown. Note that all arrays are considered to implement the interface
* <tt>Cloneable</tt>. Otherwise, this method creates a new instance of the class of this object and initializes all its fields with exactly the contents of
* the corresponding fields of this object, as if by assignment; the contents of the fields are not themselves cloned. Thus, this method performs a
* "shallow copy" of this object, not a "deep copy" operation.
* <p>
* The class <tt>Object</tt> does not itself implement the interface <tt>Cloneable</tt>, so calling the <tt>clone</tt> method on an object whose class is
* <tt>Object</tt> will result in throwing an exception at run time.
*
* @return a clone of this instance.
* @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;
return cti;
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,19 +20,20 @@
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>
*/
public interface CustomTags extends Module {
public static final String URI = "http://base.google.com/cns/1.0";
public List getValues();
public void setValues(List values);
}

View file

@ -20,49 +20,50 @@
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>
*/
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;
return values;
public List getValues() {
values = values == null ? new ArrayList() : values;
return values;
}
public void setValues(List values){
this.values = 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 );
return cti;
final CustomTagsImpl cti = new CustomTagsImpl();
cti.values = new ArrayList(values);
return cti;
}
public Class getInterface(){
return CustomTags.class;
public Class getInterface() {
return CustomTags.class;
}
public String getUri() {
return CustomTags.URI;
return CustomTags.URI;
}
}

File diff suppressed because it is too large Load diff

View file

@ -43,489 +43,479 @@ import java.io.Serializable;
import java.net.URL;
import java.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>
*
* <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>
* </tr>
* <tr valign="top">
* <td width="120"> <font size="-1"><b>Details</b></font></td>
*
* <td><font size="-1"> Date that the item expires in <a href="http://www.iso.org/iso/en/prods-services/popstds/datesandtime.html">ISO 8601</a> format:
* YYYY-MM-DD</font></td>
* </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;
*
/**
* 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>
* </tr>
* <tr valign="top">
* <td width="120"><font size="-1"><b>Details</b></font></td>
*
* <td><font size="-1"> Date that the item expires in <a href="http://www.iso.org/iso/en/prods-services/popstds/datesandtime.html">ISO 8601</a> format:
* YYYY-MM-DD</font></td>
* </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;
*
* </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>
* </tr>
* <tr valign="top">
* <td width="120"> <font size="-1"><b>Content type</b></font></td>
*
* <td><font size="-1"> date</font></td>
* </tr>
* </tbody></table>
* </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>
* </tr>
* <tr valign="top">
* <td width="120"><font size="-1"><b>Content type</b></font></td>
*
* <td><font size="-1"> date</font></td>
* </tr>
* </tbody>
* </table>
*
* @param expirationDate the date this entry will expire
*/
public void setExpirationDate(Date expirationDate);
/** 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>
* </tr>
* <tr valign="top">
* <td width="120"> <font size="-1"><b>Details</b></font></td>
*
* <td><font size="-1"> Date that the item expires in <a href="http://www.iso.org/iso/en/prods-services/popstds/datesandtime.html">ISO 8601</a> format:
* YYYY-MM-DD</font></td>
* </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;
*
/**
* 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>
* </tr>
* <tr valign="top">
* <td width="120"><font size="-1"><b>Details</b></font></td>
*
* <td><font size="-1"> Date that the item expires in <a href="http://www.iso.org/iso/en/prods-services/popstds/datesandtime.html">ISO 8601</a> format:
* YYYY-MM-DD</font></td>
* </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;
*
* </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>
* </tr>
* <tr valign="top">
* <td width="120"> <font size="-1"><b>Content type</b></font></td>
*
* <td><font size="-1"> date</font></td>
* </tr>
* </tbody></table>
* </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>
* </tr>
* <tr valign="top">
* <td width="120"><font size="-1"><b>Content type</b></font></td>
*
* <td><font size="-1"> date</font></td>
* </tr>
* </tbody>
* </table>
*
* @return the date this entry will expire
*/
public Date getExpirationDate();
/**
* 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>
*
* </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>
* </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>
* </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>
*
* </tr>
* <tr valign="top">
* <td width="120"> <font size="-1"><b>Content type</b></font></td>
* <td><font size="-1"> dateTime</font></td>
* </tr>
*
* </tbody></table>
*
* <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>
*
* </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>
* </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>
* </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>
*
* </tr>
* <tr valign="top">
* <td width="120"><font size="-1"><b>Content type</b></font></td>
* <td><font size="-1"> dateTime</font></td>
* </tr>
*
* </tbody>
* </table>
*
* @param expirationDateTime Date and time that the item expires.
*/
public void setExpirationDateTime(Date expirationDateTime);
/**
* 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>
*
* </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>
* </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>
* </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>
*
* </tr>
* <tr valign="top">
* <td width="120"> <font size="-1"><b>Content type</b></font></td>
* <td><font size="-1"> dateTime</font></td>
* </tr>
*
* </tbody></table>
*
* <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>
*
* </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>
* </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>
* </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>
*
* </tr>
* <tr valign="top">
* <td width="120"><font size="-1"><b>Content type</b></font></td>
* <td><font size="-1"> dateTime</font></td>
* </tr>
*
* </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>
* </tr>
* <tr valign="top">
* <td width="120"> <font size="-1"><b>Details</b></font></td>
*
* <td><font size="-1"> Unique alphanumeric identifier for each item
* - e.g., your internal ID code.<br>
* 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">
*
* &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>
*
* </tr>
*
* <tr valign="top">
* <td width="120"> <font size="-1"><b>Content type</b></font></td>
* <td><font size="-1"> string</font></td>
* </tr>
* </tbody></table>
* <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><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">
*
* &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>
*
* </tr>
*
* <tr valign="top">
* <td width="120"><font size="-1"><b>Content type</b></font></td>
* <td><font size="-1"> string</font></td>
* </tr>
* </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>
* </tr>
* <tr valign="top">
* <td width="120"> <font size="-1"><b>Details</b></font></td>
*
* <td><font size="-1"> Unique alphanumeric identifier for each item
* - e.g., your internal ID code.<br>
* 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">
*
* &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>
*
* </tr>
*
* <tr valign="top">
* <td width="120"> <font size="-1"><b>Content type</b></font></td>
* <td><font size="-1"> string</font></td>
* </tr>
* </tbody></table>
* <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><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">
*
* &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>
*
* </tr>
*
* <tr valign="top">
* <td width="120"><font size="-1"><b>Content type</b></font></td>
* <td><font size="-1"> string</font></td>
* </tr>
* </tbody>
* </table>
*
* @return unique identifier for this entry
*/
public String getId();
/**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>
*
* </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>
*
* </tr>
* <tr valign="top">
* <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>
*
* &lt;image_link&gt;http://example.com/i/6.jpg,http://example.com/i/9.jpg&lt;/image_link&gt;<br>
*
* <em>Not acceptable:</em><br>
* &lt;image_link&gt;/images/1006.jpg&lt;/image_link&gt;<br>
* &lt;image_link&gt;example.com/images/1006.jpg&lt;/image_link&gt;</font></td>
*
* </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>
* </tr>
* <tr valign="top">
* <td width="120"> <font size="-1"><b>Content type</b></font></td>
*
* <td><font size="-1"> url</font></td>
* </tr>
*
* </tbody></table>
/**
* 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>
*
* </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>
*
* </tr>
* <tr valign="top">
* <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>
*
* &lt;image_link&gt;http://example.com/i/6.jpg,http://example.com/i/9.jpg&lt;/image_link&gt;<br>
*
* <em>Not acceptable:</em><br>
* &lt;image_link&gt;/images/1006.jpg&lt;/image_link&gt;<br>
* &lt;image_link&gt;example.com/images/1006.jpg&lt;/image_link&gt;</font></td>
*
* </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>
* </tr>
* <tr valign="top">
* <td width="120"><font size="-1"><b>Content type</b></font></td>
*
* <td><font size="-1"> url</font></td>
* </tr>
*
* </tbody>
* </table>
*
* @param imageLinks URLs to images. Limit 10.
*/
public void setImageLinks(URL[] imageLinks);
/**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>
*
* </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>
*
* </tr>
* <tr valign="top">
* <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>
*
* &lt;image_link&gt;http://example.com/i/6.jpg,http://example.com/i/9.jpg&lt;/image_link&gt;<br>
*
* <em>Not acceptable:</em><br>
* &lt;image_link&gt;/images/1006.jpg&lt;/image_link&gt;<br>
* &lt;image_link&gt;example.com/images/1006.jpg&lt;/image_link&gt;</font></td>
*
* </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>
* </tr>
* <tr valign="top">
* <td width="120"> <font size="-1"><b>Content type</b></font></td>
*
* <td><font size="-1"> url</font></td>
* </tr>
*
* </tbody></table>
/**
* 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>
*
* </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>
*
* </tr>
* <tr valign="top">
* <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>
*
* &lt;image_link&gt;http://example.com/i/6.jpg,http://example.com/i/9.jpg&lt;/image_link&gt;<br>
*
* <em>Not acceptable:</em><br>
* &lt;image_link&gt;/images/1006.jpg&lt;/image_link&gt;<br>
* &lt;image_link&gt;example.com/images/1006.jpg&lt;/image_link&gt;</font></td>
*
* </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>
* </tr>
* <tr valign="top">
* <td width="120"><font size="-1"><b>Content type</b></font></td>
*
* <td><font size="-1"> url</font></td>
* </tr>
*
* </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">
*
* <td colspan="2" bgcolor="#dddddd" valign="top">
* <font size="-1"><b><a name="label"></a>label</b></font></td>
* <tbody>
* <tr valign="top">
*
* <td colspan="2" bgcolor="#dddddd" valign="top">
* <font size="-1"><b><a name="label"></a>label</b></font></td>
* </tr>
* <tr valign="top">
* <td width="120">
*
* <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;
*
* 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>
* <td width="120">
*
* <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;
*
* 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">
* <td width="120">
* <font size="-1"><b>Example</b></font></td>
* <td>
*
* <font size="-1"><em>Acceptable:<br>
* <td width="120">
* <font size="-1"><b>Example</b></font></td>
* <td>
*
* <font size="-1"><em>Acceptable:<br>
* For an automobile in a Vehicles information type:</em><br>
* </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;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 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;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; leater, power locks, sunroof, ABS &lt;/g:label&gt;</font></td>
* </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;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 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;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; 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>
* <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">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 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">
*
* <td colspan="2" bgcolor="#dddddd" valign="top">
* <font size="-1"><b><a name="label"></a>label</b></font></td>
* <tbody>
* <tr valign="top">
*
* <td colspan="2" bgcolor="#dddddd" valign="top">
* <font size="-1"><b><a name="label"></a>label</b></font></td>
* </tr>
* <tr valign="top">
* <td width="120">
*
* <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;
*
* 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>
* <td width="120">
*
* <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;
*
* 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">
* <td width="120">
* <font size="-1"><b>Example</b></font></td>
* <td>
*
* <font size="-1"><em>Acceptable:<br>
* <td width="120">
* <font size="-1"><b>Example</b></font></td>
* <td>
*
* <font size="-1"><em>Acceptable:<br>
* For an automobile in a Vehicles information type:</em><br>
* </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;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 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;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; leater, power locks, sunroof, ABS &lt;/g:label&gt;</font></td>
* </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;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 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;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; 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>
* <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">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 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

File diff suppressed because it is too large Load diff

File diff suppressed because it is too large Load diff

File diff suppressed because it is too large Load diff

View file

@ -41,11 +41,9 @@ package org.rometools.feed.module.base;
import java.util.Date;
/**
* 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 $
*/
@ -53,39 +51,34 @@ 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><font size="-1">
* Author of the item.</font></td>
* <td width="120"><font size="-1"> <b>Details</b></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><font size="-1"> &lt;g:author&gt;John Steinbeck&lt;/g:author&gt;</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,215 +86,198 @@ 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><font size="-1">
* Author of the item.</font></td>
* <td width="120"><font size="-1"> <b>Details</b></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><font size="-1"> &lt;g:author&gt;John Steinbeck&lt;/g:author&gt;</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();
/**
* Number of pages in the article.
*
*
* <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><font size="-1">
*
* The number of pages in the publication.</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><font size="-1"> &lt;g:pages&gt;18&lt;/g:pages&gt;</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 width="120"><font size="-1">
*
* <b>Content type</b></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);
/**
* Number of pages in the article.
*
*
* <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><font size="-1">
*
* The number of pages in the publication.</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><font size="-1"> &lt;g:pages&gt;18&lt;/g:pages&gt;</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 width="120"><font size="-1">
*
* <b>Content type</b></font></td>
* <td><font size="-1"> integer</font></td>
* </tr>
* </tbody></table>
* </tbody>
* </table>
*
* @return Number of pages in the article
*/
public Integer getPages();
/**
* Name of the publication.
*
*
* <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>
* </tr>
*
*
* <tbody>
* <tr valign="top">
* <td width="120"><font size="-1">
* <b>Details</b></font></td>
* <td><font size="-1">
*
* Name of the publication.</font></td>
* <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><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><font size="-1"> &lt;g:publication_name&gt; Journal of Appropriate Technology&lt;/g:publication_name&gt;</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 width="120"><font size="-1">
*
* <b>Content type</b></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);
/**
* Name of the publication.
*
*
* <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>
* </tr>
*
*
* <tbody>
* <tr valign="top">
* <td width="120"><font size="-1">
* <b>Details</b></font></td>
* <td><font size="-1">
*
* Name of the publication.</font></td>
* <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><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><font size="-1"> &lt;g:publication_name&gt; Journal of Appropriate Technology&lt;/g:publication_name&gt;</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 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 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">
*
* <td colspan="2" bgcolor="#dddddd"><font size="-1">
* <b><a name="publication_volume"></a>publication_volume</b></font></td>
* <tbody>
* <tr valign="top">
*
* <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><font size="-1">
*
* Volume of the publication.</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><font size="-1">&lt;g:publication_volume&gt;VI&lt;/g:publication_volume&gt;</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><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 publicationVolume Volume of the publication.
*/
public void setPublicationVolume(String publicationVolume);
@ -351,131 +323,125 @@ public interface ScholarlyArticle extends GlobalInterface {
/**
* Volume of the publication.
* <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_volume"></a>publication_volume</b></font></td>
* <tbody>
* <tr valign="top">
*
* <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><font size="-1">
*
* Volume of the publication.</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><font size="-1">&lt;g:publication_volume&gt;VI&lt;/g:publication_volume&gt;</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><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 Volume of the publication.
*/
public String getPublicationVolume();
/**
* 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:
* YYYY-MM-DD</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:
* 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:publish_date&gt;2005-12-20&lt;/g:publish_date&gt;</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><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><font size="-1">
*
* date</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 publishDate Date article was published
*/
public void setPublishDate(Date publishDate);
/**
* Date article was published.
*
* 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:
* YYYY-MM-DD</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:
* 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:publish_date&gt;2005-12-20&lt;/g:publish_date&gt;</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><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><font size="-1">
*
* date</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 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.
*
* @author <a href="mailto:cooper@screaming-penguin.com">Robert "kebernet"
* Cooper</a>
* 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>
*/
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,214 +41,205 @@ 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 $
*/
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>
* </tr>
* <tr valign="top">
* <td width="120"> <font size="-1"><b>Details</b></font></td>
*
* <td> <font size="-1">Additional instructions to explain the items delivery process.</font></td>
* </tr>
* <tr valign="top">
* <td width="120"><font size="-1"><b>Example</b></font></td>
* <td>
* <font size="-1">&lt;g:delivery_notes&gt;Items usually shipped within 24 hours.&lt;g:/delivery_notes&gt;<br>
*
* </font></td>
*
* </tr>
* <tr valign="top">
* <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>
* </tr>
* <tr valign="top">
* <td width="120"> <font size="-1"><b>Content
* type</b></font></td>
*
* <td> <font size="-1">string</font></td>
* </tr>
* </tbody></table>
*
* <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>
* </tr>
* <tr valign="top">
* <td width="120"><font size="-1"><b>Details</b></font></td>
*
* <td><font size="-1">Additional instructions to explain the items delivery process.</font></td>
* </tr>
* <tr valign="top">
* <td width="120"><font size="-1"><b>Example</b></font></td>
* <td>
* <font size="-1">&lt;g:delivery_notes&gt;Items usually shipped within 24 hours.&lt;g:/delivery_notes&gt;<br>
*
* </font></td>
*
* </tr>
* <tr valign="top">
* <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>
* </tr>
* <tr valign="top">
* <td width="120"><font size="-1"><b>Content type</b></font></td>
*
* <td><font size="-1">string</font></td>
* </tr>
* </tbody>
* </table>
*
* @param deliveryNotes Additional instructions to explain the items delivery process.
*/
public void setDeliveryNotes(String deliveryNotes);
/**
* 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>
* </tr>
* <tr valign="top">
* <td width="120"> <font size="-1"><b>Details</b></font></td>
*
* <td> <font size="-1">Additional instructions to explain the items delivery process.</font></td>
* </tr>
* <tr valign="top">
* <td width="120"><font size="-1"><b>Example</b></font></td>
* <td>
* <font size="-1">&lt;g:delivery_notes&gt;Items usually shipped within 24 hours.&lt;g:/delivery_notes&gt;<br>
*
* </font></td>
*
* </tr>
* <tr valign="top">
* <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>
* </tr>
* <tr valign="top">
* <td width="120"> <font size="-1"><b>Content
* type</b></font></td>
*
* <td> <font size="-1">string</font></td>
* </tr>
* </tbody></table>
*
* <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>
* </tr>
* <tr valign="top">
* <td width="120"><font size="-1"><b>Details</b></font></td>
*
* <td><font size="-1">Additional instructions to explain the items delivery process.</font></td>
* </tr>
* <tr valign="top">
* <td width="120"><font size="-1"><b>Example</b></font></td>
* <td>
* <font size="-1">&lt;g:delivery_notes&gt;Items usually shipped within 24 hours.&lt;g:/delivery_notes&gt;<br>
*
* </font></td>
*
* </tr>
* <tr valign="top">
* <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>
* </tr>
* <tr valign="top">
* <td width="120"><font size="-1"><b>Content type</b></font></td>
*
* <td><font size="-1">string</font></td>
* </tr>
* </tbody>
* </table>
*
* @return Additional instructions to explain the items delivery process.
*/
public String getDeliveryNotes();
/**
* 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>
*
* </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>
* </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>
* </tr>
* <tr valign="top">
* <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>
* </tr>
* <tr valign="top">
* <td width="120"> <font size="-1"><b>Content
* type</b></font></td>
* <td> <font size="-1">floatUnit</font></td>
* </tr>
*
* </tbody></table>
* <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>
*
* </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>
* </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>
* </tr>
* <tr valign="top">
* <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>
* </tr>
* <tr valign="top">
* <td width="120"><font size="-1"><b>Content type</b></font></td>
* <td><font size="-1">floatUnit</font></td>
* </tr>
*
* </tbody>
* </table>
*
* @param deliveryRadius The maximum distance you will deliver an item in any direction.
*/
public void setDeliveryRadius(FloatUnit deliveryRadius);
/**
* 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>
*
* </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>
* </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>
* </tr>
* <tr valign="top">
* <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>
* </tr>
* <tr valign="top">
* <td width="120"> <font size="-1"><b>Content
* type</b></font></td>
* <td> <font size="-1">floatUnit</font></td>
* </tr>
*
* </tbody></table>
* <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>
*
* </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>
* </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>
* </tr>
* <tr valign="top">
* <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>
* </tr>
* <tr valign="top">
* <td width="120"><font size="-1"><b>Content type</b></font></td>
* <td><font size="-1">floatUnit</font></td>
* </tr>
*
* </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">
*
* <td colspan="2" bgcolor="#dddddd" valign="top"><font size="-1">
* <b><a name="location"></a>location</b></font></td>
* <tbody>
* <tr valign="top">
*
* <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><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 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>
*
* <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">
*
* <td colspan="2" bgcolor="#dddddd" valign="top"><font size="-1">
* <b><a name="location"></a>location</b></font></td>
* <tbody>
* <tr valign="top">
*
* <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><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 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>
*
* <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,85 +28,98 @@ 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 $
* @author <a href="mailto:cooper@screaming-penguin.com">Robert "kebernet" Cooper</a>
*/
public class CustomTagParser implements ModuleParser {
public class CustomTagParser implements ModuleParser {
private static final Logger log = Logger.getAnonymousLogger();
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 ){
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( "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( "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( "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( "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 );
}
} catch(Exception e){
log.log( Level.WARNING, "Unable to parse type on "+child.getName(), e );
}
}
}
module.setValues( tags );
return module;
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 (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 (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 (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 (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 {
throw new Exception("Unknown type: " + type);
}
} catch (final Exception e) {
log.log(Level.WARNING, "Unable to parse type on " + child.getName(), e);
}
}
}
module.setValues(tags);
return module;
}
public String getNamespaceUri() {
return CustomTags.URI;
return CustomTags.URI;
}
}

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,111 +62,101 @@ import org.rometools.feed.module.base.types.ShortDate;
import org.rometools.feed.module.base.types.Size;
import org.rometools.feed.module.base.types.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;
/**
*
*
* @author <a href="mailto:cooper@screaming-penguin.com">Robert "kebernet" Cooper
* @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() {
super();
super();
}
public String getNamespaceUri() {
return GoogleBase.URI;
return GoogleBase.URI;
}
public Set getNamespaces() {
HashSet set = new HashSet();
set.add(GoogleBaseGenerator.NS);
return set;
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;
for(int i = 0; i < pds.length; i++) {
String tagName = (String)props2tags.get(pds[i].getName());
if(tagName == null) {
continue;
}
Object[] values = null;
try {
if(pds[i].getPropertyType().isArray()) {
values = (Object[])pds[i].getReadMethod().invoke(mod,(Object[])null);
} else {
values = new Object[] {
pds[i].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));
}
}
} catch(Exception e) {
e.printStackTrace();
}
}
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 (final PropertyDescriptor pd : pds) {
final String tagName = (String) props2tags.get(pd.getName());
if (tagName == null) {
continue;
}
Object[] values = null;
try {
if (pd.getPropertyType().isArray()) {
values = (Object[]) pd.getReadMethod().invoke(mod, (Object[]) null);
} else {
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(generateTag(values[j], tagName));
}
}
} 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);
element.addContent(this.generateSimpleElement("country",st.getCountry()));
element.addContent(this.generateSimpleElement("service", st.getService().toString() ));
element.addContent(this.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())));
return element;
}
throw new RuntimeException("Unknown class type to handle: " + o.getClass().getName());
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(generateSimpleElement("country", st.getCountry()));
element.addContent(generateSimpleElement("service", st.getService().toString()));
element.addContent(generateSimpleElement("price", st.getPrice().toString()));
return element;
} 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;
}
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);
element.addContent(value);
return element;
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,558 +41,559 @@ package org.rometools.feed.module.base.types;
import java.util.HashMap;
/**
* An Enumeration of valid currency types.
*
*
* @author <a href="mailto:cooper@screaming-penguin.com">Robert "kebernet" Cooper</a>
* @version $Revision: 1.1 $
*/
public class CurrencyEnumeration {
private static final HashMap lookup = new HashMap();
//<xs:restriction base="xs:string">
// <xs:enumeration value="AED"/>
// <xs:restriction base="xs:string">
// <xs:enumeration value="AED"/>
public static final CurrencyEnumeration AED = new CurrencyEnumeration("AED");
// <xs:enumeration value="AFA"/>
// <xs:enumeration value="AFA"/>
public static final CurrencyEnumeration AFA = new CurrencyEnumeration("AFA");
// <xs:enumeration value="ALL"/>
// <xs:enumeration value="ALL"/>
public static final CurrencyEnumeration ALL = new CurrencyEnumeration("ALL");
// <xs:enumeration value="AMD"/>
// <xs:enumeration value="AMD"/>
public static final CurrencyEnumeration AMD = new CurrencyEnumeration("AMD");
// <xs:enumeration value="ANG"/>
// <xs:enumeration value="ANG"/>
public static final CurrencyEnumeration ANG = new CurrencyEnumeration("ANG");
// <xs:enumeration value="AOA"/>
// <xs:enumeration value="AOA"/>
public static final CurrencyEnumeration AOA = new CurrencyEnumeration("AOA");
// <xs:enumeration value="ARS"/>
// <xs:enumeration value="ARS"/>
public static final CurrencyEnumeration ARS = new CurrencyEnumeration("ARS");
// <xs:enumeration value="AUD"/>
// <xs:enumeration value="AUD"/>
public static final CurrencyEnumeration AUD = new CurrencyEnumeration("AUD");
// <xs:enumeration value="AWG"/>
// <xs:enumeration value="AWG"/>
public static final CurrencyEnumeration AWG = new CurrencyEnumeration("AWG");
// <xs:enumeration value="AZM"/>
// <xs:enumeration value="AZM"/>
public static final CurrencyEnumeration AZM = new CurrencyEnumeration("AZM");
// <xs:enumeration value="BAM"/>
// <xs:enumeration value="BAM"/>
public static final CurrencyEnumeration BAM = new CurrencyEnumeration("BAM");
// <xs:enumeration value="BBD"/>
// <xs:enumeration value="BBD"/>
public static final CurrencyEnumeration BBD = new CurrencyEnumeration("BBD");
// <xs:enumeration value="BDT"/>
// <xs:enumeration value="BDT"/>
public static final CurrencyEnumeration BDT = new CurrencyEnumeration("BDT");
// <xs:enumeration value="BGN"/>
// <xs:enumeration value="BGN"/>
public static final CurrencyEnumeration BGN = new CurrencyEnumeration("BGN");
// <xs:enumeration value="BHD"/>
// <xs:enumeration value="BHD"/>
public static final CurrencyEnumeration BHD = new CurrencyEnumeration("BHD");
// <xs:enumeration value="BIF"/>
// <xs:enumeration value="BIF"/>
public static final CurrencyEnumeration BIF = new CurrencyEnumeration("BIF");
// <xs:enumeration value="BMD"/>
// <xs:enumeration value="BMD"/>
public static final CurrencyEnumeration BMD = new CurrencyEnumeration("BMD");
// <xs:enumeration value="BND"/>
// <xs:enumeration value="BND"/>
public static final CurrencyEnumeration BND = new CurrencyEnumeration("BND");
// <xs:enumeration value="BOB"/>
// <xs:enumeration value="BOB"/>
public static final CurrencyEnumeration BOB = new CurrencyEnumeration("BOB");
// <xs:enumeration value="BRL"/>
// <xs:enumeration value="BRL"/>
public static final CurrencyEnumeration BRL = new CurrencyEnumeration("BRL");
// <xs:enumeration value="BSD"/>
// <xs:enumeration value="BSD"/>
public static final CurrencyEnumeration BSD = new CurrencyEnumeration("BSD");
// <xs:enumeration value="BTN"/>
// <xs:enumeration value="BTN"/>
public static final CurrencyEnumeration BTN = new CurrencyEnumeration("BTN");
// <xs:enumeration value="BWP"/>
// <xs:enumeration value="BWP"/>
public static final CurrencyEnumeration BWP = new CurrencyEnumeration("BWP");
// <xs:enumeration value="BYR"/>
// <xs:enumeration value="BYR"/>
public static final CurrencyEnumeration BYR = new CurrencyEnumeration("BYR");
// <xs:enumeration value="BZD"/>
// <xs:enumeration value="BZD"/>
public static final CurrencyEnumeration BZD = new CurrencyEnumeration("BZD");
// <xs:enumeration value="CAD"/>
// <xs:enumeration value="CAD"/>
public static final CurrencyEnumeration CAD = new CurrencyEnumeration("CAD");
// <xs:enumeration value="CDF"/>
// <xs:enumeration value="CDF"/>
public static final CurrencyEnumeration CDF = new CurrencyEnumeration("CDF");
// <xs:enumeration value="CHF"/>
// <xs:enumeration value="CHF"/>
public static final CurrencyEnumeration CHF = new CurrencyEnumeration("CHF");
// <xs:enumeration value="CLP"/>
// <xs:enumeration value="CLP"/>
public static final CurrencyEnumeration CLP = new CurrencyEnumeration("CLP");
// <xs:enumeration value="CNY"/>
// <xs:enumeration value="CNY"/>
public static final CurrencyEnumeration CNY = new CurrencyEnumeration("CNY");
// <xs:enumeration value="CRC"/>
// <xs:enumeration value="CRC"/>
public static final CurrencyEnumeration CRC = new CurrencyEnumeration("CRC");
// <xs:enumeration value="CSD"/>
// <xs:enumeration value="CSD"/>
public static final CurrencyEnumeration CSD = new CurrencyEnumeration("CSD");
// <xs:enumeration value="CUP"/>
// <xs:enumeration value="CUP"/>
public static final CurrencyEnumeration CUP = new CurrencyEnumeration("CUP");
// <xs:enumeration value="CVE"/>
// <xs:enumeration value="CVE"/>
public static final CurrencyEnumeration CVE = new CurrencyEnumeration("CVE");
// <xs:enumeration value="CYP"/>
// <xs:enumeration value="CYP"/>
public static final CurrencyEnumeration CYP = new CurrencyEnumeration("CYP");
// <xs:enumeration value="CZK"/>
// <xs:enumeration value="CZK"/>
public static final CurrencyEnumeration CZK = new CurrencyEnumeration("CZK");
// <xs:enumeration value="DJF"/>
// <xs:enumeration value="DJF"/>
public static final CurrencyEnumeration DJF = new CurrencyEnumeration("DJF");
// <xs:enumeration value="DKK"/>
// <xs:enumeration value="DKK"/>
public static final CurrencyEnumeration DKK = new CurrencyEnumeration("DKK");
// <xs:enumeration value="DOP"/>
// <xs:enumeration value="DOP"/>
public static final CurrencyEnumeration DOP = new CurrencyEnumeration("DOP");
// <xs:enumeration value="DZD"/>
// <xs:enumeration value="DZD"/>
public static final CurrencyEnumeration DZD = new CurrencyEnumeration("DZD");
// <xs:enumeration value="EEK"/>
// <xs:enumeration value="EEK"/>
public static final CurrencyEnumeration EEK = new CurrencyEnumeration("EEK");
// <xs:enumeration value="EGP"/>
// <xs:enumeration value="EGP"/>
public static final CurrencyEnumeration EGP = new CurrencyEnumeration("EGP");
// <xs:enumeration value="ERN"/>
// <xs:enumeration value="ERN"/>
public static final CurrencyEnumeration ERN = new CurrencyEnumeration("ERN");
// <xs:enumeration value="ETB"/>
// <xs:enumeration value="ETB"/>
public static final CurrencyEnumeration ETB = new CurrencyEnumeration("ETB");
// <xs:enumeration value="EUR"/>
// <xs:enumeration value="EUR"/>
public static final CurrencyEnumeration EUR = new CurrencyEnumeration("EUR");
// <xs:enumeration value="FJD"/>
// <xs:enumeration value="FJD"/>
public static final CurrencyEnumeration FJD = new CurrencyEnumeration("FJD");
// <xs:enumeration value="FKP"/>
// <xs:enumeration value="FKP"/>
public static final CurrencyEnumeration FKP = new CurrencyEnumeration("FKP");
// <xs:enumeration value="GBP"/>
// <xs:enumeration value="GBP"/>
public static final CurrencyEnumeration GBP = new CurrencyEnumeration("GBP");
// <xs:enumeration value="GEL"/>
// <xs:enumeration value="GEL"/>
public static final CurrencyEnumeration GEL = new CurrencyEnumeration("GEL");
// <xs:enumeration value="GGP"/>
// <xs:enumeration value="GGP"/>
public static final CurrencyEnumeration GGP = new CurrencyEnumeration("GGP");
// <xs:enumeration value="GHC"/>
// <xs:enumeration value="GHC"/>
public static final CurrencyEnumeration GHC = new CurrencyEnumeration("GHC");
// <xs:enumeration value="GIP"/>
// <xs:enumeration value="GIP"/>
public static final CurrencyEnumeration GIP = new CurrencyEnumeration("GIP");
// <xs:enumeration value="GMD"/>
// <xs:enumeration value="GMD"/>
public static final CurrencyEnumeration GMD = new CurrencyEnumeration("GMD");
// <xs:enumeration value="GNF"/>
// <xs:enumeration value="GNF"/>
public static final CurrencyEnumeration GNF = new CurrencyEnumeration("GNF");
// <xs:enumeration value="GTQ"/>
// <xs:enumeration value="GTQ"/>
public static final CurrencyEnumeration GTQ = new CurrencyEnumeration("GTQ");
// <xs:enumeration value="GYD"/>
// <xs:enumeration value="GYD"/>
public static final CurrencyEnumeration GYD = new CurrencyEnumeration("GYD");
// <xs:enumeration value="HKD"/>
// <xs:enumeration value="HKD"/>
public static final CurrencyEnumeration HKD = new CurrencyEnumeration("HKD");
// <xs:enumeration value="HNL"/>
// <xs:enumeration value="HNL"/>
public static final CurrencyEnumeration HNL = new CurrencyEnumeration("HNL");
// <xs:enumeration value="HRK"/>
// <xs:enumeration value="HRK"/>
public static final CurrencyEnumeration HRK = new CurrencyEnumeration("HRK");
// <xs:enumeration value="HTG"/>
// <xs:enumeration value="HTG"/>
public static final CurrencyEnumeration HTG = new CurrencyEnumeration("HTG");
// <xs:enumeration value="HUF"/>
// <xs:enumeration value="HUF"/>
public static final CurrencyEnumeration HUF = new CurrencyEnumeration("HUF");
// <xs:enumeration value="IDR"/>
// <xs:enumeration value="IDR"/>
public static final CurrencyEnumeration IDR = new CurrencyEnumeration("IDR");
// <xs:enumeration value="ILS"/>
// <xs:enumeration value="ILS"/>
public static final CurrencyEnumeration ILS = new CurrencyEnumeration("ILS");
// <xs:enumeration value="IMP"/>
// <xs:enumeration value="IMP"/>
public static final CurrencyEnumeration IMP = new CurrencyEnumeration("IMP");
// <xs:enumeration value="INR"/>
// <xs:enumeration value="INR"/>
public static final CurrencyEnumeration INR = new CurrencyEnumeration("INR");
// <xs:enumeration value="IQD"/>
// <xs:enumeration value="IQD"/>
public static final CurrencyEnumeration IQD = new CurrencyEnumeration("IQD");
// <xs:enumeration value="IRR"/>
// <xs:enumeration value="IRR"/>
public static final CurrencyEnumeration IRR = new CurrencyEnumeration("IRR");
// <xs:enumeration value="ISK"/>
// <xs:enumeration value="ISK"/>
public static final CurrencyEnumeration ISK = new CurrencyEnumeration("ISK");
// <xs:enumeration value="JEP"/>
// <xs:enumeration value="JEP"/>
public static final CurrencyEnumeration JEP = new CurrencyEnumeration("JEP");
// <xs:enumeration value="JMD"/>
// <xs:enumeration value="JMD"/>
public static final CurrencyEnumeration JMD = new CurrencyEnumeration("JMD");
// <xs:enumeration value="JOD"/>
// <xs:enumeration value="JOD"/>
public static final CurrencyEnumeration JOD = new CurrencyEnumeration("JOD");
// <xs:enumeration value="JPY"/>
// <xs:enumeration value="JPY"/>
public static final CurrencyEnumeration JPY = new CurrencyEnumeration("JPY");
// <xs:enumeration value="KES"/>
// <xs:enumeration value="KES"/>
public static final CurrencyEnumeration KES = new CurrencyEnumeration("KES");
// <xs:enumeration value="KGS"/>
// <xs:enumeration value="KGS"/>
public static final CurrencyEnumeration KGS = new CurrencyEnumeration("KGS");
// <xs:enumeration value="KHR"/>
// <xs:enumeration value="KHR"/>
public static final CurrencyEnumeration KHR = new CurrencyEnumeration("KHR");
// <xs:enumeration value="KMF"/>
// <xs:enumeration value="KMF"/>
public static final CurrencyEnumeration KMF = new CurrencyEnumeration("KMF");
// <xs:enumeration value="KPW"/>
// <xs:enumeration value="KPW"/>
public static final CurrencyEnumeration KPW = new CurrencyEnumeration("KPW");
// <xs:enumeration value="KRW"/>
// <xs:enumeration value="KRW"/>
public static final CurrencyEnumeration KRW = new CurrencyEnumeration("KRW");
// <xs:enumeration value="KWD"/>
// <xs:enumeration value="KWD"/>
public static final CurrencyEnumeration KWD = new CurrencyEnumeration("KWD");
// <xs:enumeration value="KYD"/>
// <xs:enumeration value="KYD"/>
public static final CurrencyEnumeration KYD = new CurrencyEnumeration("KYD");
// <xs:enumeration value="KZT"/>
// <xs:enumeration value="KZT"/>
public static final CurrencyEnumeration KZT = new CurrencyEnumeration("KZT");
// <xs:enumeration value="LAK"/>
// <xs:enumeration value="LAK"/>
public static final CurrencyEnumeration LAK = new CurrencyEnumeration("LAK");
// <xs:enumeration value="LBP"/>
// <xs:enumeration value="LBP"/>
public static final CurrencyEnumeration LBP = new CurrencyEnumeration("LBP");
// <xs:enumeration value="LKR"/>
// <xs:enumeration value="LKR"/>
public static final CurrencyEnumeration LKR = new CurrencyEnumeration("LKR");
// <xs:enumeration value="LRD"/>
// <xs:enumeration value="LRD"/>
public static final CurrencyEnumeration LRD = new CurrencyEnumeration("LRD");
// <xs:enumeration value="LSL"/>
// <xs:enumeration value="LSL"/>
public static final CurrencyEnumeration LSL = new CurrencyEnumeration("LSL");
// <xs:enumeration value="LTL"/>
// <xs:enumeration value="LTL"/>
public static final CurrencyEnumeration LTL = new CurrencyEnumeration("LTL");
// <xs:enumeration value="LVL"/>
// <xs:enumeration value="LVL"/>
public static final CurrencyEnumeration LVL = new CurrencyEnumeration("LVL");
// <xs:enumeration value="LYD"/>
// <xs:enumeration value="LYD"/>
public static final CurrencyEnumeration LYD = new CurrencyEnumeration("LYD");
// <xs:enumeration value="MAD"/>
// <xs:enumeration value="MAD"/>
public static final CurrencyEnumeration MAD = new CurrencyEnumeration("MAD");
// <xs:enumeration value="MDL"/>
// <xs:enumeration value="MDL"/>
public static final CurrencyEnumeration MDL = new CurrencyEnumeration("MDL");
// <xs:enumeration value="MGA"/>
// <xs:enumeration value="MGA"/>
public static final CurrencyEnumeration MGA = new CurrencyEnumeration("MGA");
// <xs:enumeration value="MKD"/>
// <xs:enumeration value="MKD"/>
public static final CurrencyEnumeration MKD = new CurrencyEnumeration("MKD");
// <xs:enumeration value="MMK"/>
// <xs:enumeration value="MMK"/>
public static final CurrencyEnumeration MMK = new CurrencyEnumeration("MMK");
// <xs:enumeration value="MNT"/>
// <xs:enumeration value="MNT"/>
public static final CurrencyEnumeration MNT = new CurrencyEnumeration("MNT");
// <xs:enumeration value="MOP"/>
// <xs:enumeration value="MOP"/>
public static final CurrencyEnumeration MOP = new CurrencyEnumeration("MOP");
// <xs:enumeration value="MRO"/>
// <xs:enumeration value="MRO"/>
public static final CurrencyEnumeration MRO = new CurrencyEnumeration("MRO");
// <xs:enumeration value="MTL"/>
// <xs:enumeration value="MTL"/>
public static final CurrencyEnumeration MTL = new CurrencyEnumeration("MTL");
// <xs:enumeration value="MUR"/>
// <xs:enumeration value="MUR"/>
public static final CurrencyEnumeration MUR = new CurrencyEnumeration("MUR");
// <xs:enumeration value="MVR"/>
// <xs:enumeration value="MVR"/>
public static final CurrencyEnumeration MVR = new CurrencyEnumeration("MVR");
// <xs:enumeration value="MWK"/>
// <xs:enumeration value="MWK"/>
public static final CurrencyEnumeration MWK = new CurrencyEnumeration("MWK");
// <xs:enumeration value="MXN"/>
// <xs:enumeration value="MXN"/>
public static final CurrencyEnumeration MXN = new CurrencyEnumeration("MXN");
// <xs:enumeration value="MYR"/>
// <xs:enumeration value="MYR"/>
public static final CurrencyEnumeration MYR = new CurrencyEnumeration("MYR");
// <xs:enumeration value="MZM"/>
// <xs:enumeration value="MZM"/>
public static final CurrencyEnumeration MZM = new CurrencyEnumeration("MZM");
// <xs:enumeration value="NAD"/>
// <xs:enumeration value="NAD"/>
public static final CurrencyEnumeration NAD = new CurrencyEnumeration("NAD");
// <xs:enumeration value="NGN"/>
// <xs:enumeration value="NGN"/>
public static final CurrencyEnumeration NGN = new CurrencyEnumeration("NGN");
// <xs:enumeration value="NIO"/>
// <xs:enumeration value="NIO"/>
public static final CurrencyEnumeration NIO = new CurrencyEnumeration("NIO");
// <xs:enumeration value="NOK"/>
// <xs:enumeration value="NOK"/>
public static final CurrencyEnumeration NOK = new CurrencyEnumeration("NOK");
// <xs:enumeration value="NPR"/>
// <xs:enumeration value="NPR"/>
public static final CurrencyEnumeration NPR = new CurrencyEnumeration("NPR");
// <xs:enumeration value="NZD"/>
// <xs:enumeration value="NZD"/>
public static final CurrencyEnumeration NZD = new CurrencyEnumeration("NZD");
// <xs:enumeration value="OMR"/>
// <xs:enumeration value="OMR"/>
public static final CurrencyEnumeration OMR = new CurrencyEnumeration("OMR");
// <xs:enumeration value="PAB"/>
// <xs:enumeration value="PAB"/>
public static final CurrencyEnumeration PAB = new CurrencyEnumeration("PAB");
// <xs:enumeration value="PEN"/>
// <xs:enumeration value="PEN"/>
public static final CurrencyEnumeration PEN = new CurrencyEnumeration("PEN");
// <xs:enumeration value="PGK"/>
// <xs:enumeration value="PGK"/>
public static final CurrencyEnumeration PGK = new CurrencyEnumeration("PGK");
// <xs:enumeration value="PHP"/>
// <xs:enumeration value="PHP"/>
public static final CurrencyEnumeration PHP = new CurrencyEnumeration("PHP");
// <xs:enumeration value="PKR"/>
// <xs:enumeration value="PKR"/>
public static final CurrencyEnumeration PKR = new CurrencyEnumeration("PKR");
// <xs:enumeration value="PLN"/>
// <xs:enumeration value="PLN"/>
public static final CurrencyEnumeration PLN = new CurrencyEnumeration("PLN");
// <xs:enumeration value="PYG"/>
// <xs:enumeration value="PYG"/>
public static final CurrencyEnumeration PYG = new CurrencyEnumeration("PYG");
// <xs:enumeration value="QAR"/>
// <xs:enumeration value="QAR"/>
public static final CurrencyEnumeration QAR = new CurrencyEnumeration("QAR");
// <xs:enumeration value="RON"/>
// <xs:enumeration value="RON"/>
public static final CurrencyEnumeration RON = new CurrencyEnumeration("RON");
// <xs:enumeration value="RUB"/>
// <xs:enumeration value="RUB"/>
public static final CurrencyEnumeration RUB = new CurrencyEnumeration("RUB");
// <xs:enumeration value="RWF"/>
// <xs:enumeration value="RWF"/>
public static final CurrencyEnumeration RWF = new CurrencyEnumeration("MOP");
// <xs:enumeration value="SAR"/>
// <xs:enumeration value="SAR"/>
public static final CurrencyEnumeration SAR = new CurrencyEnumeration("SAR");
// <xs:enumeration value="SBD"/>
// <xs:enumeration value="SBD"/>
public static final CurrencyEnumeration SBD = new CurrencyEnumeration("SBD");
// <xs:enumeration value="SCR"/>
// <xs:enumeration value="SCR"/>
public static final CurrencyEnumeration SCR = new CurrencyEnumeration("SCR");
// <xs:enumeration value="SDD"/>
// <xs:enumeration value="SDD"/>
public static final CurrencyEnumeration SDD = new CurrencyEnumeration("SDD");
// <xs:enumeration value="SEK"/>
// <xs:enumeration value="SEK"/>
public static final CurrencyEnumeration SEK = new CurrencyEnumeration("SEK");
// <xs:enumeration value="SGD"/>
// <xs:enumeration value="SGD"/>
public static final CurrencyEnumeration SGD = new CurrencyEnumeration("SGD");
// <xs:enumeration value="SHP"/>
// <xs:enumeration value="SHP"/>
public static final CurrencyEnumeration SHP = new CurrencyEnumeration("SHP");
// <xs:enumeration value="SIT"/>
// <xs:enumeration value="SIT"/>
public static final CurrencyEnumeration SIT = new CurrencyEnumeration("SIT");
// <xs:enumeration value="SKK"/>
// <xs:enumeration value="SKK"/>
public static final CurrencyEnumeration SKK = new CurrencyEnumeration("SKK");
// <xs:enumeration value="SLL"/>
// <xs:enumeration value="SLL"/>
public static final CurrencyEnumeration SLL = new CurrencyEnumeration("SLL");
// <xs:enumeration value="SOS"/>
// <xs:enumeration value="SOS"/>
public static final CurrencyEnumeration SOS = new CurrencyEnumeration("SOS");
// <xs:enumeration value="SPL"/>
// <xs:enumeration value="SPL"/>
public static final CurrencyEnumeration SPL = new CurrencyEnumeration("SPL");
// <xs:enumeration value="SRD"/>
// <xs:enumeration value="SRD"/>
public static final CurrencyEnumeration SRD = new CurrencyEnumeration("SRD");
// <xs:enumeration value="STD"/>
// <xs:enumeration value="STD"/>
public static final CurrencyEnumeration STD = new CurrencyEnumeration("STD");
// <xs:enumeration value="SVC"/>
// <xs:enumeration value="SVC"/>
public static final CurrencyEnumeration SVC = new CurrencyEnumeration("SVC");
// <xs:enumeration value="SYP"/>
// <xs:enumeration value="SYP"/>
public static final CurrencyEnumeration SYP = new CurrencyEnumeration("SYP");
// <xs:enumeration value="SZL"/>
// <xs:enumeration value="SZL"/>
public static final CurrencyEnumeration SZL = new CurrencyEnumeration("SZL");
// <xs:enumeration value="THB"/>
// <xs:enumeration value="THB"/>
public static final CurrencyEnumeration THB = new CurrencyEnumeration("THB");
// <xs:enumeration value="TJS"/>
// <xs:enumeration value="TJS"/>
public static final CurrencyEnumeration TJS = new CurrencyEnumeration("TJS");
// <xs:enumeration value="TMM"/>
// <xs:enumeration value="TMM"/>
public static final CurrencyEnumeration TMM = new CurrencyEnumeration("TMM");
// <xs:enumeration value="TND"/>
// <xs:enumeration value="TND"/>
public static final CurrencyEnumeration TND = new CurrencyEnumeration("TND");
// <xs:enumeration value="TOP"/>
// <xs:enumeration value="TOP"/>
public static final CurrencyEnumeration TOP = new CurrencyEnumeration("TOP");
// <xs:enumeration value="TRL"/>
// <xs:enumeration value="TRL"/>
public static final CurrencyEnumeration TRL = new CurrencyEnumeration("TRL");
// <xs:enumeration value="TRY"/>
// <xs:enumeration value="TRY"/>
public static final CurrencyEnumeration TRY = new CurrencyEnumeration("TRY");
// <xs:enumeration value="TTD"/>
// <xs:enumeration value="TTD"/>
public static final CurrencyEnumeration TTD = new CurrencyEnumeration("TTD");
// <xs:enumeration value="TVD"/>
// <xs:enumeration value="TVD"/>
public static final CurrencyEnumeration TVD = new CurrencyEnumeration("TVD");
// <xs:enumeration value="TWD"/>
// <xs:enumeration value="TWD"/>
public static final CurrencyEnumeration TWD = new CurrencyEnumeration("TWD");
// <xs:enumeration value="TZS"/>
// <xs:enumeration value="TZS"/>
public static final CurrencyEnumeration TZS = new CurrencyEnumeration("TZS");
// <xs:enumeration value="UAH"/>
// <xs:enumeration value="UAH"/>
public static final CurrencyEnumeration UAH = new CurrencyEnumeration("UAH");
// <xs:enumeration value="UGX"/>
// <xs:enumeration value="UGX"/>
public static final CurrencyEnumeration UGX = new CurrencyEnumeration("UGX");
// <xs:enumeration value="USD"/>
// <xs:enumeration value="USD"/>
public static final CurrencyEnumeration USD = new CurrencyEnumeration("USD");
// <xs:enumeration value="UYU"/>
// <xs:enumeration value="UYU"/>
public static final CurrencyEnumeration UYU = new CurrencyEnumeration("UYU");
// <xs:enumeration value="UZS"/>
// <xs:enumeration value="UZS"/>
public static final CurrencyEnumeration UZS = new CurrencyEnumeration("UZS");
// <xs:enumeration value="VEB"/>
// <xs:enumeration value="VEB"/>
public static final CurrencyEnumeration VEB = new CurrencyEnumeration("VEB");
// <xs:enumeration value="VND"/>
// <xs:enumeration value="VND"/>
public static final CurrencyEnumeration VND = new CurrencyEnumeration("VND");
// <xs:enumeration value="VUV"/>
// <xs:enumeration value="VUV"/>
public static final CurrencyEnumeration VUV = new CurrencyEnumeration("VUV");
// <xs:enumeration value="WST"/>
// <xs:enumeration value="WST"/>
public static final CurrencyEnumeration WST = new CurrencyEnumeration("WST");
// <xs:enumeration value="XAF"/>
// <xs:enumeration value="XAF"/>
public static final CurrencyEnumeration XAF = new CurrencyEnumeration("XAF");
// <xs:enumeration value="XAG"/>
// <xs:enumeration value="XAG"/>
public static final CurrencyEnumeration XAG = new CurrencyEnumeration("XAG");
// <xs:enumeration value="XAU"/>
// <xs:enumeration value="XAU"/>
public static final CurrencyEnumeration XAU = new CurrencyEnumeration("XAU");
// <xs:enumeration value="XCD"/>
// <xs:enumeration value="XCD"/>
public static final CurrencyEnumeration XCD = new CurrencyEnumeration("XCD");
// <xs:enumeration value="XDR"/>
// <xs:enumeration value="XDR"/>
public static final CurrencyEnumeration XDR = new CurrencyEnumeration("XDR");
// <xs:enumeration value="XOF"/>
// <xs:enumeration value="XOF"/>
public static final CurrencyEnumeration XOF = new CurrencyEnumeration("XOF");
// <xs:enumeration value="XPD"/>
// <xs:enumeration value="XPD"/>
public static final CurrencyEnumeration XPD = new CurrencyEnumeration("XPD");
// <xs:enumeration value="XPF"/>
// <xs:enumeration value="XPF"/>
public static final CurrencyEnumeration XPF = new CurrencyEnumeration("XPF");
// <xs:enumeration value="XPT"/>
// <xs:enumeration value="XPT"/>
public static final CurrencyEnumeration XPT = new CurrencyEnumeration("XPT");
// <xs:enumeration value="YER"/>
// <xs:enumeration value="YER"/>
public static final CurrencyEnumeration YER = new CurrencyEnumeration("YER");
// <xs:enumeration value="ZAR"/>
// <xs:enumeration value="ZAR"/>
public static final CurrencyEnumeration ZAR = new CurrencyEnumeration("ZAR");
// <xs:enumeration value="ZMK"/>
// <xs:enumeration value="ZMK"/>
public static final CurrencyEnumeration ZMK = new CurrencyEnumeration("ZMK");
// <xs:enumeration value="ZWD"/>
// <xs:enumeration value="ZWD"/>
public static final CurrencyEnumeration ZWD = new CurrencyEnumeration("ZWD");
//</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,9 +41,9 @@ 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 )
return false;
DateTimeRange d = (DateTimeRange) o;
if( this.start == d.getStart() && this.end == d.getEnd() ){
return true;
}
if( this.start != null && !this.start.equals( d.getStart()) )
return false;
if( this.end != null && !this.end.equals( d.getEnd()) )
return false;
return true;
@Override
public boolean equals(final Object o) {
if (!(o instanceof DateTimeRange) || o == null) {
return false;
}
final DateTimeRange d = (DateTimeRange) o;
if (start == d.getStart() && end == d.getEnd()) {
return true;
}
if (start != null && !start.equals(d.getStart())) {
return false;
}
if (end != null && !end.equals(d.getEnd())) {
return false;
}
return true;
}
}

View file

@ -41,10 +41,9 @@ package org.rometools.feed.module.base.types;
import org.rometools.feed.module.base.io.GoogleBaseParser;
/** 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();
}
if (space != parse.length()) {
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,34 +130,40 @@ 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 ){
return false;
}
if( this.units == f.getUnits() || ( this.units != null && this.units.equals( f.getUnits() )) ){
return true;
}
return false;
@Override
public boolean equals(final Object o) {
if (!(o instanceof FloatUnit)) {
return false;
}
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,8 +39,9 @@
*/
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,27 +41,29 @@ 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>
* @version $Revision: 1.1 $
*/
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,28 +93,32 @@ 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 ){
return false;
}
if( this.units == f.getUnits() || ( this.units != null && this.units.equals( f.getUnits() )) ){
return true;
}
return false;
@Override
public boolean equals(final Object o) {
if (!(o instanceof IntUnit)) {
return false;
}
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

@ -42,7 +42,7 @@ package org.rometools.feed.module.base.types;
import java.util.HashMap;
/**
*
*
* @author <a href="mailto:cooper@screaming-penguin.com">Robert "kebernet" Cooper</a>
* @version $Revision: 1.1 $
*/
@ -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,32 +103,40 @@ 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;
return false;
@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.
*/
public static class ServiceEnumeration {
/**
/**
* Looks up a ServiceEnumeration based on the string value.
*/
private static final HashMap lookup = new HashMap();
@ -139,44 +152,49 @@ public class ShippingType implements CloneableType {
* Overnight
*/
public static final ServiceEnumeration OVERNIGHT = new ServiceEnumeration("Overnight");
/**
* 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,9 +41,9 @@ 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))
return false;
if( this.toString().equals( o.toString() ) )
return true;
return false;
@Override
public boolean equals(final Object o) {
if (!(o instanceof Size)) {
return false;
}
if (toString().equals(o.toString())) {
return true;
}
return false;
}
}

View file

@ -42,9 +42,9 @@ package org.rometools.feed.module.base.types;
import java.util.Calendar;
import java.util.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();
cal.setTime(date);
this.year = cal.get( Calendar.YEAR );
public YearType(final Date date) {
final Calendar cal = Calendar.getInstance();
cal.setTime(date);
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))
return false;
if( this.toString().equals( o.toString() ) )
return true;
return false;
@Override
public boolean equals(final Object o) {
if (!(o instanceof YearType)) {
return false;
}
if (toString().equals(o.toString())) {
return true;
}
return false;
}
}

View file

@ -40,20 +40,23 @@
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>
*/
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,86 +40,89 @@
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 $
* @author <a href="mailto:cooper@screaming-penguin.com">Robert "kebernet" Cooper</a>
*/
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 RSS1_URI = "http://web.resource.org/cc/";
private License[] allLicenses;
private License[] licenses;
protected Object arrayCopy(Object[] source) {
if(source == null) {
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 RSS1_URI = "http://web.resource.org/cc/";
private License[] allLicenses;
private License[] licenses;
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];
}
return array;
}
public License[] getAllLicenses() {
return allLicenses;
}
public void setAllLicenses(License[] allLicenses) {
public void setAllLicenses(final License[] allLicenses) {
this.allLicenses = allLicenses;
}
public Class getInterface() {
return CreativeCommons.class;
}
public Class getInterface() {
return CreativeCommons.class;
}
public String getUri() {
return CreativeCommons.URI;
return CreativeCommons.URI;
}
public Object clone() {
CreativeCommonsImpl clone = new CreativeCommonsImpl();
clone.copyFrom( this );
return clone;
@Override
public Object clone() {
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 );
return tsb.toString();
final ToStringBean tsb = new ToStringBean(CreativeCommonsImpl.class, this);
return tsb.toString();
}
}

View file

@ -40,103 +40,105 @@
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{
private static final Namespace RSS1 = Namespace.getNamespace( "cc", CreativeCommonsImpl.RSS1_URI );
private static final Namespace RSS2 = Namespace.getNamespace( "creativeCommons", CreativeCommonsImpl.RSS2_URI);
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 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);
}
/**
* Creates a new instance of CCModuleGenerator
*/
public CCModuleGenerator() {
super();
super();
}
public void generate(Module module, Element element) {
Element root = element;
while( root.getParentElement() != null ){
root = root.getParentElement();
}
if( root.getNamespace().equals( RDF )|| root.getNamespace().equals( RSS )){
generateRSS1( (CreativeCommons) module, element);
} else {
generateRSS2( (CreativeCommons) module, element);
}
public void generate(final Module module, final Element element) {
Element root = element;
while (root.getParentElement() != null) {
root = root.getParentElement();
}
if (root.getNamespace().equals(RDF) || root.getNamespace().equals(RSS)) {
generateRSS1((CreativeCommons) module, element);
} else {
generateRSS2((CreativeCommons) module, element);
}
}
public Set getNamespaces() {
return NAMESPACES;
return NAMESPACES;
}
public String getNamespaceUri() {
return CreativeCommons.URI;
return CreativeCommons.URI;
}
private void generateRSS1( CreativeCommons module, Element element ){
//throw new RuntimeException( "Generating RSS1 Feeds not currently Supported.");
System.out.println(element.getName());
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 );
}
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 );
}
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 );
}
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")) {
// Do all licenses list.
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);
}
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);
}
}
// 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,94 +40,96 @@
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 $
* @author <a href="mailto:cooper@screaming-penguin.com">Robert "kebernet" Cooper</a>
*/
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();
{
// Parsing Channel level.
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 )
continue;
License license = License.findByValue( licenseURI );
{
ArrayList permitsValues = new ArrayList();
ArrayList requiresValues = new ArrayList();
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) ));
}
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)));
}
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 );
}
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)));
}
if( licenses.size() > 0 ){
module.setLicenses( (License[]) licenses.toArray( new License[licenses.size()]));
}
if( module.getLicenses() != null || module.getAllLicenses() != null ){
return module;
} else {
return null;
}
public Module parse(final Element element) {
final CreativeCommonsImpl module = new CreativeCommonsImpl();
{
// Parsing Channel level.
Element root = element;
while (root.getParentElement() != null) {
root = root.getParentElement();
}
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);
{
final ArrayList permitsValues = new ArrayList();
final ArrayList requiresValues = new ArrayList();
final List permitsTags = licenseTag.getChildren("permits", NS);
Iterator sit = permitsTags.iterator();
while (sit.hasNext()) {
final Element permitTag = (Element) sit.next();
permitsValues.add(License.Behaviour.findByValue(permitTag.getAttributeValue("resource", RDF)));
}
final List requiresTags = licenseTag.getChildren("requires", NS);
sit = requiresTags.iterator();
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()]));
}
licenses.add(license);
}
module.setAllLicenses((License[]) licenses.toArray(new License[0]));
}
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 (module.getLicenses() != null || module.getAllLicenses() != null) {
return module;
} else {
return null;
}
}
public String getNamespaceUri() {
return CreativeCommonsImpl.RSS1_URI;
return CreativeCommonsImpl.RSS1_URI;
}
}

View file

@ -40,80 +40,85 @@
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 $
* @author <a href="mailto:cooper@screaming-penguin.com">Robert "kebernet" Cooper</a>
*/
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
{
Element root = element;
while( !root.getName().equals("channel") && !root.getName().equals("feed") )
root = root.getParentElement();
ArrayList licenses = new ArrayList();
List items = null;
if( root.getName().equals("channel"))
items = root.getChildren("item");
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 );
}
}
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() ));
}
if( licenses.size() > 0 ){
module.setLicenses( (License[]) licenses.toArray( new License[0]));
}
if( module.getLicenses() != null && module.getAllLicenses() != null ){
return module;
} else {
return null;
}
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")) {
root = root.getParentElement();
}
final ArrayList licenses = new ArrayList();
List items = null;
if (root.getName().equals("channel")) {
items = root.getChildren("item");
} else {
items = root.getChildren("entry");
}
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]));
}
}
// do element local
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 (module.getLicenses() != null && module.getAllLicenses() != null) {
return module;
} else {
return null;
}
}
public String getNamespaceUri() {
return CreativeCommonsImpl.RSS2_URI;
return CreativeCommonsImpl.RSS2_URI;
}
}

View file

@ -3,7 +3,7 @@
*
* Created on November 20, 2005, 3:20 PM
*
* 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,151 +53,135 @@ 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) {
this.requires = requires;
this.permits = permits;
this.uri = uri;
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);
}
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);
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);
//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() );
}
}
} catch(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 );
}
return found;
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
// 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) {
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 (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);
}
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 );
return tsb.toString();
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);
return eBean.beanEquals(obj);
@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);
return equals.beanHashCode();
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");
public static final Behaviour DISTRIBUTION = new Behaviour("http://web.resource.org/cc/Distribution");
public static final Behaviour DERIVATIVE = new Behaviour("http://web.resource.org/cc/DerivativeWorks");
public static final Behaviour NOTICE = new Behaviour("http://web.resource.org/cc/Notice");
public static final Behaviour ATTRIBUTION = new Behaviour("http://web.resource.org/cc/Attribution");
public static final Behaviour 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 Behaviour(String uri) {
this.uri = uri;
Behaviour.lookup.put(uri,this);
}
public static Behaviour findByValue(String uri) {
return (Behaviour)Behaviour.lookup.get(uri);
}
public String toString() {
return this.uri;
}
private static final HashMap lookup = new HashMap();
public static final Behaviour REPRODUCTION = new Behaviour("http://web.resource.org/cc/Reproduction");
public static final Behaviour DISTRIBUTION = new Behaviour("http://web.resource.org/cc/Distribution");
public static final Behaviour DERIVATIVE = new Behaviour("http://web.resource.org/cc/DerivativeWorks");
public static final Behaviour NOTICE = new Behaviour("http://web.resource.org/cc/Notice");
public static final Behaviour 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 final String uri;
private Behaviour(final String uri) {
this.uri = uri;
Behaviour.lookup.put(uri, this);
}
public static Behaviour findByValue(final String uri) {
return (Behaviour) Behaviour.lookup.get(uri);
}
@Override
public String toString() {
return uri;
}
}
}

View file

@ -43,11 +43,11 @@ 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>
* @author <a href="mailto:cooper@screaming-penguin.com">Robert "kebernet" Cooper</a>
*/
public class ContentItem implements Cloneable {
private String contentFormat;
@ -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,26 +40,28 @@
*/
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 $
* @author <a href="mailto:cooper@screaming-penguin.com">Robert "kebernet" Cooper</a>
* @author <a href="mailto:cooper@screaming-penguin.com">Robert "kebernet" Cooper</a>
*/
public interface ContentModule extends Module {
public 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,14 +43,14 @@
*/
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 $
* @author <a href="mailto:cooper@screaming-penguin.com">Robert "kebernet" Cooper</a>
* @author <a href="mailto:cooper@screaming-penguin.com">Robert "kebernet" Cooper</a>
*/
public class ContentModuleImpl extends com.sun.syndication.feed.module.ModuleImpl implements ContentModule {
private List encodeds;
@ -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,23 +41,23 @@
*/
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>
* @author <a href="mailto:cooper@screaming-penguin.com">Robert "kebernet" Cooper</a>
*/
public class ContentModuleGenerator implements com.sun.syndication.io.ModuleGenerator {
private static final Namespace CONTENT_NS = Namespace.getNamespace("content", ContentModule.URI);
@ -65,7 +65,7 @@ public class ContentModuleGenerator implements com.sun.syndication.io.ModuleGene
private static final Set NAMESPACES;
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,10 +88,10 @@ public class ContentModuleGenerator implements com.sun.syndication.io.ModuleGene
return;
}
ContentModule cm = (ContentModule) module;
final ContentModule cm = (ContentModule) module;
final List encodeds = cm.getEncodeds();
List encodeds = cm.getEncodeds();
//
if (encodeds != null) {
System.out.println(cm.getEncodeds().size());
@ -100,61 +100,60 @@ public class ContentModuleGenerator implements com.sun.syndication.io.ModuleGene
}
}
List contentItems = cm.getContentItems();
final List contentItems = cm.getContentItems();
if ((contentItems != null) && (contentItems.size() > 0)) {
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,20 +43,20 @@
*/
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>
* @author <a href="mailto:cooper@screaming-penguin.com">Robert "kebernet" Cooper</a>
*/
public class ContentModuleParser implements com.sun.syndication.io.ModuleParser {
private static final Namespace CONTENT_NS = Namespace.getNamespace("content", ContentModule.URI);
@ -70,45 +70,45 @@ public class ContentModuleParser implements com.sun.syndication.io.ModuleParser
return ContentModule.URI;
}
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

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

View file

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

View file

@ -16,24 +16,22 @@
*/
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.
*
*
* @version 1.0
* @author Georg Schmidl <georg.schmidl@scandio.de>
*
*
*/
public class FeedBurnerModuleGenerator implements ModuleGenerator {
private static final Namespace NS = Namespace.getNamespace("feedburner", FeedBurner.URI);
@ -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,22 +16,20 @@
*/
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.
*
*
* @version 1.0
* @author Georg Schmidl <georg.schmidl@scandio.de>
*
*
*/
public class FeedBurnerModuleParser implements ModuleParser {
private static final Namespace NS = Namespace.getNamespace(FeedBurner.URI);
@ -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,67 +16,78 @@
*/
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.
*
*
* @author Marc Wick
* @version $Id: GMLGenerator.java,v 1.1 2007/04/18 09:59:29 marcwick Exp $
*
*
*/
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;
}
/*
* (non-Javadoc)
*
* @see com.sun.syndication.io.ModuleGenerator#getNamespaceUri()
*/
/*
* (non-Javadoc)
*
* @see com.sun.syndication.io.ModuleGenerator#getNamespaceUri()
*/
public String getNamespaceUri() {
return GeoRSSModule.GEORSS_GML_URI;
}
/*
* (non-Javadoc)
*
* @see com.sun.syndication.io.ModuleGenerator#getNamespaces()
*/
/*
* (non-Javadoc)
*
* @see com.sun.syndication.io.ModuleGenerator#getNamespaces()
*/
public Set getNamespaces() {
return NAMESPACES;
}
/*
* (non-Javadoc)
*
* @see com.sun.syndication.io.ModuleGenerator#generate(com.sun.syndication.feed.module.Module,
* org.jdom.Element)
*/
public void generate(Module module, Element element) {
/*
* (non-Javadoc)
*
* @see com.sun.syndication.io.ModuleGenerator#generate(com.sun.syndication.feed.module.Module, org.jdom2.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;
@ -85,77 +96,74 @@ 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();
Element pointElement = new Element("Point", GeoRSSModule.GML_NS);
final Position pos = ((Point) geometry).getPosition();
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();
Element lineElement = new Element("LineString", GeoRSSModule.GML_NS);
final PositionList posList = ((LineString) geometry).getPositionList();
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()));
} else {
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()));
} else {
System.err.println("GeoRSS GML format can't handle rings of type: " + ring.getClass().getName());
}
}
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 {
System.err.println("GeoRSS GML format can't handle geometries of type: " + geometry.getClass().getName());
}

View file

@ -17,8 +17,7 @@
package org.rometools.feed.module.georss;
/**
* 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 $
@ -26,17 +25,16 @@ package org.rometools.feed.module.georss;
*/
public class GMLModuleImpl extends GeoRSSModule {
public GMLModuleImpl() {
super(GeoRSSModule.class, GeoRSSModule.GEORSS_GML_URI);
}
public GMLModuleImpl() {
super(GeoRSSModule.class, GeoRSSModule.GEORSS_GML_URI);
}
/*
* (non-Javadoc)
*
* @see com.sun.syndication.feed.CopyFrom#getInterface()
*/
public Class getInterface() {
return GeoRSSModule.class;
}
/*
* (non-Javadoc)
*
* @see com.sun.syndication.feed.CopyFrom#getInterface()
*/
public Class getInterface() {
return GeoRSSModule.class;
}
}

View file

@ -16,140 +16,139 @@
*/
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.
*
*
* @author Marc Wick
* @version $Id: GMLParser.java,v 1.2 2007/06/05 20:44:53 marcwick Exp $
*
*
*/
public class GMLParser implements ModuleParser {
/*
* (non-Javadoc)
*
* @see com.sun.syndication.io.ModuleParser#getNamespaceUri()
*/
/*
* (non-Javadoc)
*
* @see com.sun.syndication.io.ModuleParser#getNamespaceUri()
*/
public String getNamespaceUri() {
return GeoRSSModule.GEORSS_GEORSS_URI;
}
/*
* (non-Javadoc)
*
* @see com.sun.syndication.io.ModuleParser#parse(org.jdom.Element)
*/
public Module parse(Element element) {
Module geoRssModule = parseGML(element);
/*
* (non-Javadoc)
*
* @see com.sun.syndication.io.ModuleParser#parse(org.jdom2.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)));
}
} else if (polygonElement != null) {
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)));
}
}
}
}
if (poly != null) {
geoRSSModule = new GMLModuleImpl();
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);
}
}
return geoRSSModule;
}
}

View file

@ -16,132 +16,128 @@
*/
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 $
*/
public abstract class GeoRSSModule extends ModuleImpl implements Cloneable {
protected AbstractGeometry geometry;
public static final String version = "0.9.8";
/**
* namespace URI for georss simple: <i>"http://www.georss.org/georss"</i>
*/
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#";
/**
* namespace URI for GML georss : <i>"http://www.opengis.net/gml"</i>
*/
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);
protected GeoRSSModule(java.lang.Class beanClass, java.lang.String uri) {
public static final Namespace GML_NS = Namespace.getNamespace("gml", GeoRSSModule.GEORSS_GML_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
*
*
* @return geometry
*/
public AbstractGeometry getGeometry() {
return geometry;
}
/**
* 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;
}
/**
* Convenience method to set point geometry.
*
*
* @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;
/*
* (non-Javadoc)
*
* @see com.sun.syndication.feed.CopyFrom#copyFrom(java.lang.Object)
*/
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

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

View file

@ -21,110 +21,95 @@ import com.sun.syndication.feed.synd.SyndFeed;
/**
* static utility methods for georss.
*
*
* @author Marc Wick
* @version $Id: GeoRSSUtils.java,v 1.4 2007/04/18 09:59:29 marcwick Exp $
*
*
*/
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;
}
}
return strbuf.toString();
}
/**
* 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
* 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
* @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;
*/
}
/**
* 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;
}
return geoRSSModule;
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();
final Element lineElement = new Element("line", GeoRSSModule.SIMPLE_NS);
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,21 +16,18 @@
*/
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 $
*
*/
public class SimpleModuleImpl extends GeoRSSModule {
public class SimpleModuleImpl extends GeoRSSModule {
public SimpleModuleImpl() {
super(GeoRSSModule.class, GeoRSSModule.GEORSS_GEORSS_URI);
}
/*
* (non-Javadoc)
*

View file

@ -16,90 +16,91 @@
*/
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.
*
*
* @author Marc Wick
* @version $Id: SimpleParser.java,v 1.4 2007/04/18 09:59:29 marcwick Exp $
*
*
*/
public class SimpleParser implements ModuleParser {
/*
* (non-Javadoc)
*
*
* @see com.sun.syndication.io.ModuleParser#getNamespaceUri()
*/
public String getNamespaceUri() {
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.
@ -34,18 +36,18 @@ import org.rometools.feed.module.georss.geometries.*;
*
*/
public class W3CGeoGenerator implements ModuleGenerator {
private static boolean isShort = true;
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,21 +89,20 @@ 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();
Element latElement = new Element("lat", GeoRSSModule.W3CGEO_NS);
final Position pos = ((Point) geometry).getPosition();
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 {
System.err.println("W3C Geo format can't handle geometries of type: " + geometry.getClass().getName());
} 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 $
@ -27,18 +25,17 @@ package org.rometools.feed.module.georss;
*/
public class W3CGeoModuleImpl extends GeoRSSModule {
public W3CGeoModuleImpl() {
super(GeoRSSModule.class, GeoRSSModule.GEORSS_W3CGEO_URI);
}
public W3CGeoModuleImpl() {
super(GeoRSSModule.class, GeoRSSModule.GEORSS_W3CGEO_URI);
}
/*
* (non-Javadoc)
*
* @see com.sun.syndication.feed.CopyFrom#getInterface()
*/
public Class getInterface() {
return GeoRSSModule.class;
}
/*
* (non-Javadoc)
*
* @see com.sun.syndication.feed.CopyFrom#getInterface()
*/
public Class getInterface() {
return GeoRSSModule.class;
}
}

View file

@ -16,64 +16,64 @@
*/
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.
*
*
* @author Marc Wick
* @version $Id: W3CGeoParser.java,v 1.4 2007/04/18 09:59:29 marcwick Exp $
*
*
*/
public class W3CGeoParser implements ModuleParser {
/*
* (non-Javadoc)
*
* @see com.sun.syndication.io.ModuleParser#getNamespaceUri()
*/
/*
* (non-Javadoc)
*
* @see com.sun.syndication.io.ModuleParser#getNamespaceUri()
*/
public String getNamespaceUri() {
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));
}
return geoRSSModule;
}
/*
* (non-Javadoc)
*
* @see com.sun.syndication.io.ModuleParser#parse(org.jdom.Element)
*/
public Module parse(Element element) {
Module geoRssModule = parseW3C(element);
/*
* (non-Javadoc)
*
* @see com.sun.syndication.io.ModuleParser#parse(org.jdom2.Element)
*/
public Module parse(final Element element) {
final Module geoRssModule = parseW3C(element);
return geoRssModule;
}
}

View file

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

View file

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

View file

@ -13,24 +13,27 @@ import java.io.Serializable;
/**
* Abstract base class for geometries.
*
*
* @author runaas
*/
public abstract class AbstractGeometry implements Cloneable, Serializable {
/** Creates a new instance of Geometry */
public AbstractGeometry() {
}
/**
* 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) {
return obj != null && obj.getClass() == getClass();
}
@Override
public boolean equals(final Object obj) {
return obj != null && obj.getClass() == getClass();
}
}

View file

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

View file

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

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