本文整理汇总了Java中org.netbeans.modules.xml.xam.ModelSource.getLookup方法的典型用法代码示例。如果您正苦于以下问题:Java ModelSource.getLookup方法的具体用法?Java ModelSource.getLookup怎么用?Java ModelSource.getLookup使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类org.netbeans.modules.xml.xam.ModelSource
的用法示例。
在下文中一共展示了ModelSource.getLookup方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: validate
import org.netbeans.modules.xml.xam.ModelSource; //导入方法依赖的package包/类
private void validate(URI uri, int expectedErrorCount)
throws Exception {
Validation v = new Validation();
ModelSource ms = TestCatalogModel.getDefault().getModelSource(uri);
MyModelSource source = new MyModelSource(ms.getLookup(), ms.isEditable(), uri);
WSDLModel model = WSDLModelFactory.getDefault().getModel(source);
WSDLSchemaValidator instance = new WSDLSchemaValidator();
ValidationResult vr = instance.validate(model, v, Validation.ValidationType.COMPLETE);
assertNotNull(vr.getValidationResult());
ValidationHelper.dumpErrors(vr);
assertTrue("expect error " + expectedErrorCount, vr.getValidationResult().size() == expectedErrorCount);
}
示例2: toString
import org.netbeans.modules.xml.xam.ModelSource; //导入方法依赖的package包/类
@Override
public String toString() {
ModelSource source = getModelSource();
if (source != null) {
Lookup lookup = source.getLookup();
if (lookup != null) {
FileObject fileObject = lookup.lookup(FileObject.class);
if (fileObject != null) {
return fileObject.getNameExt();
}
}
}
return super.toString();
}
示例3: getModel
import org.netbeans.modules.xml.xam.ModelSource; //导入方法依赖的package包/类
/**
* Gets domain model from given model source. Model source should
* provide lookup for:
* 1. FileObject of the model source
* 2. DataObject represent the model
* 3. Swing Document buffer for in-memory text of the model source
*/
@Override
public POMModel getModel(ModelSource source) {
if (source == null) return null;
Lookup lookup = source.getLookup();
if (lookup.lookup(Document.class) == null) {
Logger.getLogger(POMModelFactory.class.getName()).log(Level.WARNING, "no Document instance found in {0}", lookup);
}
return super.getModel(source);
}