當前位置: 首頁>>代碼示例>>Java>>正文


Java Diagnostician類代碼示例

本文整理匯總了Java中org.eclipse.emf.ecore.util.Diagnostician的典型用法代碼示例。如果您正苦於以下問題:Java Diagnostician類的具體用法?Java Diagnostician怎麽用?Java Diagnostician使用的例子?那麽, 這裏精選的類代碼示例或許可以為您提供幫助。


Diagnostician類屬於org.eclipse.emf.ecore.util包,在下文中一共展示了Diagnostician類的15個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。

示例1: validateValue

import org.eclipse.emf.ecore.util.Diagnostician; //導入依賴的package包/類
/**
 * {@inheritDoc}
 * 
 * @see org.eclipse.emf.eef.runtime.api.component.IPropertiesEditionComponent#validateValue(org.eclipse.emf.eef.runtime.api.notify.IPropertiesEditionEvent)
 * 
 */
public Diagnostic validateValue(IPropertiesEditionEvent event) {
	Diagnostic ret = Diagnostic.OK_INSTANCE;
	if (event.getNewValue() != null) {
		try {
			if (MetamodelViewsRepository.Poisson.Properties.interval == event.getAffectedEditor()) {
				Object newValue = event.getNewValue();
				if (newValue instanceof String) {
					newValue = EEFConverterUtil.createFromString(MetamodelPackage.eINSTANCE.getPoisson_Interval().getEAttributeType(), (String)newValue);
				}
				ret = Diagnostician.INSTANCE.validate(MetamodelPackage.eINSTANCE.getPoisson_Interval().getEAttributeType(), newValue);
			}
		} catch (IllegalArgumentException iae) {
			ret = BasicDiagnostic.toDiagnostic(iae);
		} catch (WrappedException we) {
			ret = BasicDiagnostic.toDiagnostic(we);
		}
	}
	return ret;
}
 
開發者ID:cetic,項目名稱:SimQRI,代碼行數:26,代碼來源:PoissonPropertiesEditionComponent.java

示例2: validateValue

import org.eclipse.emf.ecore.util.Diagnostician; //導入依賴的package包/類
/**
 * {@inheritDoc}
 * 
 * @see org.eclipse.emf.eef.runtime.api.component.IPropertiesEditionComponent#validateValue(org.eclipse.emf.eef.runtime.api.notify.IPropertiesEditionEvent)
 * 
 */
public Diagnostic validateValue(IPropertiesEditionEvent event) {
	Diagnostic ret = Diagnostic.OK_INSTANCE;
	if (event.getNewValue() != null) {
		try {
			if (MetamodelViewsRepository.Scalar.Properties.value == event.getAffectedEditor()) {
				Object newValue = event.getNewValue();
				if (newValue instanceof String) {
					newValue = EEFConverterUtil.createFromString(MetamodelPackage.eINSTANCE.getScalar_Value().getEAttributeType(), (String)newValue);
				}
				ret = Diagnostician.INSTANCE.validate(MetamodelPackage.eINSTANCE.getScalar_Value().getEAttributeType(), newValue);
			}
		} catch (IllegalArgumentException iae) {
			ret = BasicDiagnostic.toDiagnostic(iae);
		} catch (WrappedException we) {
			ret = BasicDiagnostic.toDiagnostic(we);
		}
	}
	return ret;
}
 
開發者ID:cetic,項目名稱:SimQRI,代碼行數:26,代碼來源:ScalarPropertiesEditionComponent.java

示例3: validateValue

import org.eclipse.emf.ecore.util.Diagnostician; //導入依賴的package包/類
/**
 * {@inheritDoc}
 * 
 * @see org.eclipse.emf.eef.runtime.api.component.IPropertiesEditionComponent#validateValue(org.eclipse.emf.eef.runtime.api.notify.IPropertiesEditionEvent)
 * 
 */
public Diagnostic validateValue(IPropertiesEditionEvent event) {
	Diagnostic ret = Diagnostic.OK_INSTANCE;
	if (event.getNewValue() != null) {
		try {
			if (MetamodelViewsRepository.Model.Properties.name == event.getAffectedEditor()) {
				Object newValue = event.getNewValue();
				if (newValue instanceof String) {
					newValue = EEFConverterUtil.createFromString(MetamodelPackage.eINSTANCE.getModel_Name().getEAttributeType(), (String)newValue);
				}
				ret = Diagnostician.INSTANCE.validate(MetamodelPackage.eINSTANCE.getModel_Name().getEAttributeType(), newValue);
			}
		} catch (IllegalArgumentException iae) {
			ret = BasicDiagnostic.toDiagnostic(iae);
		} catch (WrappedException we) {
			ret = BasicDiagnostic.toDiagnostic(we);
		}
	}
	return ret;
}
 
