本文整理了Java中org.opendaylight.yangtools.yang.binding.YangModuleInfo.getRevision()
方法的一些代码示例,展示了YangModuleInfo.getRevision()
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。YangModuleInfo.getRevision()
方法的具体详情如下:
包路径:org.opendaylight.yangtools.yang.binding.YangModuleInfo
类名称:YangModuleInfo
方法名:getRevision
[英]Returns revision of yang module.
[中]返回模块的修订版本。
代码示例来源:origin: org.opendaylight.yangtools/yang-binding
/**
* Given a {@link YangModuleInfo}, create a QName representing it. The QName
* is formed by reusing the module's namespace and revision using the
* module's name as the QName's local name.
*
* @param moduleInfo
* module information
* @return QName representing the module
*/
public static QName getModuleQName(final YangModuleInfo moduleInfo) {
checkArgument(moduleInfo != null, "moduleInfo must not be null.");
return QName.create(moduleInfo.getNamespace(), moduleInfo.getRevision(), moduleInfo.getName());
}
代码示例来源:origin: org.opendaylight.yangtools/binding-generator-impl
private SourceIdentifier sourceIdentifierFrom(final YangModuleInfo moduleInfo) {
return SourceIdentifier.create(moduleInfo.getName(), Optional.of(moduleInfo.getRevision()));
}
代码示例来源:origin: org.opendaylight.yangtools/yang-binding
public static final QNameModule getQNameModule(final YangModuleInfo modInfo) {
return QNameModule.create(URI.create(modInfo.getNamespace()), QName.parseRevision(modInfo.getRevision()));
}
代码示例来源:origin: org.opendaylight.yangtools/binding-generator-impl
private static Optional<DataNodeContainer> findFirstDataNodeContainerInRpc(final SchemaContext ctx,
final Class<? extends DataObject> targetType) {
final YangModuleInfo moduleInfo;
try {
moduleInfo = BindingReflections.getModuleInfo(targetType);
} catch (Exception e) {
throw new IllegalArgumentException(
String.format("Failed to load module information for class %s", targetType), e);
}
for(RpcDefinition rpc : ctx.getOperations()) {
String rpcNamespace = rpc.getQName().getNamespace().toString();
String rpcRevision = rpc.getQName().getFormattedRevision();
if(moduleInfo.getNamespace().equals(rpcNamespace) && moduleInfo.getRevision().equals(rpcRevision)) {
Optional<DataNodeContainer> potential = findInputOutput(rpc,targetType.getSimpleName());
if(potential.isPresent()) {
return potential;
}
}
}
return Optional.absent();
}
代码示例来源:origin: org.opendaylight.yangtools/restconf-client-impl
public BindingToRestRpc(final Class<?> proxiedInterface,final BindingNormalizedNodeCodecRegistry mappingService2,final RestconfClientImpl client,final SchemaContext schemaContext) throws Exception {
this.mappingService = mappingService2;
this.client = client;
this.schcemaContext = schemaContext;
YangModuleInfo moduleInfo = BindingReflections.getModuleInfo(proxiedInterface);
this.module = schemaContext.findModuleByName(moduleInfo.getName(),org.opendaylight.yangtools.yang.common.QName.parseRevision(moduleInfo.getRevision()));
}
内容来源于网络,如有侵权,请联系作者删除!