Android samples comments BEGIN_INCLUDE END_INCLUDE -


while reading android samples see comments

// begin_include (something) // end_include (something) 

however, current ide — android studio 1.1 — can not recognise them (or maybe wrong). guess, serve kind of code region marks (like

//<editor-fold desc="region name">  // code //</editor-fold> 

in androidstudio/intellijidea), such syntax c++ preprocessor directives. question: should know important these comments (besides obvious commenting function) improve code in way?

it's documentation purposes, used identifying snippets include in target documentation. it's not useful when editing code; it's useful avoiding repetition generating documentation actual code.

{@sample} , {@include}

these tags copy sample text arbitrary file output javadoc html.

the @include tag copies text verbatim given file.

the @sample tag

  • copies text given file , strips leading , trailing whitespace
  • reduces indent level of text indent level of first non-whitespace line
  • escapes <, >; , & characters html
  • drops lines containing either begin_include or end_include sample code can nested

both tags accept either filename , id or filename. if no id provided, entire file copied. if id provided, lines in given file between first 2 lines containing begin_include(id) , end_include(id), given id, copied. id may letters, numbers , underscore ().

four examples:

{@include samples/samplecode/src/com/google/app/notification1.java} {@sample samples/samplecode/src/com/google/app/notification1.java} {@include samples/samplecode/src/com/google/app/notification1.java bleh} {@sample samples/samplecode/src/com/google/app/notification1.java bleh} 

https://code.google.com/p/doclava/wiki/javadoctags


Comments

Popular posts from this blog

node.js - Mongoose: Cast to ObjectId failed for value on newly created object after setting the value -

gradle error "Cannot convert the provided notation to a File or URI" -

python - NameError: name 'subprocess' is not defined -