開發者ID:cetic,項目名稱:SimQRI,代碼行數:26,代碼來源:ModelPropertiesEditionComponent.java

示例4: validateDevice

import org.eclipse.emf.ecore.util.Diagnostician; //導入依賴的package包/類
/**
 * Validates a object instance and its children using the EMF core validator
 * API.
 *
 * @param element
 *            the element to validate
 * @param label
 *            the type label of the element
 * @throws IllegalStateException
 *             if validation errors are encountered
 */
protected static void validateDevice ( final EObject object, final String label )
{
    final Diagnostic diag = Diagnostician.INSTANCE.validate ( object );
    if ( diag.getSeverity () == Diagnostic.ERROR )
    {
        final StringBuilder sb = new StringBuilder ( "Invalid " + label );
        for ( final Diagnostic child : diag.getChildren () )
        {
            if ( child.getSeverity () == Diagnostic.ERROR )
            {
                sb.append ( System.lineSeparator () );
                sb.append ( child.getMessage () );
            }
        }
        throw new IllegalStateException ( sb.toString () );
    }
}
 
開發者ID:eclipse,項目名稱:neoscada,代碼行數:29,代碼來源:ExporterProcessor.java

示例5: validateDevice

import org.eclipse.emf.ecore.util.Diagnostician; //導入依賴的package包/類
/**
 * Validates a ModbusExporterDevice instance using the EMF core validator
 * API. The
 * contained ModbusExporterItems are also validated.
 * 
 * @param device
 *            the ModbusExporterDevice to validate
 * @throws IllegalStateException
 *             if validation errors are encountered
 */
private void validateDevice ( final ModbusExporterDevice device )
{
    // Also validates contained ModbusExporterItems
    final Diagnostic diag = Diagnostician.INSTANCE.validate ( device );
    if ( diag.getSeverity () == Diagnostic.ERROR )
    {
        String msg = "Invalid Modbus Exporter Device";
        for ( final Diagnostic child : diag.getChildren () )
        {
            if ( child.getSeverity () == Diagnostic.ERROR )
            {
                msg += "\n" + child.getMessage (); //$NON-NLS-1$
            }
        }
        throw new IllegalStateException ( msg );
    }
}
 
開發者ID:eclipse,項目名稱:neoscada,代碼行數:28,代碼來源:ModbusExporterProcessor.java

示例6: validateValue

import org.eclipse.emf.ecore.util.Diagnostician; //導入依賴的package包/類
/**
 * {@inheritDoc}
 * 
 * @see org.eclipse.emf.eef.runtime.api.component.IPropertiesEditionComponent#validateValue(org.eclipse.emf.eef.runtime.api.notify.IPropertiesEditionEvent)
 * 
 */
public Diagnostic validateValue(IPropertiesEditionEvent event) {
	Diagnostic ret = Diagnostic.OK_INSTANCE;
	if (event.getNewValue() != null) {
		try {
			if (GrmViewsRepository.General.Properties.name == event.getAffectedEditor()) {
				Object newValue = event.getNewValue();
				if (newValue instanceof String) {
					newValue = EEFConverterUtil.createFromString(GrmPackage.eINSTANCE.getNamedElement_Name().getEAttributeType(), (String)newValue);
				}
				ret = Diagnostician.INSTANCE.validate(GrmPackage.eINSTANCE.getNamedElement_Name().getEAttributeType(), newValue);
			}
		} catch (IllegalArgumentException iae) {
			ret = BasicDiagnostic.toDiagnostic(iae);
		} catch (WrappedException we) {
			ret = BasicDiagnostic.toDiagnostic(we);
		}
	}
	return ret;
}
 
開發者ID:polarsys,項目名稱:time4sys,代碼行數:26,代碼來源:ResourceServicePropertiesEditionComponent.java

示例7: validateValue

import org.eclipse.emf.ecore.util.Diagnostician; //導入依賴的package包/類
/**
 * {@inheritDoc}
 * 
 * @see org.eclipse.emf.eef.runtime.api.component.IPropertiesEditionComponent#validateValue(org.eclipse.emf.eef.runtime.api.notify.IPropertiesEditionEvent)
 * 
 */
