TAILIEUCHUNG - Java Extreme Programming Cookbook phần 9

Thẻ khối được sử dụng để lặp lại và thực hiện logic, đó là đồng nghĩa với các vòng lặp và nếu báo cáo. Đoạn dưới đây cho thấy làm thế nào để lặp qua tất cả các lớp học bằng cách sử dụng thẻ được xây dựng trong mẫu hạng Đoạn dưới đây cho thấy làm thế nào để lặp qua tất cả các lớp học bằng cách sử dụng thẻ được xây dựng | Block tags are used for iterating and performing logic which is synonymous with for loops and if statements. The snippet below shows how to iterate through all classes using the built-in Class template tag XDtClass forAllClasses XDtClass forAllClasses The next snippet shows how to check if a method contains a specific @ tag using the built-in Method template tag. In this example we are checking for deprecated XDtMethod ifHasMethodTag tagName deprecated XDtMethod ifHasMethodTag Content Content tags are used for outputting information. These tags are synonymous with getter methods that return a string. Content tags never contain nested information. The snippet below shows how to output the current method name using the built-in Method template tag. XDtMethod methodName A template tag is very similar to an XML tag. The first part of the tag represents the namespace. For example XDtMethod is a namespace. The part directly after the namespace represents the tag name. For example methodName is a tag name. By convention all namespaces begin with XDt . This prefix is not directly part of the namespace and is stripped off by XDoclet when the template is being parsed. Now let s delve into creating a custom template. Example 9-9 shows a custom template used to generate a code-deprecation report. The custom template uses template tags defined by XDoclet. The first step is to create a new template file and add it to your project. This recipe creates a new template file called and places it in the resources directory. This template generates a report of all classes and methods marked as deprecated. Take note that the tagName attribute omits the @ character. Example 9-9. template file Deprecated Classes and Methods XDtClass forAllClasses XDtClass fullClassName XDtClass ifHasClassTag tagName deprecated WARNING This class is deprecated. NOTE XDtClass classTagValue tagName deprecated XDtClass ifHasClassTag XDtClass .

TỪ KHÓA LIÊN QUAN
TAILIEUCHUNG - Chia sẻ tài liệu không giới hạn
Địa chỉ : 444 Hoang Hoa Tham, Hanoi, Viet Nam
Website : tailieuchung.com
Email : tailieuchung20@gmail.com
Tailieuchung.com là thư viện tài liệu trực tuyến, nơi chia sẽ trao đổi hàng triệu tài liệu như luận văn đồ án, sách, giáo trình, đề thi.
Chúng tôi không chịu trách nhiệm liên quan đến các vấn đề bản quyền nội dung tài liệu được thành viên tự nguyện đăng tải lên, nếu phát hiện thấy tài liệu xấu hoặc tài liệu có bản quyền xin hãy email cho chúng tôi.
Đã phát hiện trình chặn quảng cáo AdBlock
Trang web này phụ thuộc vào doanh thu từ số lần hiển thị quảng cáo để tồn tại. Vui lòng tắt trình chặn quảng cáo của bạn hoặc tạm dừng tính năng chặn quảng cáo cho trang web này.