In this book, you will find a number of styles of text that distinguish between different kinds of information. Here are some examples of these styles, and an explanation of their meaning.
Code words in text, database table names, folder names, filenames, file extensions, pathnames, dummy URLs, user input, and Twitter handles are shown as follows: "We placed ProjectWebSocketServerEndpoint
and ProjectRESTServerEndpoint
in the control subpackage, because these POJOs are manipulating the entities on behalf of the client side."
A block of code is set as follows:
package je7hb.intro.xentracker.entity; import org.hibernate.validator.constraints.NotEmpty; import javax.persistence.*; import javax.validation.constraints.Size; import java.util.*; @Entity public class Project { @Id @GeneratedValue(strategy = GenerationType.AUTO) @Column(name = "PROJECT_ID") private Integer id; @NotEmpty @Size(max = 64) private String name; @OneToMany(cascade = CascadeType.ALL, mappedBy = "project", fetch = FetchType.EAGER) private List<Task> tasks = new ArrayList<>(); public Project() {/* Required for JPA */} public Project(String name) {this.name = name;} public Integer getId() {return id;} public void setId(Integer id) {this.id = id;} public String getName() {return name;} public void setName(String name) {this.name = name;} public List<Task> getTasks() {return tasks;} public void setTasks(List<Task> tasks) {this.tasks = tasks;} public boolean addTask(Task task) { if (!tasks.contains(task)) { Project oldProject = task.getProject(); if (oldProject != null) { removeTask(task); } tasks.add(task); return true; } else {return false;} } public boolean removeTask(Task task) { if (tasks.contains(task)) { tasks.remove(task); task.setProject(null); return true; } else {return false;} } // hashCode(), equals(), toString() omitted }
When we wish to draw your attention to a particular part of a code block, the relevant lines or items are set in bold:
package je7hb.basic.arquillian; import javax.decorator.Decorator; import javax.decorator.Delegate; import javax.inject.Inject; @Decorator @Premium public class CreditProcessorDecorator implements CreditProcessor { @Inject SanctionService sanctionService; @Inject @Delegate @Premium CreditProcessor processor; @Override public void check(String account) { sanctionService.sanction(account, "EURGBP"); processor.check(account); } }
Any command-line input or output is written as follows:
gradle clean gradle eclipse gradle idea Gradle run gradle build gradle build
New terms and important words are shown in bold. Words that you see on the screen, in menus or dialog boxes for example, appear in the text like this: "Ramping up on Java concurrency".
3.140.188.244