public Diagnostic validateValue(IPropertiesEditionEvent event) {
	Diagnostic ret = Diagnostic.OK_INSTANCE;
	if (event.getNewValue() != null) {
		try {
			if (GrmViewsRepository.Timing.TimingProperties.execTime == event.getAffectedEditor()) {
				Object newValue = event.getNewValue();
				if (newValue instanceof String) {
					newValue = EEFConverterUtil.createFromString(GrmPackage.eINSTANCE.getUsageTypedAmount_ExecTime().getEAttributeType(), (String)newValue);
				}
				ret = Diagnostician.INSTANCE.validate(GrmPackage.eINSTANCE.getUsageTypedAmount_ExecTime().getEAttributeType(), newValue);
			}
		} catch (IllegalArgumentException iae) {
			ret = BasicDiagnostic.toDiagnostic(iae);
		} catch (WrappedException we) {
			ret = BasicDiagnostic.toDiagnostic(we);
		}
	}
	return ret;
}
 
開發者ID:polarsys,項目名稱:time4sys,代碼行數:26,代碼來源:UsageTypedAmountTimingPropertiesEditionComponent.java

示例8: validateValue

import org.eclipse.emf.ecore.util.Diagnostician; //導入依賴的package包/類
/**
 * {@inheritDoc}
 * 
 * @see org.eclipse.emf.eef.runtime.api.component.IPropertiesEditionComponent#validateValue(org.eclipse.emf.eef.runtime.api.notify.IPropertiesEditionEvent)
 * 
 */
public Diagnostic validateValue(IPropertiesEditionEvent event) {
	Diagnostic ret = Diagnostic.OK_INSTANCE;
	if (event.getNewValue() != null) {
		try {
			if (GrmViewsRepository.General.Properties.event == event.getAffectedEditor()) {
				Object newValue = event.getNewValue();
				if (newValue instanceof String) {
					newValue = EEFConverterUtil.createFromString(GrmPackage.eINSTANCE.getUsageDemand_Event().getEAttributeType(), (String)newValue);
				}
				ret = Diagnostician.INSTANCE.validate(GrmPackage.eINSTANCE.getUsageDemand_Event().getEAttributeType(), newValue);
			}
		} catch (IllegalArgumentException iae) {
			ret = BasicDiagnostic.toDiagnostic(iae);
		} catch (WrappedException we) {
			ret = BasicDiagnostic.toDiagnostic(we);
		}
	}
	return ret;
}
 
開發者ID:polarsys,項目名稱:time4sys,代碼行數:26,代碼來源:UsageDemandPropertiesEditionComponent.java

示例9: validateValue

import org.eclipse.emf.ecore.util.Diagnostician; //導入依賴的package包/類
/**
 * {@inheritDoc}
 * 
 * @see org.eclipse.emf.eef.runtime.api.component.IPropertiesEditionComponent#validateValue(org.eclipse.emf.eef.runtime.api.notify.IPropertiesEditionEvent)
 * 
 */
public Diagnostic validateValue(IPropertiesEditionEvent event) {
	Diagnostic ret = Diagnostic.OK_INSTANCE;
	if (event.getNewValue() != null) {
		try {
			if (GrmViewsRepository.Timing.TimingProperties.duration == event.getAffectedEditor()) {
				Object newValue = event.getNewValue();
				if (newValue instanceof String) {
					newValue = EEFConverterUtil.createFromString(GrmPackage.eINSTANCE.getTimerResource_Duration().getEAttributeType(), (String)newValue);
				}
				ret = Diagnostician.INSTANCE.validate(GrmPackage.eINSTANCE.getTimerResource_Duration().getEAttributeType(), newValue);
			}
		} catch (IllegalArgumentException iae) {
			ret = BasicDiagnostic.toDiagnostic(iae);
		} catch (WrappedException we) {
			ret = BasicDiagnostic.toDiagnostic(we);
		}
	}
	return ret;
}
 
開發者ID:polarsys,項目名稱:time4sys,代碼行數:26,代碼來源:TimerResourceTimingPropertiesEditionComponent.java

示例10: validateValue

