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
.core
.runtime
.Status
;
16 import org
.eclipse
.linuxtools
.tmf
.core
.trace
.ITmfTrace
;
19 * TraceTypeHelper, a helper that can link a few names to a configuation element
22 * @author Matthew Khouzam
25 public class TraceTypeHelper
{
27 private final String fName
;
28 private final String fCategoryName
;
29 private final String fCanonicalName
;
30 private final ITmfTrace fTrace
;
33 * Constructor for a trace type helper. It is a link between a canonical
34 * (hard to read) name, a category name, a name and a trace object. It is
35 * used for trace validation.
37 * @param canonicalName
38 * The "path" of the tracetype
40 * the category of the trace type
42 * the name of the trace
44 * an object of the trace type
46 public TraceTypeHelper(String canonicalName
, String categoryName
, String name
, ITmfTrace trace
) {
48 fCategoryName
= categoryName
;
49 fCanonicalName
= canonicalName
;
58 public String
getName() {
63 * Get the category name
65 * @return the category name
67 public String
getCategoryName() {
72 * Get the canonical name
74 * @return the canonical Name
76 public String
getCanonicalName() {
77 return fCanonicalName
;
81 * Is the trace of this type?
84 * the trace to validate
85 * @return whether it passes the validation
87 public boolean validate(String path
) {
88 boolean valid
= false;
90 valid
= standardValidate(path
);
96 * Get an object of the trace type
97 * @return an object of the trace type
100 public ITmfTrace
getTrace() {
104 private boolean standardValidate(String path
) {
105 final boolean valid
= fTrace
.validate(null, path
).equals(Status
.OK_STATUS
);
110 * Get the class associated with this trace type
112 * @return The trace class
115 public Class
<?
extends ITmfTrace
> getTraceClass() {
116 return fTrace
.getClass();
120 public String
toString() {
This page took 0.033701 seconds and 5 git commands to generate.