Normalize code in Devinsy style. Replace protected by private in
declarations.
This commit is contained in:
parent
13ab17cc9d
commit
0c793e9c04
16 changed files with 2174 additions and 2013 deletions
|
@ -9,3 +9,283 @@ org.eclipse.jdt.core.compiler.debug.sourceFile=generate
|
||||||
org.eclipse.jdt.core.compiler.problem.assertIdentifier=error
|
org.eclipse.jdt.core.compiler.problem.assertIdentifier=error
|
||||||
org.eclipse.jdt.core.compiler.problem.enumIdentifier=error
|
org.eclipse.jdt.core.compiler.problem.enumIdentifier=error
|
||||||
org.eclipse.jdt.core.compiler.source=1.6
|
org.eclipse.jdt.core.compiler.source=1.6
|
||||||
|
org.eclipse.jdt.core.formatter.align_type_members_on_columns=false
|
||||||
|
org.eclipse.jdt.core.formatter.alignment_for_arguments_in_allocation_expression=16
|
||||||
|
org.eclipse.jdt.core.formatter.alignment_for_arguments_in_annotation=0
|
||||||
|
org.eclipse.jdt.core.formatter.alignment_for_arguments_in_enum_constant=16
|
||||||
|
org.eclipse.jdt.core.formatter.alignment_for_arguments_in_explicit_constructor_call=16
|
||||||
|
org.eclipse.jdt.core.formatter.alignment_for_arguments_in_method_invocation=16
|
||||||
|
org.eclipse.jdt.core.formatter.alignment_for_arguments_in_qualified_allocation_expression=16
|
||||||
|
org.eclipse.jdt.core.formatter.alignment_for_assignment=0
|
||||||
|
org.eclipse.jdt.core.formatter.alignment_for_binary_expression=16
|
||||||
|
org.eclipse.jdt.core.formatter.alignment_for_compact_if=16
|
||||||
|
org.eclipse.jdt.core.formatter.alignment_for_conditional_expression=80
|
||||||
|
org.eclipse.jdt.core.formatter.alignment_for_enum_constants=0
|
||||||
|
org.eclipse.jdt.core.formatter.alignment_for_expressions_in_array_initializer=16
|
||||||
|
org.eclipse.jdt.core.formatter.alignment_for_method_declaration=0
|
||||||
|
org.eclipse.jdt.core.formatter.alignment_for_multiple_fields=16
|
||||||
|
org.eclipse.jdt.core.formatter.alignment_for_parameters_in_constructor_declaration=16
|
||||||
|
org.eclipse.jdt.core.formatter.alignment_for_parameters_in_method_declaration=16
|
||||||
|
org.eclipse.jdt.core.formatter.alignment_for_resources_in_try=80
|
||||||
|
org.eclipse.jdt.core.formatter.alignment_for_selector_in_method_invocation=16
|
||||||
|
org.eclipse.jdt.core.formatter.alignment_for_superclass_in_type_declaration=16
|
||||||
|
org.eclipse.jdt.core.formatter.alignment_for_superinterfaces_in_enum_declaration=16
|
||||||
|
org.eclipse.jdt.core.formatter.alignment_for_superinterfaces_in_type_declaration=16
|
||||||
|
org.eclipse.jdt.core.formatter.alignment_for_throws_clause_in_constructor_declaration=16
|
||||||
|
org.eclipse.jdt.core.formatter.alignment_for_throws_clause_in_method_declaration=16
|
||||||
|
org.eclipse.jdt.core.formatter.alignment_for_union_type_in_multicatch=16
|
||||||
|
org.eclipse.jdt.core.formatter.blank_lines_after_imports=1
|
||||||
|
org.eclipse.jdt.core.formatter.blank_lines_after_package=1
|
||||||
|
org.eclipse.jdt.core.formatter.blank_lines_before_field=0
|
||||||
|
org.eclipse.jdt.core.formatter.blank_lines_before_first_class_body_declaration=0
|
||||||
|
org.eclipse.jdt.core.formatter.blank_lines_before_imports=1
|
||||||
|
org.eclipse.jdt.core.formatter.blank_lines_before_member_type=1
|
||||||
|
org.eclipse.jdt.core.formatter.blank_lines_before_method=1
|
||||||
|
org.eclipse.jdt.core.formatter.blank_lines_before_new_chunk=1
|
||||||
|
org.eclipse.jdt.core.formatter.blank_lines_before_package=0
|
||||||
|
org.eclipse.jdt.core.formatter.blank_lines_between_import_groups=1
|
||||||
|
org.eclipse.jdt.core.formatter.blank_lines_between_type_declarations=1
|
||||||
|
org.eclipse.jdt.core.formatter.brace_position_for_annotation_type_declaration=next_line
|
||||||
|
org.eclipse.jdt.core.formatter.brace_position_for_anonymous_type_declaration=next_line
|
||||||
|
org.eclipse.jdt.core.formatter.brace_position_for_array_initializer=end_of_line
|
||||||
|
org.eclipse.jdt.core.formatter.brace_position_for_block=next_line
|
||||||
|
org.eclipse.jdt.core.formatter.brace_position_for_block_in_case=next_line
|
||||||
|
org.eclipse.jdt.core.formatter.brace_position_for_constructor_declaration=next_line
|
||||||
|
org.eclipse.jdt.core.formatter.brace_position_for_enum_constant=next_line
|
||||||
|
org.eclipse.jdt.core.formatter.brace_position_for_enum_declaration=next_line
|
||||||
|
org.eclipse.jdt.core.formatter.brace_position_for_method_declaration=next_line
|
||||||
|
org.eclipse.jdt.core.formatter.brace_position_for_switch=next_line
|
||||||
|
org.eclipse.jdt.core.formatter.brace_position_for_type_declaration=next_line
|
||||||
|
org.eclipse.jdt.core.formatter.comment.clear_blank_lines_in_block_comment=false
|
||||||
|
org.eclipse.jdt.core.formatter.comment.clear_blank_lines_in_javadoc_comment=false
|
||||||
|
org.eclipse.jdt.core.formatter.comment.format_block_comments=false
|
||||||
|
org.eclipse.jdt.core.formatter.comment.format_header=false
|
||||||
|
org.eclipse.jdt.core.formatter.comment.format_html=true
|
||||||
|
org.eclipse.jdt.core.formatter.comment.format_javadoc_comments=true
|
||||||
|
org.eclipse.jdt.core.formatter.comment.format_line_comments=true
|
||||||
|
org.eclipse.jdt.core.formatter.comment.format_source_code=true
|
||||||
|
org.eclipse.jdt.core.formatter.comment.indent_parameter_description=true
|
||||||
|
org.eclipse.jdt.core.formatter.comment.indent_root_tags=true
|
||||||
|
org.eclipse.jdt.core.formatter.comment.insert_new_line_before_root_tags=insert
|
||||||
|
org.eclipse.jdt.core.formatter.comment.insert_new_line_for_parameter=insert
|
||||||
|
org.eclipse.jdt.core.formatter.comment.line_length=80
|
||||||
|
org.eclipse.jdt.core.formatter.comment.new_lines_at_block_boundaries=true
|
||||||
|
org.eclipse.jdt.core.formatter.comment.new_lines_at_javadoc_boundaries=true
|
||||||
|
org.eclipse.jdt.core.formatter.comment.preserve_white_space_between_code_and_line_comments=false
|
||||||
|
org.eclipse.jdt.core.formatter.compact_else_if=true
|
||||||
|
org.eclipse.jdt.core.formatter.continuation_indentation=2
|
||||||
|
org.eclipse.jdt.core.formatter.continuation_indentation_for_array_initializer=2
|
||||||
|
org.eclipse.jdt.core.formatter.disabling_tag=@formatter\:off
|
||||||
|
org.eclipse.jdt.core.formatter.enabling_tag=@formatter\:on
|
||||||
|
org.eclipse.jdt.core.formatter.format_guardian_clause_on_one_line=false
|
||||||
|
org.eclipse.jdt.core.formatter.format_line_comment_starting_on_first_column=true
|
||||||
|
org.eclipse.jdt.core.formatter.indent_body_declarations_compare_to_annotation_declaration_header=true
|
||||||
|
org.eclipse.jdt.core.formatter.indent_body_declarations_compare_to_enum_constant_header=true
|
||||||
|
org.eclipse.jdt.core.formatter.indent_body_declarations_compare_to_enum_declaration_header=true
|
||||||
|
org.eclipse.jdt.core.formatter.indent_body_declarations_compare_to_type_header=true
|
||||||
|
org.eclipse.jdt.core.formatter.indent_breaks_compare_to_cases=true
|
||||||
|
org.eclipse.jdt.core.formatter.indent_empty_lines=false
|
||||||
|
org.eclipse.jdt.core.formatter.indent_statements_compare_to_block=true
|
||||||
|
org.eclipse.jdt.core.formatter.indent_statements_compare_to_body=true
|
||||||
|
org.eclipse.jdt.core.formatter.indent_switchstatements_compare_to_cases=true
|
||||||
|
org.eclipse.jdt.core.formatter.indent_switchstatements_compare_to_switch=false
|
||||||
|
org.eclipse.jdt.core.formatter.indentation.size=4
|
||||||
|
org.eclipse.jdt.core.formatter.insert_new_line_after_annotation_on_field=insert
|
||||||
|
org.eclipse.jdt.core.formatter.insert_new_line_after_annotation_on_local_variable=insert
|
||||||
|
org.eclipse.jdt.core.formatter.insert_new_line_after_annotation_on_method=insert
|
||||||
|
org.eclipse.jdt.core.formatter.insert_new_line_after_annotation_on_package=insert
|
||||||
|
org.eclipse.jdt.core.formatter.insert_new_line_after_annotation_on_parameter=do not insert
|
||||||
|
org.eclipse.jdt.core.formatter.insert_new_line_after_annotation_on_type=insert
|
||||||
|
org.eclipse.jdt.core.formatter.insert_new_line_after_label=do not insert
|
||||||
|
org.eclipse.jdt.core.formatter.insert_new_line_after_opening_brace_in_array_initializer=do not insert
|
||||||
|
org.eclipse.jdt.core.formatter.insert_new_line_at_end_of_file_if_missing=do not insert
|
||||||
|
org.eclipse.jdt.core.formatter.insert_new_line_before_catch_in_try_statement=insert
|
||||||
|
org.eclipse.jdt.core.formatter.insert_new_line_before_closing_brace_in_array_initializer=do not insert
|
||||||
|
org.eclipse.jdt.core.formatter.insert_new_line_before_else_in_if_statement=insert
|
||||||
|
org.eclipse.jdt.core.formatter.insert_new_line_before_finally_in_try_statement=insert
|
||||||
|
org.eclipse.jdt.core.formatter.insert_new_line_before_while_in_do_statement=do not insert
|
||||||
|
org.eclipse.jdt.core.formatter.insert_new_line_in_empty_annotation_declaration=insert
|
||||||
|
org.eclipse.jdt.core.formatter.insert_new_line_in_empty_anonymous_type_declaration=insert
|
||||||
|
org.eclipse.jdt.core.formatter.insert_new_line_in_empty_block=insert
|
||||||
|
org.eclipse.jdt.core.formatter.insert_new_line_in_empty_enum_constant=insert
|
||||||
|
org.eclipse.jdt.core.formatter.insert_new_line_in_empty_enum_declaration=insert
|
||||||
|
org.eclipse.jdt.core.formatter.insert_new_line_in_empty_method_body=insert
|
||||||
|
org.eclipse.jdt.core.formatter.insert_new_line_in_empty_type_declaration=insert
|
||||||
|
org.eclipse.jdt.core.formatter.insert_space_after_and_in_type_parameter=insert
|
||||||
|
org.eclipse.jdt.core.formatter.insert_space_after_assignment_operator=insert
|
||||||
|
org.eclipse.jdt.core.formatter.insert_space_after_at_in_annotation=do not insert
|
||||||
|
org.eclipse.jdt.core.formatter.insert_space_after_at_in_annotation_type_declaration=do not insert
|
||||||
|
org.eclipse.jdt.core.formatter.insert_space_after_binary_operator=insert
|
||||||
|
org.eclipse.jdt.core.formatter.insert_space_after_closing_angle_bracket_in_type_arguments=insert
|
||||||
|
org.eclipse.jdt.core.formatter.insert_space_after_closing_angle_bracket_in_type_parameters=insert
|
||||||
|
org.eclipse.jdt.core.formatter.insert_space_after_closing_brace_in_block=insert
|
||||||
|
org.eclipse.jdt.core.formatter.insert_space_after_closing_paren_in_cast=insert
|
||||||
|
org.eclipse.jdt.core.formatter.insert_space_after_colon_in_assert=insert
|
||||||
|
org.eclipse.jdt.core.formatter.insert_space_after_colon_in_case=insert
|
||||||
|
org.eclipse.jdt.core.formatter.insert_space_after_colon_in_conditional=insert
|
||||||
|
org.eclipse.jdt.core.formatter.insert_space_after_colon_in_for=insert
|
||||||
|
org.eclipse.jdt.core.formatter.insert_space_after_colon_in_labeled_statement=insert
|
||||||
|
org.eclipse.jdt.core.formatter.insert_space_after_comma_in_allocation_expression=insert
|
||||||
|
org.eclipse.jdt.core.formatter.insert_space_after_comma_in_annotation=insert
|
||||||
|
org.eclipse.jdt.core.formatter.insert_space_after_comma_in_array_initializer=insert
|
||||||
|
org.eclipse.jdt.core.formatter.insert_space_after_comma_in_constructor_declaration_parameters=insert
|
||||||
|
org.eclipse.jdt.core.formatter.insert_space_after_comma_in_constructor_declaration_throws=insert
|
||||||
|
org.eclipse.jdt.core.formatter.insert_space_after_comma_in_enum_constant_arguments=insert
|
||||||
|
org.eclipse.jdt.core.formatter.insert_space_after_comma_in_enum_declarations=insert
|
||||||
|
org.eclipse.jdt.core.formatter.insert_space_after_comma_in_explicitconstructorcall_arguments=insert
|
||||||
|
org.eclipse.jdt.core.formatter.insert_space_after_comma_in_for_increments=insert
|
||||||
|
org.eclipse.jdt.core.formatter.insert_space_after_comma_in_for_inits=insert
|
||||||
|
org.eclipse.jdt.core.formatter.insert_space_after_comma_in_method_declaration_parameters=insert
|
||||||
|
org.eclipse.jdt.core.formatter.insert_space_after_comma_in_method_declaration_throws=insert
|
||||||
|
org.eclipse.jdt.core.formatter.insert_space_after_comma_in_method_invocation_arguments=insert
|
||||||
|
org.eclipse.jdt.core.formatter.insert_space_after_comma_in_multiple_field_declarations=insert
|
||||||
|
org.eclipse.jdt.core.formatter.insert_space_after_comma_in_multiple_local_declarations=insert
|
||||||
|
org.eclipse.jdt.core.formatter.insert_space_after_comma_in_parameterized_type_reference=insert
|
||||||
|
org.eclipse.jdt.core.formatter.insert_space_after_comma_in_superinterfaces=insert
|
||||||
|
org.eclipse.jdt.core.formatter.insert_space_after_comma_in_type_arguments=insert
|
||||||
|
org.eclipse.jdt.core.formatter.insert_space_after_comma_in_type_parameters=insert
|
||||||
|
org.eclipse.jdt.core.formatter.insert_space_after_ellipsis=insert
|
||||||
|
org.eclipse.jdt.core.formatter.insert_space_after_opening_angle_bracket_in_parameterized_type_reference=do not insert
|
||||||
|
org.eclipse.jdt.core.formatter.insert_space_after_opening_angle_bracket_in_type_arguments=do not insert
|
||||||
|
org.eclipse.jdt.core.formatter.insert_space_after_opening_angle_bracket_in_type_parameters=do not insert
|
||||||
|
org.eclipse.jdt.core.formatter.insert_space_after_opening_brace_in_array_initializer=insert
|
||||||
|
org.eclipse.jdt.core.formatter.insert_space_after_opening_bracket_in_array_allocation_expression=do not insert
|
||||||
|
org.eclipse.jdt.core.formatter.insert_space_after_opening_bracket_in_array_reference=do not insert
|
||||||
|
org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_annotation=do not insert
|
||||||
|
org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_cast=do not insert
|
||||||
|
org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_catch=do not insert
|
||||||
|
org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_constructor_declaration=do not insert
|
||||||
|
org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_enum_constant=do not insert
|
||||||
|
org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_for=do not insert
|
||||||
|
org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_if=do not insert
|
||||||
|
org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_method_declaration=do not insert
|
||||||
|
org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_method_invocation=do not insert
|
||||||
|
org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_parenthesized_expression=do not insert
|
||||||
|
org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_switch=do not insert
|
||||||
|
org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_synchronized=do not insert
|
||||||
|
org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_try=do not insert
|
||||||
|
org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_while=do not insert
|
||||||
|
org.eclipse.jdt.core.formatter.insert_space_after_postfix_operator=do not insert
|
||||||
|
org.eclipse.jdt.core.formatter.insert_space_after_prefix_operator=do not insert
|
||||||
|
org.eclipse.jdt.core.formatter.insert_space_after_question_in_conditional=insert
|
||||||
|
org.eclipse.jdt.core.formatter.insert_space_after_question_in_wildcard=do not insert
|
||||||
|
org.eclipse.jdt.core.formatter.insert_space_after_semicolon_in_for=insert
|
||||||
|
org.eclipse.jdt.core.formatter.insert_space_after_semicolon_in_try_resources=insert
|
||||||
|
org.eclipse.jdt.core.formatter.insert_space_after_unary_operator=do not insert
|
||||||
|
org.eclipse.jdt.core.formatter.insert_space_before_and_in_type_parameter=insert
|
||||||
|
org.eclipse.jdt.core.formatter.insert_space_before_assignment_operator=insert
|
||||||
|
org.eclipse.jdt.core.formatter.insert_space_before_at_in_annotation_type_declaration=insert
|
||||||
|
org.eclipse.jdt.core.formatter.insert_space_before_binary_operator=insert
|
||||||
|
org.eclipse.jdt.core.formatter.insert_space_before_closing_angle_bracket_in_parameterized_type_reference=do not insert
|
||||||
|
org.eclipse.jdt.core.formatter.insert_space_before_closing_angle_bracket_in_type_arguments=do not insert
|
||||||
|
org.eclipse.jdt.core.formatter.insert_space_before_closing_angle_bracket_in_type_parameters=do not insert
|
||||||
|
org.eclipse.jdt.core.formatter.insert_space_before_closing_brace_in_array_initializer=insert
|
||||||
|
org.eclipse.jdt.core.formatter.insert_space_before_closing_bracket_in_array_allocation_expression=do not insert
|
||||||
|
org.eclipse.jdt.core.formatter.insert_space_before_closing_bracket_in_array_reference=do not insert
|
||||||
|
org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_annotation=do not insert
|
||||||
|
org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_cast=do not insert
|
||||||
|
org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_catch=do not insert
|
||||||
|
org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_constructor_declaration=do not insert
|
||||||
|
org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_enum_constant=do not insert
|
||||||
|
org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_for=do not insert
|
||||||
|
org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_if=do not insert
|
||||||
|
org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_method_declaration=do not insert
|
||||||
|
org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_method_invocation=do not insert
|
||||||
|
org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_parenthesized_expression=do not insert
|
||||||
|
org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_switch=do not insert
|
||||||
|
org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_synchronized=do not insert
|
||||||
|
org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_try=do not insert
|
||||||
|
org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_while=do not insert
|
||||||
|
org.eclipse.jdt.core.formatter.insert_space_before_colon_in_assert=insert
|
||||||
|
org.eclipse.jdt.core.formatter.insert_space_before_colon_in_case=do not insert
|
||||||
|
org.eclipse.jdt.core.formatter.insert_space_before_colon_in_conditional=insert
|
||||||
|
org.eclipse.jdt.core.formatter.insert_space_before_colon_in_default=do not insert
|
||||||
|
org.eclipse.jdt.core.formatter.insert_space_before_colon_in_for=insert
|
||||||
|
org.eclipse.jdt.core.formatter.insert_space_before_colon_in_labeled_statement=do not insert
|
||||||
|
org.eclipse.jdt.core.formatter.insert_space_before_comma_in_allocation_expression=do not insert
|
||||||
|
org.eclipse.jdt.core.formatter.insert_space_before_comma_in_annotation=do not insert
|
||||||
|
org.eclipse.jdt.core.formatter.insert_space_before_comma_in_array_initializer=do not insert
|
||||||
|
org.eclipse.jdt.core.formatter.insert_space_before_comma_in_constructor_declaration_parameters=do not insert
|
||||||
|
org.eclipse.jdt.core.formatter.insert_space_before_comma_in_constructor_declaration_throws=do not insert
|
||||||
|
org.eclipse.jdt.core.formatter.insert_space_before_comma_in_enum_constant_arguments=do not insert
|
||||||
|
org.eclipse.jdt.core.formatter.insert_space_before_comma_in_enum_declarations=do not insert
|
||||||
|
org.eclipse.jdt.core.formatter.insert_space_before_comma_in_explicitconstructorcall_arguments=do not insert
|
||||||
|
org.eclipse.jdt.core.formatter.insert_space_before_comma_in_for_increments=do not insert
|
||||||
|
org.eclipse.jdt.core.formatter.insert_space_before_comma_in_for_inits=do not insert
|
||||||
|
org.eclipse.jdt.core.formatter.insert_space_before_comma_in_method_declaration_parameters=do not insert
|
||||||
|
org.eclipse.jdt.core.formatter.insert_space_before_comma_in_method_declaration_throws=do not insert
|
||||||
|
org.eclipse.jdt.core.formatter.insert_space_before_comma_in_method_invocation_arguments=do not insert
|
||||||
|
org.eclipse.jdt.core.formatter.insert_space_before_comma_in_multiple_field_declarations=do not insert
|
||||||
|
org.eclipse.jdt.core.formatter.insert_space_before_comma_in_multiple_local_declarations=do not insert
|
||||||
|
org.eclipse.jdt.core.formatter.insert_space_before_comma_in_parameterized_type_reference=do not insert
|
||||||
|
org.eclipse.jdt.core.formatter.insert_space_before_comma_in_superinterfaces=do not insert
|
||||||
|
org.eclipse.jdt.core.formatter.insert_space_before_comma_in_type_arguments=do not insert
|
||||||
|
org.eclipse.jdt.core.formatter.insert_space_before_comma_in_type_parameters=do not insert
|
||||||
|
org.eclipse.jdt.core.formatter.insert_space_before_ellipsis=do not insert
|
||||||
|
org.eclipse.jdt.core.formatter.insert_space_before_opening_angle_bracket_in_parameterized_type_reference=do not insert
|
||||||
|
org.eclipse.jdt.core.formatter.insert_space_before_opening_angle_bracket_in_type_arguments=do not insert
|
||||||
|
org.eclipse.jdt.core.formatter.insert_space_before_opening_angle_bracket_in_type_parameters=do not insert
|
||||||
|
org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_annotation_type_declaration=insert
|
||||||
|
org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_anonymous_type_declaration=insert
|
||||||
|
org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_array_initializer=insert
|
||||||
|
org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_block=insert
|
||||||
|
org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_constructor_declaration=insert
|
||||||
|
org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_enum_constant=insert
|
||||||
|
org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_enum_declaration=insert
|
||||||
|
org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_method_declaration=insert
|
||||||
|
org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_switch=insert
|
||||||
|
org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_type_declaration=insert
|
||||||
|
org.eclipse.jdt.core.formatter.insert_space_before_opening_bracket_in_array_allocation_expression=do not insert
|
||||||
|
org.eclipse.jdt.core.formatter.insert_space_before_opening_bracket_in_array_reference=do not insert
|
||||||
|
org.eclipse.jdt.core.formatter.insert_space_before_opening_bracket_in_array_type_reference=do not insert
|
||||||
|
org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_annotation=do not insert
|
||||||
|
org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_annotation_type_member_declaration=do not insert
|
||||||
|
org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_catch=insert
|
||||||
|
org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_constructor_declaration=do not insert
|
||||||
|
org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_enum_constant=do not insert
|
||||||
|
org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_for=insert
|
||||||
|
org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_if=insert
|
||||||
|
org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_method_declaration=do not insert
|
||||||
|
org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_method_invocation=do not insert
|
||||||
|
org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_parenthesized_expression=do not insert
|
||||||
|
org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_switch=insert
|
||||||
|
org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_synchronized=insert
|
||||||
|
org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_try=insert
|
||||||
|
org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_while=insert
|
||||||
|
org.eclipse.jdt.core.formatter.insert_space_before_parenthesized_expression_in_return=insert
|
||||||
|
org.eclipse.jdt.core.formatter.insert_space_before_parenthesized_expression_in_throw=insert
|
||||||
|
org.eclipse.jdt.core.formatter.insert_space_before_postfix_operator=do not insert
|
||||||
|
org.eclipse.jdt.core.formatter.insert_space_before_prefix_operator=do not insert
|
||||||
|
org.eclipse.jdt.core.formatter.insert_space_before_question_in_conditional=insert
|
||||||
|
org.eclipse.jdt.core.formatter.insert_space_before_question_in_wildcard=do not insert
|
||||||
|
org.eclipse.jdt.core.formatter.insert_space_before_semicolon=do not insert
|
||||||
|
org.eclipse.jdt.core.formatter.insert_space_before_semicolon_in_for=do not insert
|
||||||
|
org.eclipse.jdt.core.formatter.insert_space_before_semicolon_in_try_resources=do not insert
|
||||||
|
org.eclipse.jdt.core.formatter.insert_space_before_unary_operator=do not insert
|
||||||
|
org.eclipse.jdt.core.formatter.insert_space_between_brackets_in_array_type_reference=do not insert
|
||||||
|
org.eclipse.jdt.core.formatter.insert_space_between_empty_braces_in_array_initializer=do not insert
|
||||||
|
org.eclipse.jdt.core.formatter.insert_space_between_empty_brackets_in_array_allocation_expression=do not insert
|
||||||
|
org.eclipse.jdt.core.formatter.insert_space_between_empty_parens_in_annotation_type_member_declaration=do not insert
|
||||||
|
org.eclipse.jdt.core.formatter.insert_space_between_empty_parens_in_constructor_declaration=do not insert
|
||||||
|
org.eclipse.jdt.core.formatter.insert_space_between_empty_parens_in_enum_constant=do not insert
|
||||||
|
org.eclipse.jdt.core.formatter.insert_space_between_empty_parens_in_method_declaration=do not insert
|
||||||
|
org.eclipse.jdt.core.formatter.insert_space_between_empty_parens_in_method_invocation=do not insert
|
||||||
|
org.eclipse.jdt.core.formatter.join_lines_in_comments=true
|
||||||
|
org.eclipse.jdt.core.formatter.join_wrapped_lines=true
|
||||||
|
org.eclipse.jdt.core.formatter.keep_else_statement_on_same_line=false
|
||||||
|
org.eclipse.jdt.core.formatter.keep_empty_array_initializer_on_one_line=false
|
||||||
|
org.eclipse.jdt.core.formatter.keep_imple_if_on_one_line=false
|
||||||
|
org.eclipse.jdt.core.formatter.keep_then_statement_on_same_line=false
|
||||||
|
org.eclipse.jdt.core.formatter.lineSplit=200
|
||||||
|
org.eclipse.jdt.core.formatter.never_indent_block_comments_on_first_column=false
|
||||||
|
org.eclipse.jdt.core.formatter.never_indent_line_comments_on_first_column=false
|
||||||
|
org.eclipse.jdt.core.formatter.number_of_blank_lines_at_beginning_of_method_body=0
|
||||||
|
org.eclipse.jdt.core.formatter.number_of_empty_lines_to_preserve=1
|
||||||
|
org.eclipse.jdt.core.formatter.put_empty_statement_on_new_line=true
|
||||||
|
org.eclipse.jdt.core.formatter.tabulation.char=tab
|
||||||
|
org.eclipse.jdt.core.formatter.tabulation.size=4
|
||||||
|
org.eclipse.jdt.core.formatter.use_on_off_tags=false
|
||||||
|
org.eclipse.jdt.core.formatter.use_tabs_only_for_leading_indentations=false
|
||||||
|
org.eclipse.jdt.core.formatter.wrap_before_binary_operator=true
|
||||||
|
org.eclipse.jdt.core.formatter.wrap_before_or_operator_multicatch=true
|
||||||
|
org.eclipse.jdt.core.formatter.wrap_outer_expressions_when_nested=true
|
||||||
|
|
|
@ -1,19 +1,25 @@
|
||||||
v1.0.0: 01/10/2009
|
== 2013-06
|
||||||
|
Rename project. Clean files. Update build.
|
||||||
|
|
||||||
|
|
||||||
|
== v1.0.0: 01/10/2009
|
||||||
New version for:
|
New version for:
|
||||||
- Eclipse integration,
|
- Eclipse integration,
|
||||||
- fr.devinsy.xid package rename.
|
- fr.devinsy.xid package rename.
|
||||||
|
|
||||||
V_006: 12/03/2007
|
== V_006: 12/03/2007
|
||||||
Version used in DevinsyGes and maitress-admin.
|
Version used in DevinsyGes and maitress-admin.
|
||||||
|
|
||||||
V_003: 12/03/2006
|
== 20061214, cpm, import dans svn sur https://www.ocmland.org/svn/Xid
|
||||||
|
|
||||||
|
== V_004: 12/05/2006
|
||||||
|
-
|
||||||
|
|
||||||
|
== V_003: 12/03/2006
|
||||||
- add build.xml file
|
- add build.xml file
|
||||||
- Vue class rename Presenter
|
- Vue class rename Presenter
|
||||||
- debug of object tag
|
- debug of object tag
|
||||||
- add webappPath capability
|
- add webappPath capability
|
||||||
|
|
||||||
V_004: 12/05/2006
|
|
||||||
-
|
|
||||||
|
|
||||||
20061214, cpm, import dans snv sur https://www.ocmland.org/svn/Xid
|
|
||||||
|
|
||||||
|
|
|
@ -2,7 +2,9 @@
|
||||||
* XidDemo
|
* XidDemo
|
||||||
*/
|
*/
|
||||||
|
|
||||||
import fr.devinsy.xid.*;
|
import fr.devinsy.xid.Data;
|
||||||
|
import fr.devinsy.xid.IdData;
|
||||||
|
import fr.devinsy.xid.StringPresenter;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
*
|
*
|
||||||
|
@ -19,11 +21,10 @@ class XidDemo
|
||||||
log = org.apache.log4j.Logger.getLogger(XidDemo.class);
|
log = org.apache.log4j.Logger.getLogger(XidDemo.class);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
public static void main (String[] args)
|
public static void main(final String[] args)
|
||||||
{
|
{
|
||||||
System.out.println("Hello World!");
|
System.out.println("Hello World!");
|
||||||
|
|
||||||
|
@ -32,8 +33,6 @@ class XidDemo
|
||||||
//
|
//
|
||||||
Data datas;
|
Data datas;
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
// Step #01.
|
// Step #01.
|
||||||
{
|
{
|
||||||
System.out.println("----------------------------");
|
System.out.println("----------------------------");
|
||||||
|
@ -62,7 +61,6 @@ class XidDemo
|
||||||
System.out.println("[" + htmlSource.length() + "] => [" + htmlTarget.length() + "]");
|
System.out.println("[" + htmlSource.length() + "] => [" + htmlTarget.length() + "]");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
// Step #02.
|
// Step #02.
|
||||||
{
|
{
|
||||||
System.out.println("----------------------------");
|
System.out.println("----------------------------");
|
||||||
|
@ -97,7 +95,6 @@ class XidDemo
|
||||||
System.out.println("[" + htmlSource.length() + "] => [" + htmlTarget.length() + "]");
|
System.out.println("[" + htmlSource.length() + "] => [" + htmlTarget.length() + "]");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
// Step #03.
|
// Step #03.
|
||||||
{
|
{
|
||||||
System.out.println("----------------------------");
|
System.out.println("----------------------------");
|
||||||
|
@ -138,7 +135,6 @@ class XidDemo
|
||||||
System.out.println("[" + htmlSource.length() + "] => [" + htmlTarget.length() + "]");
|
System.out.println("[" + htmlSource.length() + "] => [" + htmlTarget.length() + "]");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
// Step #04.
|
// Step #04.
|
||||||
{
|
{
|
||||||
System.out.println("----------------------------");
|
System.out.println("----------------------------");
|
||||||
|
@ -151,7 +147,6 @@ class XidDemo
|
||||||
datas.setContent("identity", 2, "last_name", "Tronche");
|
datas.setContent("identity", 2, "last_name", "Tronche");
|
||||||
datas.setContent("identity", 2, "first_name", "Christophe");
|
datas.setContent("identity", 2, "first_name", "Christophe");
|
||||||
|
|
||||||
|
|
||||||
StringBuffer source = new StringBuffer();
|
StringBuffer source = new StringBuffer();
|
||||||
source.append("<table>\n");
|
source.append("<table>\n");
|
||||||
source.append(" <tr id='identity'><td>noid</td><td id='first_name'>Jean</td><td id='last_name'>Reve</td></tr>\n");
|
source.append(" <tr id='identity'><td>noid</td><td id='first_name'>Jean</td><td id='last_name'>Reve</td></tr>\n");
|
||||||
|
@ -184,7 +179,6 @@ class XidDemo
|
||||||
System.out.println("[" + htmlSource.length() + "] => [" + htmlTarget.length() + "]");
|
System.out.println("[" + htmlSource.length() + "] => [" + htmlTarget.length() + "]");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
// Step #05.
|
// Step #05.
|
||||||
{
|
{
|
||||||
System.out.println("----------------------------");
|
System.out.println("----------------------------");
|
||||||
|
@ -196,9 +190,12 @@ class XidDemo
|
||||||
datas.setContent("identity", 1, "first_name", "Christian");
|
datas.setContent("identity", 1, "first_name", "Christian");
|
||||||
datas.setContent("identity", 2, "last_name", "Tronche");
|
datas.setContent("identity", 2, "last_name", "Tronche");
|
||||||
datas.setContent("identity", 2, "first_name", "Christophe");
|
datas.setContent("identity", 2, "first_name", "Christophe");
|
||||||
//datas.setIterationStrategy ("identity", IdsDataByIndex.IterationStrategy.ONLY_ROWS_WITH_ID);
|
// datas.setIterationStrategy ("identity",
|
||||||
//datas.setIterationStrategy ("identity", IdsDataByIndex.IterationStrategy.ONLY_ROWS_WITHOUT_ID);
|
// IdsDataByIndex.IterationStrategy.ONLY_ROWS_WITH_ID);
|
||||||
//datas.setIterationStrategy ("identity", IdsDataByIndex.IterationStrategy.ALL_ROWS);
|
// datas.setIterationStrategy ("identity",
|
||||||
|
// IdsDataByIndex.IterationStrategy.ONLY_ROWS_WITHOUT_ID);
|
||||||
|
// datas.setIterationStrategy ("identity",
|
||||||
|
// IdsDataByIndex.IterationStrategy.ALL_ROWS);
|
||||||
|
|
||||||
//
|
//
|
||||||
StringBuffer source = new StringBuffer();
|
StringBuffer source = new StringBuffer();
|
||||||
|
@ -222,7 +219,6 @@ class XidDemo
|
||||||
System.out.println(htmlSource);
|
System.out.println(htmlSource);
|
||||||
System.out.println("=>");
|
System.out.println("=>");
|
||||||
|
|
||||||
|
|
||||||
// #05.1
|
// #05.1
|
||||||
datas.setIterationStrategy("identities", IdData.IterationStrategy.ONLY_FIRST_ROW);
|
datas.setIterationStrategy("identities", IdData.IterationStrategy.ONLY_FIRST_ROW);
|
||||||
System.out.println("ONLY_FIRST_ROW:");
|
System.out.println("ONLY_FIRST_ROW:");
|
||||||
|
@ -239,7 +235,6 @@ class XidDemo
|
||||||
System.out.println(html);
|
System.out.println(html);
|
||||||
System.out.println("");
|
System.out.println("");
|
||||||
|
|
||||||
|
|
||||||
// #05.2
|
// #05.2
|
||||||
datas.setIterationStrategy("identities", IdData.IterationStrategy.ONLY_FIRST_TWO_ROWS);
|
datas.setIterationStrategy("identities", IdData.IterationStrategy.ONLY_FIRST_TWO_ROWS);
|
||||||
System.out.println("ONLY_FIRST_TWO_ROWS:");
|
System.out.println("ONLY_FIRST_TWO_ROWS:");
|
||||||
|
@ -255,7 +250,6 @@ class XidDemo
|
||||||
System.out.println(html);
|
System.out.println(html);
|
||||||
System.out.println("");
|
System.out.println("");
|
||||||
|
|
||||||
|
|
||||||
// #05.3
|
// #05.3
|
||||||
datas.setIterationStrategy("identities", IdData.IterationStrategy.ONLY_ROWS_WITH_ID);
|
datas.setIterationStrategy("identities", IdData.IterationStrategy.ONLY_ROWS_WITH_ID);
|
||||||
System.out.println("ONLY_ROWS_WITH_ID:");
|
System.out.println("ONLY_ROWS_WITH_ID:");
|
||||||
|
@ -271,7 +265,6 @@ class XidDemo
|
||||||
System.out.println(html);
|
System.out.println(html);
|
||||||
System.out.println("");
|
System.out.println("");
|
||||||
|
|
||||||
|
|
||||||
// #05.4
|
// #05.4
|
||||||
datas.setIterationStrategy("identities", IdData.IterationStrategy.ONLY_ROWS_WITHOUT_ID);
|
datas.setIterationStrategy("identities", IdData.IterationStrategy.ONLY_ROWS_WITHOUT_ID);
|
||||||
System.out.println("ONLY_ROWS_WITHOUT_ID:");
|
System.out.println("ONLY_ROWS_WITHOUT_ID:");
|
||||||
|
@ -287,7 +280,6 @@ class XidDemo
|
||||||
System.out.println(html);
|
System.out.println(html);
|
||||||
System.out.println("");
|
System.out.println("");
|
||||||
|
|
||||||
|
|
||||||
// #05.5
|
// #05.5
|
||||||
datas.setIterationStrategy("identities", IdData.IterationStrategy.ALL_ROWS);
|
datas.setIterationStrategy("identities", IdData.IterationStrategy.ALL_ROWS);
|
||||||
System.out.println("ALL_ROWS:");
|
System.out.println("ALL_ROWS:");
|
||||||
|
|
|
@ -1,21 +1,17 @@
|
||||||
package fr.devinsy.xid;
|
package fr.devinsy.xid;
|
||||||
|
|
||||||
import java.util.*;
|
import java.util.HashMap;
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
*
|
*
|
||||||
* Note: no more AttrValue as in Brill, because the exception of style is managed
|
* Note: no more AttrValue as in Brill, because the exception of style is
|
||||||
* in the attribute merging on the "style" string detection.
|
* managed in the attribute merging on the "style" string detection.
|
||||||
*/
|
*/
|
||||||
public class Attributes extends HashMap<String, String>
|
public class Attributes extends HashMap<String, String>
|
||||||
{
|
{
|
||||||
private static final long serialVersionUID = 2802739066295665336L;
|
private static final long serialVersionUID = 2802739066295665336L;
|
||||||
|
|
||||||
|
/**
|
||||||
/*
|
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
public Attributes()
|
public Attributes()
|
||||||
|
@ -23,30 +19,20 @@ public class Attributes extends HashMap<String, String>
|
||||||
super();
|
super();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
/*
|
|
||||||
* Useful for the merge attributes.
|
* Useful for the merge attributes.
|
||||||
*/
|
*/
|
||||||
public Attributes (Attributes attributes)
|
public Attributes(final Attributes attributes)
|
||||||
{
|
{
|
||||||
super(attributes);
|
super(attributes);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
/*
|
* Add a value to an existing value. This is useful to the 'style'
|
||||||
|
* attribute.
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
public void setAttribute (String label, String value)
|
public void appendAttribute(final String label, final String value)
|
||||||
{
|
|
||||||
this.put (label, value);
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
/*
|
|
||||||
* Add a value to an existing value. This is useful to the 'style' attribute.
|
|
||||||
*
|
|
||||||
*/
|
|
||||||
public void appendAttribute (String label, String value)
|
|
||||||
{
|
{
|
||||||
if (this.containsKey(label))
|
if (this.containsKey(label))
|
||||||
{
|
{
|
||||||
|
@ -58,11 +44,10 @@ public class Attributes extends HashMap<String, String>
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
/*
|
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
public String getAttribute (String label)
|
public String getAttribute(final String label)
|
||||||
{
|
{
|
||||||
String result;
|
String result;
|
||||||
|
|
||||||
|
@ -79,4 +64,12 @@ public class Attributes extends HashMap<String, String>
|
||||||
return (result);
|
return (result);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
*
|
||||||
|
*/
|
||||||
|
public void setAttribute(final String label, final String value)
|
||||||
|
{
|
||||||
|
this.put(label, value);
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,13 +1,11 @@
|
||||||
package fr.devinsy.xid;
|
package fr.devinsy.xid;
|
||||||
|
|
||||||
|
|
||||||
/*
|
/*
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
public class Data
|
public class Data
|
||||||
{
|
{
|
||||||
protected IdsDataById idsDataById;
|
private IdsDataById idsDataById;
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
*
|
*
|
||||||
|
@ -17,25 +15,74 @@ public class Data
|
||||||
this.idsDataById = new IdsDataById();
|
this.idsDataById = new IdsDataById();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
public IdsDataById getIdsDataById ()
|
public void appendAttribute(final String id, final int line, final String column, final String label, final String value)
|
||||||
{
|
{
|
||||||
IdsDataById result;
|
IdData tag = this.getIdData(id, line, column);
|
||||||
|
|
||||||
result = this.idsDataById;
|
tag.attributes().appendAttribute(label, value);
|
||||||
|
|
||||||
//
|
|
||||||
return (result);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
*
|
||||||
|
*/
|
||||||
|
public void appendAttribute(final String id, final String label, final int value)
|
||||||
|
{
|
||||||
|
appendAttribute(id, label, (new Integer(value)).toString());
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
public IdData getIdData (String id)
|
public void appendAttribute(final String id, final String label, final String value)
|
||||||
|
{
|
||||||
|
IdData tag = this.getIdData(id);
|
||||||
|
|
||||||
|
tag.attributes().appendAttribute(label, value);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
*
|
||||||
|
*/
|
||||||
|
public void appendContent(final String id, final int line, final int value)
|
||||||
|
{
|
||||||
|
appendContent(id, line, (new Integer(value)).toString());
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
*
|
||||||
|
*/
|
||||||
|
public void appendContent(final String id, final int line, final String value)
|
||||||
|
{
|
||||||
|
IdData tag = this.getIdData(id, line);
|
||||||
|
|
||||||
|
tag.appendContent(value);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
*
|
||||||
|
*/
|
||||||
|
public void appendContent(final String id, final int line, final String column, final int value)
|
||||||
|
{
|
||||||
|
appendContent(id, line, column, (new Integer(value)).toString());
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
*
|
||||||
|
*/
|
||||||
|
public void appendContent(final String id, final int line, final String column, final String value)
|
||||||
|
{
|
||||||
|
IdData tag = this.getIdData(id, line, column);
|
||||||
|
|
||||||
|
tag.appendContent(value);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
*
|
||||||
|
*/
|
||||||
|
public IdData getIdData(final String id)
|
||||||
{
|
{
|
||||||
IdData result;
|
IdData result;
|
||||||
|
|
||||||
|
@ -49,16 +96,14 @@ public class Data
|
||||||
result = (IdData) this.idsDataById.getId(id);
|
result = (IdData) this.idsDataById.getId(id);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
//
|
//
|
||||||
return (result);
|
return (result);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
public IdData getIdData (String id, int line)
|
public IdData getIdData(final String id, final int line)
|
||||||
{
|
{
|
||||||
IdData result;
|
IdData result;
|
||||||
|
|
||||||
|
@ -85,11 +130,10 @@ public class Data
|
||||||
return (result);
|
return (result);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
public IdData getIdData (String id, int line, String column)
|
public IdData getIdData(final String id, final int line, final String column)
|
||||||
{
|
{
|
||||||
IdData result;
|
IdData result;
|
||||||
|
|
||||||
|
@ -125,217 +169,144 @@ public class Data
|
||||||
return (result);
|
return (result);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
public void setIterationStrategy (String id, IdData.IterationStrategy strategy)
|
public IdsDataById getIdsDataById()
|
||||||
{
|
{
|
||||||
IdData tag = (IdData) this.getIdData (id);
|
IdsDataById result;
|
||||||
|
|
||||||
tag.setIterationStrategy (strategy);
|
result = this.idsDataById;
|
||||||
|
|
||||||
|
//
|
||||||
|
return (result);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
public void setContent (String id, String content)
|
public void setAttribute(final String id, final int line, final String label, final int value)
|
||||||
{
|
{
|
||||||
IdData idData = this.getIdData (id);
|
setAttribute(id, line, label, (new Integer(value)).toString());
|
||||||
|
|
||||||
idData.setContent (content);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
*
|
||||||
|
*/
|
||||||
|
public void setAttribute(final String id, final int line, final String label, final String value)
|
||||||
|
{
|
||||||
|
IdData tag = this.getIdData(id, line);
|
||||||
|
|
||||||
|
tag.attributes().setAttribute(label, value);
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
public void setContent (String id, int content)
|
public void setAttribute(final String id, final int line, final String column, final String label, final int value)
|
||||||
|
{
|
||||||
|
setAttribute(id, line, column, label, (new Integer(value)).toString());
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
*
|
||||||
|
*/
|
||||||
|
public void setAttribute(final String id, final int line, final String column, final String label, final String value)
|
||||||
|
{
|
||||||
|
IdData tag = this.getIdData(id, line, column);
|
||||||
|
|
||||||
|
tag.attributes().setAttribute(label, value);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
*
|
||||||
|
*/
|
||||||
|
public void setAttribute(final String id, final String label, final int value)
|
||||||
|
{
|
||||||
|
setAttribute(id, label, (new Integer(value)).toString());
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
*
|
||||||
|
*/
|
||||||
|
public void setAttribute(final String id, final String label, final String value)
|
||||||
|
{
|
||||||
|
IdData tag = this.getIdData(id);
|
||||||
|
|
||||||
|
tag.attributes().setAttribute(label, value);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
*
|
||||||
|
*/
|
||||||
|
public void setContent(final String id, final int content)
|
||||||
{
|
{
|
||||||
setContent(id, (new Integer(content)).toString());
|
setContent(id, (new Integer(content)).toString());
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
*
|
||||||
|
*/
|
||||||
|
public void setContent(final String id, final int line, final int content)
|
||||||
|
{
|
||||||
|
setContent(id, line, (new Integer(content)).toString());
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
public void setContent (String id, int line, String content)
|
public void setContent(final String id, final int line, final String content)
|
||||||
{
|
{
|
||||||
IdData tag = this.getIdData(id, line);
|
IdData tag = this.getIdData(id, line);
|
||||||
|
|
||||||
tag.setContent(content);
|
tag.setContent(content);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
public void setContent (String id, int line, int content)
|
public void setContent(final String id, final int line, final String column, final int content)
|
||||||
{
|
|
||||||
setContent (id, line, (new Integer (content)).toString ());
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
/**
|
|
||||||
*
|
|
||||||
*/
|
|
||||||
public void setContent (String id, int line, String column, String content)
|
|
||||||
{
|
|
||||||
IdData tag = this.getIdData (id, line, column);
|
|
||||||
|
|
||||||
tag.setContent (content);
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
/**
|
|
||||||
*
|
|
||||||
*/
|
|
||||||
public void setContent (String id, int line, String column, int content)
|
|
||||||
{
|
{
|
||||||
setContent(id, line, column, (new Integer(content)).toString());
|
setContent(id, line, column, (new Integer(content)).toString());
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @TODO
|
* @TODO
|
||||||
*/
|
*/
|
||||||
public void setContent (String id, int line, String subId, int subLine, String column, String content)
|
public void setContent(final String id, final int line, final String subId, final int subLine, final String column, final String content)
|
||||||
{
|
{
|
||||||
// IdData tag = this.getIdData (id, line, subId, subLine, column);
|
// IdData tag = this.getIdData (id, line, subId, subLine, column);
|
||||||
|
|
||||||
// tag.setContent (content);
|
// tag.setContent (content);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
*
|
||||||
|
*/
|
||||||
|
public void setContent(final String id, final int line, final String column, final String content)
|
||||||
|
{
|
||||||
|
IdData tag = this.getIdData(id, line, column);
|
||||||
|
|
||||||
|
tag.setContent(content);
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
public void setAttribute (String id, String label, String value)
|
public void setContent(final String id, final String content)
|
||||||
|
{
|
||||||
|
IdData idData = this.getIdData(id);
|
||||||
|
|
||||||
|
idData.setContent(content);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
*
|
||||||
|
*/
|
||||||
|
public void setIterationStrategy(final String id, final IdData.IterationStrategy strategy)
|
||||||
{
|
{
|
||||||
IdData tag = this.getIdData(id);
|
IdData tag = this.getIdData(id);
|
||||||
|
|
||||||
tag.attributes ().setAttribute (label, value);
|
tag.setIterationStrategy(strategy);
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
/**
|
|
||||||
*
|
|
||||||
*/
|
|
||||||
public void setAttribute (String id, String label, int value)
|
|
||||||
{
|
|
||||||
setAttribute (id, label, (new Integer (value)).toString ());
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
/**
|
|
||||||
*
|
|
||||||
*/
|
|
||||||
public void setAttribute (String id, int line, String label, String value)
|
|
||||||
{
|
|
||||||
IdData tag = this.getIdData (id, line);
|
|
||||||
|
|
||||||
tag.attributes ().setAttribute (label, value);
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
/**
|
|
||||||
*
|
|
||||||
*/
|
|
||||||
public void setAttribute (String id, int line, String label, int value)
|
|
||||||
{
|
|
||||||
setAttribute (id, line, label, (new Integer (value)).toString ());
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
/**
|
|
||||||
*
|
|
||||||
*/
|
|
||||||
public void setAttribute (String id, int line, String column, String label, String value)
|
|
||||||
{
|
|
||||||
IdData tag = this.getIdData (id, line, column);
|
|
||||||
|
|
||||||
tag.attributes ().setAttribute (label, value);
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
/**
|
|
||||||
*
|
|
||||||
*/
|
|
||||||
public void setAttribute (String id, int line, String column, String label, int value)
|
|
||||||
{
|
|
||||||
setAttribute (id, line, column, label, (new Integer (value)).toString ());
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
/**
|
|
||||||
*
|
|
||||||
*/
|
|
||||||
public void appendAttribute (String id, int line, String column, String label, String value)
|
|
||||||
{
|
|
||||||
IdData tag = this.getIdData (id, line, column);
|
|
||||||
|
|
||||||
tag.attributes ().appendAttribute (label, value);
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
/**
|
|
||||||
*
|
|
||||||
*/
|
|
||||||
public void appendAttribute (String id, String label, String value)
|
|
||||||
{
|
|
||||||
IdData tag = this.getIdData (id);
|
|
||||||
|
|
||||||
tag.attributes ().appendAttribute (label, value);
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
/**
|
|
||||||
*
|
|
||||||
*/
|
|
||||||
public void appendAttribute (String id, String label, int value)
|
|
||||||
{
|
|
||||||
appendAttribute (id, label, (new Integer (value)).toString ());
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
/**
|
|
||||||
*
|
|
||||||
*/
|
|
||||||
public void appendContent (String id, int line, String value)
|
|
||||||
{
|
|
||||||
IdData tag = this.getIdData (id, line);
|
|
||||||
|
|
||||||
tag.appendContent (value);
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
/**
|
|
||||||
*
|
|
||||||
*/
|
|
||||||
public void appendContent (String id, int line, int value)
|
|
||||||
{
|
|
||||||
appendContent (id, line, (new Integer (value)).toString ());
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
/**
|
|
||||||
*
|
|
||||||
*/
|
|
||||||
public void appendContent (String id, int line, String column, String value)
|
|
||||||
{
|
|
||||||
IdData tag = this.getIdData (id, line, column);
|
|
||||||
|
|
||||||
tag.appendContent (value);
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
/**
|
|
||||||
*
|
|
||||||
*/
|
|
||||||
public void appendContent (String id, int line, String column, int value)
|
|
||||||
{
|
|
||||||
appendContent (id, line, column, (new Integer (value)).toString ());
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,8 +1,8 @@
|
||||||
package fr.devinsy.xid;
|
package fr.devinsy.xid;
|
||||||
|
|
||||||
import java.io.StringWriter;
|
import java.io.StringWriter;
|
||||||
import org.w3c.dom.Document;
|
|
||||||
|
|
||||||
|
import org.w3c.dom.Document;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
*
|
*
|
||||||
|
@ -11,10 +11,10 @@ public class DomPresenter extends Presenter
|
||||||
{
|
{
|
||||||
static final public char INDEX_SEPARATOR = '_';
|
static final public char INDEX_SEPARATOR = '_';
|
||||||
|
|
||||||
static protected org.apache.log4j.Logger logger = org.apache.log4j.Logger.getLogger (DomPresenter.class);
|
static private org.apache.log4j.Logger logger = org.apache.log4j.Logger.getLogger(DomPresenter.class);
|
||||||
protected Document doc;
|
protected Document doc;
|
||||||
|
|
||||||
/*
|
/**
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
public DomPresenter()
|
public DomPresenter()
|
||||||
|
@ -22,17 +22,14 @@ public class DomPresenter extends Presenter
|
||||||
this.doc = null;
|
this.doc = null;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
/*
|
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
public DomPresenter (Document doc)
|
public DomPresenter(final Document doc)
|
||||||
{
|
{
|
||||||
this.doc = doc;
|
setSource(doc);
|
||||||
DomPresenter.addMetaTag (this.doc, "generator", "XID 0.0");
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
|
@ -46,54 +43,18 @@ public class DomPresenter extends Presenter
|
||||||
return (result);
|
return (result);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
public void setDom (Document doc)
|
public StringBuffer doXid(final Data datas) throws Exception
|
||||||
{
|
|
||||||
this.doc = doc;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
/*
|
|
||||||
*
|
|
||||||
*/
|
|
||||||
public void setSource (Document doc)
|
|
||||||
{
|
|
||||||
this.doc = doc;
|
|
||||||
|
|
||||||
Presenter.addMetaTag (this.doc, "generator", "XID 0.0");
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
/*
|
|
||||||
*
|
|
||||||
*/
|
|
||||||
public Object source ()
|
|
||||||
{
|
|
||||||
Object result;
|
|
||||||
|
|
||||||
result = this.doc;
|
|
||||||
|
|
||||||
//
|
|
||||||
return (result);
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
/*
|
|
||||||
*
|
|
||||||
*/
|
|
||||||
public StringBuffer doXid (Data datas) throws Exception
|
|
||||||
{
|
{
|
||||||
return (doXid(datas.getIdsDataById()));
|
return (doXid(datas.getIdsDataById()));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
/*
|
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
public StringBuffer doXid (IdsDataById datas) throws Exception
|
public StringBuffer doXid(final IdsDataById datas) throws Exception
|
||||||
{
|
{
|
||||||
StringBuffer result;
|
StringBuffer result;
|
||||||
|
|
||||||
|
@ -116,11 +77,40 @@ public class DomPresenter extends Presenter
|
||||||
return (result);
|
return (result);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
*
|
||||||
|
*/
|
||||||
|
public void setDom(final Document doc)
|
||||||
|
{
|
||||||
|
this.doc = doc;
|
||||||
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
|
*
|
||||||
|
*/
|
||||||
|
public void setSource(final Document doc)
|
||||||
|
{
|
||||||
|
this.doc = doc;
|
||||||
|
addMetaTag(this.doc, "generator", "XID 0.0");
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
*
|
||||||
|
*/
|
||||||
|
public Object source()
|
||||||
|
{
|
||||||
|
Object result;
|
||||||
|
|
||||||
|
result = this.doc;
|
||||||
|
|
||||||
|
//
|
||||||
|
return (result);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
* Xid a file with data.
|
* Xid a file with data.
|
||||||
*/
|
*/
|
||||||
static public StringBuffer doXid (Document doc, IdsDataById datas) throws Exception
|
static public StringBuffer doXid(final Document doc, final IdsDataById datas) throws Exception
|
||||||
{
|
{
|
||||||
StringBuffer result;
|
StringBuffer result;
|
||||||
|
|
||||||
|
|
|
@ -5,19 +5,18 @@ import java.io.File;
|
||||||
import java.io.FileReader;
|
import java.io.FileReader;
|
||||||
import java.io.StringWriter;
|
import java.io.StringWriter;
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
public class FilePresenter extends DomPresenter
|
public class FilePresenter extends DomPresenter
|
||||||
{
|
{
|
||||||
static protected org.apache.log4j.Logger logger = org.apache.log4j.Logger.getLogger (FilePresenter.class);
|
static private org.apache.log4j.Logger logger = org.apache.log4j.Logger.getLogger(FilePresenter.class);
|
||||||
|
|
||||||
protected String sourceFilePathname;
|
private String sourceFilePathname;
|
||||||
protected long sourceFileTime;
|
private long sourceFileTime;
|
||||||
protected String doctype;
|
private String doctype;
|
||||||
|
|
||||||
/*
|
/**
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
public FilePresenter()
|
public FilePresenter()
|
||||||
|
@ -28,11 +27,10 @@ public class FilePresenter extends DomPresenter
|
||||||
this.doctype = "";
|
this.doctype = "";
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
/*
|
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
public FilePresenter (String filePathname)
|
public FilePresenter(final String filePathname)
|
||||||
{
|
{
|
||||||
this.sourceFilePathname = filePathname;
|
this.sourceFilePathname = filePathname;
|
||||||
this.sourceFileTime = 0;
|
this.sourceFileTime = 0;
|
||||||
|
@ -40,46 +38,20 @@ public class FilePresenter extends DomPresenter
|
||||||
this.doctype = "";
|
this.doctype = "";
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
/*
|
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
public void setSource (String filePathname)
|
@Override
|
||||||
{
|
public StringBuffer doXid(final Data datas) throws Exception
|
||||||
this.sourceFilePathname = filePathname;
|
|
||||||
this.sourceFileTime = 0;
|
|
||||||
this.doc = null;
|
|
||||||
this.doctype = "";
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
/*
|
|
||||||
*
|
|
||||||
*/
|
|
||||||
public String source ()
|
|
||||||
{
|
|
||||||
String result;
|
|
||||||
|
|
||||||
result = this.sourceFilePathname;
|
|
||||||
|
|
||||||
//
|
|
||||||
return (result);
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
/*
|
|
||||||
*
|
|
||||||
*/
|
|
||||||
public StringBuffer doXid (Data datas) throws Exception
|
|
||||||
{
|
{
|
||||||
return (doXid(datas.getIdsDataById()));
|
return (doXid(datas.getIdsDataById()));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
/*
|
|
||||||
* No need to be synchronized.
|
* No need to be synchronized.
|
||||||
*/
|
*/
|
||||||
public StringBuffer doXid (IdsDataById datas) throws Exception
|
@Override
|
||||||
|
public StringBuffer doXid(final IdsDataById datas) throws Exception
|
||||||
{
|
{
|
||||||
StringBuffer result;
|
StringBuffer result;
|
||||||
|
|
||||||
|
@ -95,8 +67,7 @@ public class FilePresenter extends DomPresenter
|
||||||
result = null;
|
result = null;
|
||||||
throw new Exception(errorMessage);
|
throw new Exception(errorMessage);
|
||||||
}
|
}
|
||||||
else if ((this.doc == null) ||
|
else if ((this.doc == null) || (this.sourceFileTime != source.lastModified()))
|
||||||
(this.sourceFileTime != source.lastModified ()))
|
|
||||||
{
|
{
|
||||||
this.sourceFileTime = source.lastModified();
|
this.sourceFileTime = source.lastModified();
|
||||||
this.doc = Presenter.fileToTree(this.sourceFilePathname);
|
this.doc = Presenter.fileToTree(this.sourceFilePathname);
|
||||||
|
@ -119,38 +90,35 @@ public class FilePresenter extends DomPresenter
|
||||||
return (result);
|
return (result);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
*
|
||||||
|
*/
|
||||||
|
public void setSource(final String filePathname)
|
||||||
|
{
|
||||||
|
this.sourceFilePathname = filePathname;
|
||||||
|
this.sourceFileTime = 0;
|
||||||
|
this.doc = null;
|
||||||
|
this.doctype = "";
|
||||||
|
}
|
||||||
|
|
||||||
static public String getDoctype (String filePathname) throws Exception
|
/**
|
||||||
|
*
|
||||||
|
*/
|
||||||
|
@Override
|
||||||
|
public String source()
|
||||||
{
|
{
|
||||||
String result;
|
String result;
|
||||||
|
|
||||||
//
|
result = this.sourceFilePathname;
|
||||||
BufferedReader in = new BufferedReader (new FileReader (filePathname));
|
|
||||||
String doctype = in.readLine();
|
|
||||||
in.close();
|
|
||||||
|
|
||||||
logger.info("doctype=[" + doctype + "]");
|
|
||||||
|
|
||||||
//
|
|
||||||
if ((doctype.startsWith ("<!DOCTYPE")) ||
|
|
||||||
(doctype.startsWith ("<!doctype")))
|
|
||||||
{
|
|
||||||
result = doctype;
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
result = null;
|
|
||||||
}
|
|
||||||
|
|
||||||
//
|
//
|
||||||
return (result);
|
return (result);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
/*
|
|
||||||
* Xid a file without data.
|
* Xid a file without data.
|
||||||
*/
|
*/
|
||||||
static public StringBuffer doXid (String filePathname) throws Exception
|
static public StringBuffer doXid(final String filePathname) throws Exception
|
||||||
{
|
{
|
||||||
StringBuffer result;
|
StringBuffer result;
|
||||||
|
|
||||||
|
@ -162,11 +130,10 @@ public class FilePresenter extends DomPresenter
|
||||||
return (result);
|
return (result);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
/*
|
|
||||||
* Xid a file.
|
* Xid a file.
|
||||||
*/
|
*/
|
||||||
static public StringBuffer doXid (String filePathname, Data datas) throws Exception
|
static public StringBuffer doXid(final String filePathname, final Data datas) throws Exception
|
||||||
{
|
{
|
||||||
StringBuffer result;
|
StringBuffer result;
|
||||||
|
|
||||||
|
@ -177,4 +144,35 @@ public class FilePresenter extends DomPresenter
|
||||||
//
|
//
|
||||||
return (result);
|
return (result);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
*
|
||||||
|
* @param filePathname
|
||||||
|
* @return
|
||||||
|
* @throws Exception
|
||||||
|
*/
|
||||||
|
static public String getDoctype(final String filePathname) throws Exception
|
||||||
|
{
|
||||||
|
String result;
|
||||||
|
|
||||||
|
//
|
||||||
|
BufferedReader in = new BufferedReader(new FileReader(filePathname));
|
||||||
|
String doctype = in.readLine();
|
||||||
|
in.close();
|
||||||
|
|
||||||
|
logger.info("doctype=[" + doctype + "]");
|
||||||
|
|
||||||
|
//
|
||||||
|
if ((doctype.startsWith("<!DOCTYPE")) || (doctype.startsWith("<!doctype")))
|
||||||
|
{
|
||||||
|
result = doctype;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
result = null;
|
||||||
|
}
|
||||||
|
|
||||||
|
//
|
||||||
|
return (result);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -6,18 +6,15 @@
|
||||||
|
|
||||||
package fr.devinsy.xid;
|
package fr.devinsy.xid;
|
||||||
|
|
||||||
|
|
||||||
import java.util.Vector;
|
import java.util.Vector;
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
public class FilePresenters extends Vector<FilePresenter>
|
public class FilePresenters extends Vector<FilePresenter>
|
||||||
{
|
{
|
||||||
private static final long serialVersionUID = 7058868685681354293L;
|
private static final long serialVersionUID = 7058868685681354293L;
|
||||||
static protected org.apache.log4j.Logger logger = org.apache.log4j.Logger.getLogger (FilePresenters.class);
|
static private org.apache.log4j.Logger logger = org.apache.log4j.Logger.getLogger(FilePresenters.class);
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
*
|
*
|
||||||
|
@ -27,11 +24,10 @@ public class FilePresenters extends Vector<FilePresenter>
|
||||||
super();
|
super();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
public FilePresenters (FilePresenters source)
|
public FilePresenters(final FilePresenters source)
|
||||||
{
|
{
|
||||||
super();
|
super();
|
||||||
for (FilePresenter presenter : source)
|
for (FilePresenter presenter : source)
|
||||||
|
@ -40,15 +36,13 @@ public class FilePresenters extends Vector<FilePresenter>
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
public boolean exists (String source)
|
public boolean exists(final String source)
|
||||||
{
|
{
|
||||||
boolean result;
|
boolean result;
|
||||||
|
|
||||||
|
|
||||||
if (this.getBySource(source) == null)
|
if (this.getBySource(source) == null)
|
||||||
{
|
{
|
||||||
result = false;
|
result = false;
|
||||||
|
@ -62,11 +56,10 @@ public class FilePresenters extends Vector<FilePresenter>
|
||||||
return (result);
|
return (result);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
public FilePresenter getByIndex (int id)
|
public FilePresenter getByIndex(final int id)
|
||||||
{
|
{
|
||||||
FilePresenter result;
|
FilePresenter result;
|
||||||
|
|
||||||
|
@ -76,11 +69,10 @@ public class FilePresenters extends Vector<FilePresenter>
|
||||||
return (result);
|
return (result);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
public FilePresenter getBySource (String source)
|
public FilePresenter getBySource(final String source)
|
||||||
{
|
{
|
||||||
FilePresenter result;
|
FilePresenter result;
|
||||||
|
|
||||||
|
@ -121,11 +113,10 @@ public class FilePresenters extends Vector<FilePresenter>
|
||||||
return (result);
|
return (result);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
public int getIndexOf (String source)
|
public int getIndexOf(final String source)
|
||||||
{
|
{
|
||||||
int result;
|
int result;
|
||||||
|
|
||||||
|
@ -166,10 +157,10 @@ public class FilePresenters extends Vector<FilePresenter>
|
||||||
return (result);
|
return (result);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
|
@Override
|
||||||
public String toString()
|
public String toString()
|
||||||
{
|
{
|
||||||
String result;
|
String result;
|
||||||
|
|
|
@ -1,6 +1,5 @@
|
||||||
package fr.devinsy.xid;
|
package fr.devinsy.xid;
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
|
@ -8,9 +7,8 @@ public class FilePresentersProxy
|
||||||
{
|
{
|
||||||
static private org.apache.log4j.Logger logger = org.apache.log4j.Logger.getLogger(FilePresentersProxy.class);
|
static private org.apache.log4j.Logger logger = org.apache.log4j.Logger.getLogger(FilePresentersProxy.class);
|
||||||
|
|
||||||
|
|
||||||
private static FilePresentersProxy instance = null;
|
private static FilePresentersProxy instance = null;
|
||||||
protected FilePresenters presenters = null;
|
private FilePresenters presenters = null;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
*
|
*
|
||||||
|
@ -20,30 +18,10 @@ public class FilePresentersProxy
|
||||||
this.presenters = new FilePresenters();
|
this.presenters = new FilePresenters();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
public static FilePresentersProxy instance () throws Exception
|
public FilePresenter getBySource(final String source) throws Exception
|
||||||
{
|
|
||||||
FilePresentersProxy result;
|
|
||||||
|
|
||||||
if (FilePresentersProxy.instance == null)
|
|
||||||
{
|
|
||||||
instance = new FilePresentersProxy ();
|
|
||||||
}
|
|
||||||
|
|
||||||
result = instance;
|
|
||||||
|
|
||||||
//
|
|
||||||
return (result);
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
/**
|
|
||||||
*
|
|
||||||
*/
|
|
||||||
public FilePresenter getBySource(String source) throws Exception
|
|
||||||
{
|
{
|
||||||
FilePresenter result;
|
FilePresenter result;
|
||||||
|
|
||||||
|
@ -64,6 +42,24 @@ public class FilePresentersProxy
|
||||||
//
|
//
|
||||||
return (result);
|
return (result);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
*
|
||||||
|
*/
|
||||||
|
public static FilePresentersProxy instance() throws Exception
|
||||||
|
{
|
||||||
|
FilePresentersProxy result;
|
||||||
|
|
||||||
|
if (FilePresentersProxy.instance == null)
|
||||||
|
{
|
||||||
|
instance = new FilePresentersProxy();
|
||||||
|
}
|
||||||
|
|
||||||
|
result = instance;
|
||||||
|
|
||||||
|
//
|
||||||
|
return (result);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// ////////////////////////////////////////////////////////////////////////
|
// ////////////////////////////////////////////////////////////////////////
|
|
@ -2,35 +2,39 @@ package fr.devinsy.xid;
|
||||||
|
|
||||||
import java.io.Serializable;
|
import java.io.Serializable;
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* IdData class is used to hold application data and
|
* IdData class is used to hold application data and the business logic that
|
||||||
* the business logic that operates on the data.
|
* operates on the data.
|
||||||
*
|
*
|
||||||
* The only requirement of a IdData class is that it must implement a
|
* The only requirement of a IdData class is that it must implement a display
|
||||||
* display method. The display method must return a text representation
|
* method. The display method must return a text representation of the data,
|
||||||
* of the data, suitable for display in a web page.
|
* suitable for display in a web page.
|
||||||
*
|
*
|
||||||
* XID provides a User Input IdData, Text IdData and ...
|
* XID provides a User Input IdData, Text IdData and ... application may also
|
||||||
* application may also implement it's own IdData classes.
|
* implement it's own IdData classes.
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
public class IdData implements Serializable, IdDataCore
|
public class IdData implements Serializable, IdDataCore
|
||||||
{
|
{
|
||||||
private static final long serialVersionUID = 8976245034682639923L;
|
public enum IterationStrategy
|
||||||
|
{
|
||||||
|
ONLY_FIRST_ROW, ONLY_FIRST_TWO_ROWS, ONLY_ROWS_WITH_ID, ONLY_ROWS_WITHOUT_ID, ALL_ROWS
|
||||||
|
}
|
||||||
|
|
||||||
|
public enum MODE
|
||||||
|
{
|
||||||
|
REPLACE, APPEND, IGNORE
|
||||||
|
}
|
||||||
|
|
||||||
public enum IterationStrategy {ONLY_FIRST_ROW, ONLY_FIRST_TWO_ROWS, ONLY_ROWS_WITH_ID, ONLY_ROWS_WITHOUT_ID, ALL_ROWS}
|
private static final long serialVersionUID = 8976245034682639923L;;
|
||||||
|
|
||||||
public enum MODE {REPLACE, APPEND, IGNORE};
|
private IterationStrategy iterationStrategy;
|
||||||
|
private Attributes attributes;
|
||||||
|
private boolean excludeSection;
|
||||||
|
private MODE displayMode = MODE.REPLACE;
|
||||||
|
private String content;
|
||||||
|
|
||||||
protected IterationStrategy iterationStrategy;
|
/**
|
||||||
protected Attributes attributes;
|
|
||||||
protected boolean excludeSection;
|
|
||||||
protected MODE displayMode = MODE.REPLACE;
|
|
||||||
protected String content;
|
|
||||||
|
|
||||||
/*
|
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
public IdData()
|
public IdData()
|
||||||
|
@ -42,11 +46,10 @@ public class IdData implements Serializable, IdDataCore
|
||||||
this.iterationStrategy = IterationStrategy.ALL_ROWS;
|
this.iterationStrategy = IterationStrategy.ALL_ROWS;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
/*
|
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
public IdData (String text)
|
public IdData(final String text)
|
||||||
{
|
{
|
||||||
this.attributes = null;
|
this.attributes = null;
|
||||||
this.excludeSection = false;
|
this.excludeSection = false;
|
||||||
|
@ -55,34 +58,10 @@ public class IdData implements Serializable, IdDataCore
|
||||||
this.iterationStrategy = IterationStrategy.ALL_ROWS;
|
this.iterationStrategy = IterationStrategy.ALL_ROWS;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
/*
|
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
public String display ()
|
public void appendContent(final String text)
|
||||||
{
|
|
||||||
String result;
|
|
||||||
|
|
||||||
result = this.content;
|
|
||||||
|
|
||||||
//
|
|
||||||
return (result);
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
/*
|
|
||||||
*
|
|
||||||
*/
|
|
||||||
public void setContent (String text)
|
|
||||||
{
|
|
||||||
this.content = text;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
/*
|
|
||||||
*
|
|
||||||
*/
|
|
||||||
public void appendContent (String text)
|
|
||||||
{
|
{
|
||||||
if (this.content == null)
|
if (this.content == null)
|
||||||
{
|
{
|
||||||
|
@ -94,30 +73,7 @@ public class IdData implements Serializable, IdDataCore
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
/*
|
|
||||||
*
|
|
||||||
*/
|
|
||||||
public void setDisplayMode(MODE displayMode)
|
|
||||||
{
|
|
||||||
this.displayMode = displayMode;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
/*
|
|
||||||
*
|
|
||||||
*/
|
|
||||||
public MODE displayMode()
|
|
||||||
{
|
|
||||||
MODE result;
|
|
||||||
|
|
||||||
result = this.displayMode;
|
|
||||||
|
|
||||||
return (result);
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
/*
|
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
public Attributes attributes()
|
public Attributes attributes()
|
||||||
|
@ -135,17 +91,32 @@ public class IdData implements Serializable, IdDataCore
|
||||||
return (result);
|
return (result);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
/*
|
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
public void setExcludeSection(boolean excludeSection)
|
public String display()
|
||||||
{
|
{
|
||||||
this.excludeSection = excludeSection;
|
String result;
|
||||||
|
|
||||||
|
result = this.content;
|
||||||
|
|
||||||
|
//
|
||||||
|
return (result);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
*
|
||||||
|
*/
|
||||||
|
public MODE displayMode()
|
||||||
|
{
|
||||||
|
MODE result;
|
||||||
|
|
||||||
/*
|
result = this.displayMode;
|
||||||
|
|
||||||
|
return (result);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
public boolean excludeSection()
|
public boolean excludeSection()
|
||||||
|
@ -158,16 +129,6 @@ public class IdData implements Serializable, IdDataCore
|
||||||
return (result);
|
return (result);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
/**
|
|
||||||
*
|
|
||||||
*/
|
|
||||||
public void setIterationStrategy (IterationStrategy strategy)
|
|
||||||
{
|
|
||||||
this.iterationStrategy = strategy;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
|
@ -180,4 +141,36 @@ public class IdData implements Serializable, IdDataCore
|
||||||
//
|
//
|
||||||
return (result);
|
return (result);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
*
|
||||||
|
*/
|
||||||
|
public void setContent(final String text)
|
||||||
|
{
|
||||||
|
this.content = text;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
*
|
||||||
|
*/
|
||||||
|
public void setDisplayMode(final MODE displayMode)
|
||||||
|
{
|
||||||
|
this.displayMode = displayMode;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
*
|
||||||
|
*/
|
||||||
|
public void setExcludeSection(final boolean excludeSection)
|
||||||
|
{
|
||||||
|
this.excludeSection = excludeSection;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
*
|
||||||
|
*/
|
||||||
|
public void setIterationStrategy(final IterationStrategy strategy)
|
||||||
|
{
|
||||||
|
this.iterationStrategy = strategy;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,8 +1,8 @@
|
||||||
package fr.devinsy.xid;
|
package fr.devinsy.xid;
|
||||||
|
|
||||||
import java.util.*;
|
import java.util.HashMap;
|
||||||
|
|
||||||
/*
|
/**
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
public class IdsDataById extends HashMap<String, IdDataCore> implements IdDataCore
|
public class IdsDataById extends HashMap<String, IdDataCore> implements IdDataCore
|
||||||
|
@ -10,7 +10,7 @@ public class IdsDataById extends HashMap<String, IdDataCore> implements IdDataCo
|
||||||
|
|
||||||
private static final long serialVersionUID = -5787252043825503554L;
|
private static final long serialVersionUID = -5787252043825503554L;
|
||||||
|
|
||||||
/*
|
/**
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
public IdsDataById()
|
public IdsDataById()
|
||||||
|
@ -18,18 +18,10 @@ public class IdsDataById extends HashMap<String, IdDataCore> implements IdDataCo
|
||||||
super();
|
super();
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
/**
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
public void setId (String id, IdDataCore data)
|
public IdDataCore getId(final String id)
|
||||||
{
|
|
||||||
this.put (id, data);
|
|
||||||
}
|
|
||||||
|
|
||||||
/*
|
|
||||||
*
|
|
||||||
*/
|
|
||||||
public IdDataCore getId (String id)
|
|
||||||
{
|
{
|
||||||
IdDataCore result;
|
IdDataCore result;
|
||||||
|
|
||||||
|
@ -39,4 +31,12 @@ public class IdsDataById extends HashMap<String, IdDataCore> implements IdDataCo
|
||||||
return (result);
|
return (result);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
*
|
||||||
|
*/
|
||||||
|
public void setId(final String id, final IdDataCore data)
|
||||||
|
{
|
||||||
|
this.put(id, data);
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,9 +1,8 @@
|
||||||
package fr.devinsy.xid;
|
package fr.devinsy.xid;
|
||||||
|
|
||||||
import java.util.*;
|
import java.util.Vector;
|
||||||
|
|
||||||
|
/**
|
||||||
/*
|
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
public class IdsDataByIndex extends Vector<IdDataCore> implements IdDataCore
|
public class IdsDataByIndex extends Vector<IdDataCore> implements IdDataCore
|
||||||
|
|
|
@ -1,22 +1,24 @@
|
||||||
package fr.devinsy.xid;
|
package fr.devinsy.xid;
|
||||||
|
|
||||||
import org.xml.sax.*;
|
import java.util.Vector;
|
||||||
import java.util.*;
|
|
||||||
|
import org.xml.sax.ErrorHandler;
|
||||||
|
import org.xml.sax.SAXParseException;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Extract from org.xml.sax Interface ErrorHandler:
|
* Extract from org.xml.sax Interface ErrorHandler: "If a SAX application needs
|
||||||
* "If a SAX application needs to implement customized error handling,
|
* to implement customized error handling, it must implement this interface and
|
||||||
* it must implement this interface and then register an instance with
|
* then register an instance with the XML reader using the setErrorHandler
|
||||||
* the XML reader using the setErrorHandler method. The parser will
|
* method. The parser will then report all errors and warnings through this
|
||||||
* then report all errors and warnings through this interface."
|
* interface."
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
public class ParserErrorHandler implements ErrorHandler
|
public class ParserErrorHandler implements ErrorHandler
|
||||||
{
|
{
|
||||||
Vector<String> messages;
|
private Vector<String> messages;
|
||||||
int fatalErrorsCount;
|
private int fatalErrorsCount;
|
||||||
int errorsCount;
|
private int errorsCount;
|
||||||
int warningCount;
|
private int warningCount;
|
||||||
|
|
||||||
public ParserErrorHandler()
|
public ParserErrorHandler()
|
||||||
{
|
{
|
||||||
|
@ -26,20 +28,35 @@ public class ParserErrorHandler implements ErrorHandler
|
||||||
messages = new Vector<String>();
|
messages = new Vector<String>();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
public int fatalErrorsCount ()
|
public int allErrorsCount()
|
||||||
{
|
{
|
||||||
int result;
|
int result;
|
||||||
|
|
||||||
result = this.fatalErrorsCount;
|
result = fatalErrorsCount() + errorsCount() + warningCount();
|
||||||
|
|
||||||
//
|
//
|
||||||
return (result);
|
return (result);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Called by the XML parser to handle fatal errors.
|
||||||
|
*
|
||||||
|
* @param ex
|
||||||
|
* Parse Excpetion. Contains the warning text and the line
|
||||||
|
* number.
|
||||||
|
*/
|
||||||
|
@Override
|
||||||
|
public void error(final SAXParseException exception)
|
||||||
|
{
|
||||||
|
String message = "Error at line " + exception.getLineNumber() + " : " + exception.getMessage();
|
||||||
|
|
||||||
|
this.errorsCount += 1;
|
||||||
|
this.messages.add(message);
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
|
@ -54,26 +71,30 @@ public class ParserErrorHandler implements ErrorHandler
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
* Called by the XML parser to handle fatal errors.
|
||||||
*
|
*
|
||||||
|
* @param ex
|
||||||
|
* Parse Excpetion. Contains the error text and the line number.
|
||||||
|
* When a fatal parse error occurs, the parse does not return a
|
||||||
|
* document.
|
||||||
*/
|
*/
|
||||||
public int warningCount ()
|
@Override
|
||||||
|
public void fatalError(final SAXParseException exception)
|
||||||
{
|
{
|
||||||
int result;
|
String message = "Fatal error at line " + exception.getLineNumber() + " : " + exception.getMessage();
|
||||||
|
|
||||||
result = this.warningCount;
|
this.fatalErrorsCount += 1;
|
||||||
|
this.messages.add(message);
|
||||||
//
|
|
||||||
return (result);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
public int allErrorsCount ()
|
public int fatalErrorsCount()
|
||||||
{
|
{
|
||||||
int result;
|
int result;
|
||||||
|
|
||||||
result = fatalErrorsCount () + errorsCount () + warningCount ();
|
result = this.fatalErrorsCount;
|
||||||
|
|
||||||
//
|
//
|
||||||
return (result);
|
return (result);
|
||||||
|
@ -99,48 +120,10 @@ public class ParserErrorHandler implements ErrorHandler
|
||||||
return (result);
|
return (result);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Called by the XML parser to handle fatal errors.
|
|
||||||
* @param ex Parse Excpetion. Contains the warning text and the line number.
|
|
||||||
*/
|
|
||||||
public void error (SAXParseException exception)
|
|
||||||
{
|
|
||||||
String message = "Error at line " + exception.getLineNumber() + " : " + exception.getMessage();
|
|
||||||
|
|
||||||
this.errorsCount += 1;
|
|
||||||
this.messages.add (message);
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Called by the XML parser to handle fatal errors.
|
|
||||||
* @param ex Parse Excpetion. Contains the error text and the line number.
|
|
||||||
* When a fatal parse error occurs, the parse does not return a document.
|
|
||||||
*/
|
|
||||||
public void fatalError (SAXParseException exception)
|
|
||||||
{
|
|
||||||
String message = "Fatal error at line " + exception.getLineNumber() + " : " + exception.getMessage();
|
|
||||||
|
|
||||||
this.fatalErrorsCount += 1;
|
|
||||||
this.messages.add (message);
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Called by the XML parser to handle warnings.
|
|
||||||
* @param ex Parse Excpetion. Contains the warning text and the line number.
|
|
||||||
*/
|
|
||||||
public void warning(SAXParseException exception)
|
|
||||||
{
|
|
||||||
String message = "Warning at line " + exception.getLineNumber() + " : " + exception.getMessage();
|
|
||||||
|
|
||||||
this.warningCount += 1;
|
|
||||||
this.messages.add (message);
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
|
@Override
|
||||||
public String toString()
|
public String toString()
|
||||||
{
|
{
|
||||||
StringBuffer result;
|
StringBuffer result;
|
||||||
|
@ -156,4 +139,33 @@ public class ParserErrorHandler implements ErrorHandler
|
||||||
//
|
//
|
||||||
return (result.toString());
|
return (result.toString());
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Called by the XML parser to handle warnings.
|
||||||
|
*
|
||||||
|
* @param ex
|
||||||
|
* Parse Excpetion. Contains the warning text and the line
|
||||||
|
* number.
|
||||||
|
*/
|
||||||
|
@Override
|
||||||
|
public void warning(final SAXParseException exception)
|
||||||
|
{
|
||||||
|
String message = "Warning at line " + exception.getLineNumber() + " : " + exception.getMessage();
|
||||||
|
|
||||||
|
this.warningCount += 1;
|
||||||
|
this.messages.add(message);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
*
|
||||||
|
*/
|
||||||
|
public int warningCount()
|
||||||
|
{
|
||||||
|
int result;
|
||||||
|
|
||||||
|
result = this.warningCount;
|
||||||
|
|
||||||
|
//
|
||||||
|
return (result);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
File diff suppressed because it is too large
Load diff
|
@ -3,21 +3,20 @@ package fr.devinsy.xid;
|
||||||
import java.io.ByteArrayInputStream;
|
import java.io.ByteArrayInputStream;
|
||||||
import java.io.StringWriter;
|
import java.io.StringWriter;
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
public class StringPresenter extends DomPresenter
|
public class StringPresenter extends DomPresenter
|
||||||
{
|
{
|
||||||
static protected org.apache.log4j.Logger logger;
|
static private org.apache.log4j.Logger logger;
|
||||||
static
|
static
|
||||||
{
|
{
|
||||||
logger = org.apache.log4j.Logger.getLogger(StringPresenter.class);
|
logger = org.apache.log4j.Logger.getLogger(StringPresenter.class);
|
||||||
}
|
}
|
||||||
|
|
||||||
protected String html;
|
private String html;
|
||||||
|
|
||||||
/*
|
/**
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
public StringPresenter()
|
public StringPresenter()
|
||||||
|
@ -27,53 +26,29 @@ public class StringPresenter extends DomPresenter
|
||||||
this.html = null;
|
this.html = null;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
/*
|
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
public StringPresenter (String html)
|
public StringPresenter(final String html)
|
||||||
{
|
{
|
||||||
this.doc = null;
|
this.doc = null;
|
||||||
this.html = html;
|
this.html = html;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
/*
|
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
public void setSource (String html)
|
@Override
|
||||||
{
|
public StringBuffer doXid(final Data datas) throws Exception
|
||||||
this.html = html;
|
|
||||||
this.doc = null;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
/*
|
|
||||||
*
|
|
||||||
*/
|
|
||||||
public String source ()
|
|
||||||
{
|
|
||||||
String result;
|
|
||||||
|
|
||||||
result = this.html;
|
|
||||||
|
|
||||||
//
|
|
||||||
return (result);
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
/*
|
|
||||||
*
|
|
||||||
*/
|
|
||||||
public StringBuffer doXid (Data datas) throws Exception
|
|
||||||
{
|
{
|
||||||
return (doXid(datas.getIdsDataById()));
|
return (doXid(datas.getIdsDataById()));
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
/**
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
public StringBuffer doXid (IdsDataById datas) throws Exception
|
@Override
|
||||||
|
public StringBuffer doXid(final IdsDataById datas) throws Exception
|
||||||
{
|
{
|
||||||
StringBuffer result;
|
StringBuffer result;
|
||||||
|
|
||||||
|
@ -81,10 +56,7 @@ public class StringPresenter extends DomPresenter
|
||||||
{
|
{
|
||||||
// Build doc from this.html.
|
// Build doc from this.html.
|
||||||
String htmlSource;
|
String htmlSource;
|
||||||
if ((this.html.startsWith ("<!DOCTYPE")) ||
|
if ((this.html.startsWith("<!DOCTYPE")) || (this.html.startsWith("<!doctype")) || (this.html.startsWith("<html>")) || (this.html.startsWith("<HTML>")))
|
||||||
(this.html.startsWith ("<!doctype")) ||
|
|
||||||
(this.html.startsWith ("<html>")) ||
|
|
||||||
(this.html.startsWith ("<HTML>")))
|
|
||||||
{
|
{
|
||||||
htmlSource = html;
|
htmlSource = html;
|
||||||
}
|
}
|
||||||
|
@ -94,13 +66,13 @@ public class StringPresenter extends DomPresenter
|
||||||
}
|
}
|
||||||
|
|
||||||
// StringBufferInputStream is deprecated so we use another solution.
|
// StringBufferInputStream is deprecated so we use another solution.
|
||||||
// (see http://www.developpez.net/forums/archive/index.php/t-14101.html).
|
// (see
|
||||||
|
// http://www.developpez.net/forums/archive/index.php/t-14101.html).
|
||||||
doc = buildTree(new ByteArrayInputStream(htmlSource.getBytes()));
|
doc = buildTree(new ByteArrayInputStream(htmlSource.getBytes()));
|
||||||
}
|
}
|
||||||
|
|
||||||
StringWriter htmlCode = new StringWriter(Presenter.estimatedTargetLength(this.html.length()));
|
StringWriter htmlCode = new StringWriter(Presenter.estimatedTargetLength(this.html.length()));
|
||||||
if ((this.html.startsWith ("<!DOCTYPE")) ||
|
if ((this.html.startsWith("<!DOCTYPE")) || (this.html.startsWith("<!doctype")))
|
||||||
(this.html.startsWith ("<!doctype")))
|
|
||||||
{
|
{
|
||||||
htmlCode.write(this.html.substring(0, this.html.indexOf('>')));
|
htmlCode.write(this.html.substring(0, this.html.indexOf('>')));
|
||||||
}
|
}
|
||||||
|
@ -111,10 +83,7 @@ public class StringPresenter extends DomPresenter
|
||||||
{
|
{
|
||||||
result = null;
|
result = null;
|
||||||
}
|
}
|
||||||
else if ((this.html.startsWith ("<!DOCTYPE")) ||
|
else if ((this.html.startsWith("<!DOCTYPE")) || (this.html.startsWith("<!doctype")) || (this.html.startsWith("<html>")) || (this.html.startsWith("<HTML>")))
|
||||||
(this.html.startsWith ("<!doctype")) ||
|
|
||||||
(this.html.startsWith ("<html>")) ||
|
|
||||||
(this.html.startsWith ("<HTML>")))
|
|
||||||
{
|
{
|
||||||
result = htmlTarget;
|
result = htmlTarget;
|
||||||
}
|
}
|
||||||
|
@ -136,20 +105,41 @@ public class StringPresenter extends DomPresenter
|
||||||
return (result);
|
return (result);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
/*
|
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
static public StringBuffer doXid (String html, Data datas) throws Exception
|
public void setSource(final String html)
|
||||||
|
{
|
||||||
|
this.html = html;
|
||||||
|
this.doc = null;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
*
|
||||||
|
*/
|
||||||
|
@Override
|
||||||
|
public String source()
|
||||||
|
{
|
||||||
|
String result;
|
||||||
|
|
||||||
|
result = this.html;
|
||||||
|
|
||||||
|
//
|
||||||
|
return (result);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
*
|
||||||
|
*/
|
||||||
|
static public StringBuffer doXid(final String html, final Data datas) throws Exception
|
||||||
{
|
{
|
||||||
return (doXid(html, datas.getIdsDataById()));
|
return (doXid(html, datas.getIdsDataById()));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
/*
|
|
||||||
* Xid a string with html in.
|
* Xid a string with html in.
|
||||||
*/
|
*/
|
||||||
static public StringBuffer doXid (String html, IdsDataById datas) throws Exception
|
static public StringBuffer doXid(final String html, final IdsDataById datas) throws Exception
|
||||||
{
|
{
|
||||||
StringBuffer result;
|
StringBuffer result;
|
||||||
|
|
||||||
|
|
|
@ -13,18 +13,7 @@ class XidTest
|
||||||
{
|
{
|
||||||
public enum MONTHS
|
public enum MONTHS
|
||||||
{
|
{
|
||||||
JANUARY,
|
JANUARY, FEBRUARY, MARCH, APRIL, MAY, JUNE, JULY, AUGUST, SEPTEMBER, OCTOBER, NOVEMBRE, DECEMBRE
|
||||||
FEBRUARY,
|
|
||||||
MARCH,
|
|
||||||
APRIL,
|
|
||||||
MAY,
|
|
||||||
JUNE,
|
|
||||||
JULY,
|
|
||||||
AUGUST,
|
|
||||||
SEPTEMBER,
|
|
||||||
OCTOBER,
|
|
||||||
NOVEMBRE,
|
|
||||||
DECEMBRE
|
|
||||||
}
|
}
|
||||||
|
|
||||||
static
|
static
|
||||||
|
@ -104,8 +93,7 @@ class XidTest
|
||||||
System.out.println(exception.getMessage());
|
System.out.println(exception.getMessage());
|
||||||
html = null;
|
html = null;
|
||||||
}
|
}
|
||||||
System.out.println(check("content and attributes", html,
|
System.out.println(check("content and attributes", html, "<div id=\"lastname\" style=\"background: blue;foreground: red;\" class=\"nameClass\">Spiderman</div>"));
|
||||||
"<div id=\"lastname\" style=\"background: blue;foreground: red;\" class=\"nameClass\">Spiderman</div>"));
|
|
||||||
|
|
||||||
// Populate attributes of Test 03.
|
// Populate attributes of Test 03.
|
||||||
System.out.println("----------------------------");
|
System.out.println("----------------------------");
|
||||||
|
@ -159,12 +147,9 @@ class XidTest
|
||||||
html = null;
|
html = null;
|
||||||
}
|
}
|
||||||
|
|
||||||
System.out
|
System.out.println(check("table 1 assertion 1", html, "<tr id=\"identity_0\"><td>noid</td><td id=\"nom_0\">Jemba</td><td id=\"prenom_0\">Epo</td></tr>"));
|
||||||
.println(check("table 1 assertion 1", html, "<tr id=\"identity_0\"><td>noid</td><td id=\"nom_0\">Jemba</td><td id=\"prenom_0\">Epo</td></tr>"));
|
System.out.println(check("table 1 assertion 2", html, "<tr id=\"identity_1\"><td>noid</td><td id=\"nom_1\">Momon</td><td id=\"prenom_1\">Christian</td></tr>"));
|
||||||
System.out.println(check("table 1 assertion 2", html,
|
System.out.println(check("table 1 assertion 3", html, "<tr id=\"identity_2\"><td>noid</td><td id=\"nom_2\">Tronche</td><td id=\"prenom_2\">Christophe</td></tr>"));
|
||||||
"<tr id=\"identity_1\"><td>noid</td><td id=\"nom_1\">Momon</td><td id=\"prenom_1\">Christian</td></tr>"));
|
|
||||||
System.out.println(check("table 1 assertion 3", html,
|
|
||||||
"<tr id=\"identity_2\"><td>noid</td><td id=\"nom_2\">Tronche</td><td id=\"prenom_2\">Christophe</td></tr>"));
|
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* // Populate attributes of Test 03. System.out.println
|
* // Populate attributes of Test 03. System.out.println
|
||||||
|
|
Loading…
Reference in a new issue