import org.eclipse.emf.ecore.util.Diagnostician; //導入依賴的package包/類
/**
 * {@inheritDoc}
 * 
 * @see org.eclipse.emf.eef.runtime.api.component.IPropertiesEditionComponent#validateValue(org.eclipse.emf.eef.runtime.api.notify.IPropertiesEditionEvent)
 * 
 */
public Diagnostic validateValue(IPropertiesEditionEvent event) {
	Diagnostic ret = Diagnostic.OK_INSTANCE;
	if (event.getNewValue() != null) {
		try {
			if (GqamViewsRepository.General.Properties.referenceName == event.getAffectedEditor()) {
				Object newValue = event.getNewValue();
				if (newValue instanceof String) {
					newValue = EEFConverterUtil.createFromString(GqamPackage.eINSTANCE.getReference_ReferenceName().getEAttributeType(), (String)newValue);
				}
				ret = Diagnostician.INSTANCE.validate(GqamPackage.eINSTANCE.getReference_ReferenceName().getEAttributeType(), newValue);
			}
		} catch (IllegalArgumentException iae) {
			ret = BasicDiagnostic.toDiagnostic(iae);
		} catch (WrappedException we) {
			ret = BasicDiagnostic.toDiagnostic(we);
		}
	}
	return ret;
}
 
開發者ID:polarsys,項目名稱:time4sys,代碼行數:26,代碼來源:ReferencePropertiesEditionComponent.java

示例11: validateValue

import org.eclipse.emf.ecore.util.Diagnostician; //導入依賴的package包/類
/**
 * {@inheritDoc}
 * 
 * @see org.eclipse.emf.eef.runtime.api.component.IPropertiesEditionComponent#validateValue(org.eclipse.emf.eef.runtime.api.notify.IPropertiesEditionEvent)
 * 
 */
public Diagnostic validateValue(IPropertiesEditionEvent event) {
	Diagnostic ret = Diagnostic.OK_INSTANCE;
	if (event.getNewValue() != null) {
		try {
			if (GqamViewsRepository.General.Properties.name == event.getAffectedEditor()) {
				Object newValue = event.getNewValue();
				if (newValue instanceof String) {
					newValue = EEFConverterUtil.createFromString(GrmPackage.eINSTANCE.getNamedElement_Name().getEAttributeType(), (String)newValue);
				}
				ret = Diagnostician.INSTANCE.validate(GrmPackage.eINSTANCE.getNamedElement_Name().getEAttributeType(), newValue);
			}
		} catch (IllegalArgumentException iae) {
			ret = BasicDiagnostic.toDiagnostic(iae);
		} catch (WrappedException we) {
			ret = BasicDiagnostic.toDiagnostic(we);
		}
	}
	return ret;
}
 
開發者ID:polarsys,項目名稱:time4sys,代碼行數:26,代碼來源:WorkloadEventPropertiesEditionComponent.java

示例12: validateValue

import org.eclipse.emf.ecore.util.Diagnostician; //導入依賴的package包/類
/**
 * {@inheritDoc}
 * 
 * @see org.eclipse.emf.eef.runtime.api.component.IPropertiesEditionComponent#validateValue(org.eclipse.emf.eef.runtime.api.notify.IPropertiesEditionEvent)
 * 
 */
public Diagnostic validateValue(IPropertiesEditionEvent event) {
	Diagnostic ret = Diagnostic.OK_INSTANCE;
	if (event.getNewValue() != null) {
		try {
			if (GqamViewsRepository.General.Properties.occurences == event.getAffectedEditor()) {
				Object newValue = event.getNewValue();
				if (newValue instanceof String) {
					newValue = EEFConverterUtil.createFromString(GqamPackage.eINSTANCE.getPeriodicPattern_Occurences().getEAttributeType(), (String)newValue);
				}
				ret = Diagnostician.INSTANCE.validate(GqamPackage.eINSTANCE.getPeriodicPattern_Occurences().getEAttributeType(), newValue);
			}
		} catch (IllegalArgumentException iae) {
			ret = BasicDiagnostic.toDiagnostic(iae);
		} catch (WrappedException we) {
			ret = BasicDiagnostic.toDiagnostic(we);
		}
	}
	return ret;
}
 
開發者ID:polarsys,項目名稱:time4sys,代碼行數:26,代碼來源:PeriodicPatternGeneralPropertiesEditionComponent.java

示例13: validateValue

