1 /*******************************************************************************
2 * Copyright (c) 2013 Ericsson
4 * All rights reserved. This program and the accompanying materials are
5 * made available under the terms of the Eclipse Public License v1.0 which
6 * accompanies this distribution, and is available at
7 * http://www.eclipse.org/legal/epl-v10.html
10 * Matthew Khouzam - Initial API and implementation
11 *******************************************************************************/
13 package org
.eclipse
.linuxtools
.tmf
.core
.project
.model
;
15 import org
.eclipse
.linuxtools
.tmf
.core
.trace
.ITmfTrace
;
18 * TraceTypeHelper, a helper that can link a few names to a configuation element
21 * @author Matthew Khouzam
24 public class TraceTypeHelper
{
26 private final String fName
;
27 private final String fCategoryName
;
28 private final String fCanonicalName
;
29 private final ITmfTrace fTrace
;
32 * Constructor for a trace type helper. It is a link between a canonical
33 * (hard to read) name, a category name, a name and a trace object. It is
34 * used for trace validation.
36 * @param canonicalName
37 * The "path" of the tracetype
39 * the category of the trace type
41 * the name of the trace
43 * an object of the trace type
45 public TraceTypeHelper(String canonicalName
, String categoryName
, String name
, ITmfTrace trace
) {
47 fCategoryName
= categoryName
;
48 fCanonicalName
= canonicalName
;
57 public String
getName() {
62 * Get the category name
64 * @return the category name
66 public String
getCategoryName() {
71 * Get the canonical name
73 * @return the canonical Name
75 public String
getCanonicalName() {
76 return fCanonicalName
;
80 * Is the trace of this type?
83 * the trace to validate
84 * @return whether it passes the validation
86 public boolean validate(String path
) {
87 boolean valid
= false;
89 valid
= standardValidate(path
);
95 * Get an object of the trace type
96 * @return an object of the trace type
99 public ITmfTrace
getTrace() {
103 private boolean standardValidate(String path
) {
104 final boolean valid
= fTrace
.validate(null, path
).isOK();
109 * Get the class associated with this trace type
111 * @return The trace class
114 public Class
<?
extends ITmfTrace
> getTraceClass() {
115 return fTrace
.getClass();
119 public String
toString() {
This page took 0.034359 seconds and 5 git commands to generate.