import org.eclipse.emf.ecore.util.Diagnostician; //導入依賴的package包/類
/**
 * {@inheritDoc}
 * 
 * @see org.eclipse.emf.eef.runtime.api.component.IPropertiesEditionComponent#validateValue(org.eclipse.emf.eef.runtime.api.notify.IPropertiesEditionEvent)
 * 
 */
public Diagnostic validateValue(IPropertiesEditionEvent event) {
	Diagnostic ret = Diagnostic.OK_INSTANCE;
	if (event.getNewValue() != null) {
		try {
			if (GqamViewsRepository.General.Properties.connectorKind == event.getAffectedEditor()) {
				Object newValue = event.getNewValue();
				if (newValue instanceof String) {
					newValue = EEFConverterUtil.createFromString(GqamPackage.eINSTANCE.getPrecedenceRelation_ConnectorKind().getEAttributeType(), (String)newValue);
				}
				ret = Diagnostician.INSTANCE.validate(GqamPackage.eINSTANCE.getPrecedenceRelation_ConnectorKind().getEAttributeType(), newValue);
			}
		} catch (IllegalArgumentException iae) {
			ret = BasicDiagnostic.toDiagnostic(iae);
		} catch (WrappedException we) {
			ret = BasicDiagnostic.toDiagnostic(we);
		}
	}
	return ret;
}
 
開發者ID:polarsys,項目名稱:time4sys,代碼行數:26,代碼來源:PrecedenceRelationPropertiesEditionComponent.java

示例14: validateValue

import org.eclipse.emf.ecore.util.Diagnostician; //導入依賴的package包/類
/**
 * {@inheritDoc}
 * 
 * @see org.eclipse.emf.eef.runtime.api.component.IPropertiesEditionComponent#validateValue(org.eclipse.emf.eef.runtime.api.notify.IPropertiesEditionEvent)
 * @generated
 */
public Diagnostic validateValue(IPropertiesEditionEvent event) {
	Diagnostic ret = Diagnostic.OK_INSTANCE;
	if (event.getNewValue() != null) {
		try {
			if (AnalysisViewsRepository.InputPort.Properties.name == event.getAffectedEditor()) {
				Object newValue = event.getNewValue();
				if (newValue instanceof String) {
					newValue = EEFConverterUtil.createFromString(AnalysisPackage.eINSTANCE.getNamedElement_Name().getEAttributeType(), (String)newValue);
				}
				ret = Diagnostician.INSTANCE.validate(AnalysisPackage.eINSTANCE.getNamedElement_Name().getEAttributeType(), newValue);
			}
		} catch (IllegalArgumentException iae) {
			ret = BasicDiagnostic.toDiagnostic(iae);
		} catch (WrappedException we) {
			ret = BasicDiagnostic.toDiagnostic(we);
		}
	}
	return ret;
}
 
開發者ID:polarsys,項目名稱:time4sys,代碼行數:26,代碼來源:InputPortPropertiesEditionComponent.java

示例15: validateValue

import org.eclipse.emf.ecore.util.Diagnostician; //導入依賴的package包/類
/**
 * {@inheritDoc}
 * 
 * @see org.eclipse.emf.eef.runtime.api.component.IPropertiesEditionComponent#validateValue(org.eclipse.emf.eef.runtime.api.notify.IPropertiesEditionEvent)
 * @generated
 */
public Diagnostic validateValue(IPropertiesEditionEvent event) {
	Diagnostic ret = Diagnostic.OK_INSTANCE;
	if (event.getNewValue() != null) {
		try {
			if (AnalysisViewsRepository.OutputStimulus.Properties.name == event.getAffectedEditor()) {
				Object newValue = event.getNewValue();
				if (newValue instanceof String) {
					newValue = EEFConverterUtil.createFromString(AnalysisPackage.eINSTANCE.getNamedElement_Name().getEAttributeType(), (String)newValue);
				}
				ret = Diagnostician.INSTANCE.validate(AnalysisPackage.eINSTANCE.getNamedElement_Name().getEAttributeType(), newValue);
			}
		} catch (IllegalArgumentException iae) {
			ret = BasicDiagnostic.toDiagnostic(iae);
		} catch (WrappedException we) {
			ret = BasicDiagnostic.toDiagnostic(we);
		}
	}
	return ret;
}
 
開發者ID:polarsys,項目名稱:time4sys,代碼行數:26,代碼來源:OutputStimulusPropertiesEditionComponent.java


注:本文中的org.eclipse.emf.ecore.util.Diagnostician類示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。