- 使用 Spring Initializr 创建 Spring Boot 应用程序
- 在Spring Boot中配置Cassandra
- 在 Spring Boot 上配置 Tomcat 连接池
- 将Camel消息路由到嵌入WildFly的Artemis上
本文整理了Java中org.onosproject.yangutils.datamodel.YangType.getDataType()
方法的一些代码示例,展示了YangType.getDataType()
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。YangType.getDataType()
方法的具体详情如下:
包路径:org.onosproject.yangutils.datamodel.YangType
类名称:YangType
方法名:getDataType
[英]Returns the type of data.
[中]返回数据的类型。
代码示例来源:origin: org.onosproject/onos-yang-utils-parser
/**
* Sets the default require instance value as true when the type is instance identifier.
*
* @param type type to which the value has to be set
*/
private static void setDefaultRequireInstanceForInstanceIdentifier(YangType<?> type) {
if (type.getDataType() == YangDataTypes.INSTANCE_IDENTIFIER) {
((YangType<Boolean>) type).setDataTypeExtendedInfo(true);
}
}
代码示例来源:origin: org.onosproject/onos-yang-datamodel
switch (dataType.getDataType()) {
case DERIVED:
return ((YangDerivedInfo) dataType.getDataTypeExtendedInfo())
.getDataTypeExtendedInfo())
.getEffectiveDataType();
if (type.getDataType() == YangDataTypes.DERIVED) {
return ((YangDerivedInfo) type.getDataTypeExtendedInfo())
.getEffectiveBuiltInType().equals(EMPTY);
.getEffectiveDataType().getDataType().equals(EMPTY);
.getTypeList().contains(EMPTY);
default:
return dataType.getDataType().equals(EMPTY);
代码示例来源:origin: org.onosproject/onos-yang-datamodel
while (potentialTypeNode != null) {
String dataTypeName = null;
if (dataType.getDataType() == YangDataTypes.ENUMERATION) {
YangEnumeration enumNode = (YangEnumeration) dataType.getDataTypeExtendedInfo();
dataTypeName = enumNode.getName();
} else if (dataType.getDataType() == YangDataTypes.UNION) {
YangUnion unionNode = (YangUnion) dataType.getDataTypeExtendedInfo();
dataTypeName = unionNode.getName();
代码示例来源:origin: org.onosproject/onos-yang-datamodel
if (currentListOfLeaves != null) {
for (YangLeaf leaf : currentListOfLeaves) {
if (leaf.getDataType().getDataType() == YangDataTypes.ENUMERATION
|| leaf.getDataType().getDataType() == YangDataTypes.UNION) {
try {
YangType<?> clonedType = leaf.getDataType().clone();
if (currentListOfLeafList != null) {
for (YangLeafList leafList : currentListOfLeafList) {
if (leafList.getDataType().getDataType() == YangDataTypes.ENUMERATION
|| leafList.getDataType().getDataType() == YangDataTypes.UNION) {
try {
YangType<?> clonedType = leafList.getDataType().clone();
代码示例来源:origin: org.onosproject/onos-yang-datamodel
/**
* Returns resolvable entity under union. When types under union have
* identity-ref, derived and union, the function call is done recursively
* to get resolvable entity and adds it to list.
*
* @param type union YANG type
* @param isLeaf leaf or leaf-list
* @return resolvable entity list after setting info
* @throws DataModelException data model error
*/
private static List<YangEntityToResolveInfoImpl> getUnionResolvableEntity(
YangType type, boolean isLeaf) throws DataModelException {
YangUnion union = (YangUnion) type.getDataTypeExtendedInfo();
List<YangType<?>> typeList = union.getTypeList();
List<YangEntityToResolveInfoImpl> unionList = new ArrayList<>();
List<YangEntityToResolveInfoImpl> entity;
for (YangType unionType : typeList) {
entity = getUnresolvedTypeList(unionType.getDataType(),
unionType, union, null, isLeaf);
if (nonEmpty(entity)) {
unionList.addAll(entity);
}
}
return unionList;
}
代码示例来源:origin: org.onosproject/onos-yang-datamodel
/**
* Returns types that has to be resolved for a single leaf/leaf-list.
* Identifies the object to be leaf/leaf-list and assigns respective
* parameters to resolve the types under leaf/leaf-list.
*
* @param clonedObj leaf/leaf-list object
* @param holderNode holder node
* @param yangUses YANG uses
* @return list of resolvable entities in a leaf/leaf-list
* @throws DataModelException data model error
*/
private static List<YangEntityToResolveInfoImpl> getTypesToBeResolved(
Object clonedObj, YangNode holderNode,
YangUses yangUses) throws DataModelException {
YangType type;
if (clonedObj instanceof YangLeaf) {
YangLeaf clonedLeaf = (YangLeaf) clonedObj;
type = clonedLeaf.getDataType();
return getUnresolvedTypeList(type.getDataType(), type, holderNode,
yangUses, true);
}
YangLeafList clonedLeafList = (YangLeafList) clonedObj;
type = clonedLeafList.getDataType();
return getUnresolvedTypeList(type.getDataType(), type, holderNode,
yangUses, false);
}
代码示例来源:origin: org.onosproject/onos-yang-datamodel
switch (getDataType()) {
case INT8:
case INT16:
case UINT64: {
if (getDataTypeExtendedInfo() == null) {
getDataObjectFromString(value, getDataType());
} else {
if (!((YangRangeRestriction) getDataTypeExtendedInfo()).isValidValueString(value)) {
throw new DataTypeException("YANG file error : Input value \"" + value + "\" is not a valid " +
getDataType());
.isValidStringOnPatternRestriction(value))) {
throw new DataTypeException("YANG file error : Input value \"" + value + "\" is not a valid " +
getDataType());
if (!(value.equals(DataModelUtils.TRUE) || value.equals(DataModelUtils.FALSE))) {
throw new DataTypeException("YANG file error : Input value \"" + value + "\" is not a valid " +
getDataType());
getDataType());
if (bits.fromString(value) == null) {
throw new DataTypeException("YANG file error : Input value \"" + value + "\" is not a valid " +
getDataType());
if (!isValidBinary(value, (YangRangeRestriction) getDataTypeExtendedInfo())) {
throw new DataTypeException("YANG file error : Input value \"" + value + "\" is not a valid " +
getDataType());
代码示例来源:origin: org.onosproject/onos-yang-datamodel
/**
* Adds YANG type to type list.
*
* @param yangType YANG type to be added to list
* @throws DataModelException union member type must not be one of the
* built-in types "empty" or "leafref"
*/
public void addType(YangType<?> yangType)
throws DataModelException {
YangDataTypes type = yangType.getDataType();
String msg = "Union member type must not be one of the built-in types" +
" \"empty\" or \"leafref\"";
switch (type) {
case EMPTY:
case LEAFREF:
throw new DataModelException(getErrorMsg(
msg, getName(), getLineNumber(), getCharPosition(),
getFileName()));
default:
typeList.add(yangType);
}
}
代码示例来源:origin: org.onosproject/onos-yang-utils-parser
GeneratedYangParser.RangeStatementContext ctx) {
if (type.getDataType() == DERIVED) {
((YangDerivedInfo<YangRangeRestriction>) type.getDataTypeExtendedInfo())
.setRangeRestrictionString(ctx.range().getText());
if (!(isOfRangeRestrictedType(type.getDataType())) && (type.getDataType() != DECIMAL64)) {
ParserException parserException = new ParserException("YANG file error: Range restriction can't be " +
"applied to a given type");
if (type.getDataType() == DECIMAL64) {
YangDecimal64 yangDecimal64 = (YangDecimal64) type.getDataTypeExtendedInfo();
rangeRestriction =
ctx.getStart().getCharPositionInLine(),
true, ctx.range().getText(),
type.getDataType(), listener.getFileName());
} else {
rangeRestriction =
false, ctx.range()
.getText(), type
.getDataType(),
listener.getFileName());
if (type.getDataType() == DECIMAL64) {
((YangDecimal64<YangRangeRestriction>) type.getDataTypeExtendedInfo())
.setRangeRestrictedExtendedInfo(rangeRestriction);
代码示例来源:origin: org.onosproject/onos-yang-utils-parser
/**
* Performs validation and updates the data model tree.
* It is called when parser exits from grammar rule (range).
*
* @param listener listener's object
* @param ctx context object of the grammar rule
*/
public static void processRangeRestrictionExit(TreeWalkListener listener,
GeneratedYangParser.RangeStatementContext ctx) {
// Check for stack to be non empty.
checkStackIsNotEmpty(listener, MISSING_HOLDER, RANGE_DATA, ctx.range().getText(), EXIT);
Parsable tmpData = listener.getParsedDataStack().peek();
if (tmpData instanceof YangRangeRestriction) {
listener.getParsedDataStack().pop();
} else if (tmpData instanceof YangType
&& ((YangType) tmpData).getDataType() == DERIVED) {
// TODO : need to handle in linker
} else {
throw new ParserException(constructListenerErrorMessage(MISSING_CURRENT_HOLDER, RANGE_DATA,
ctx.range().getText(), EXIT));
}
}
}
代码示例来源:origin: org.onosproject/onos-yang-utils-parser
GeneratedYangParser.PatternStatementContext ctx) {
if (type.getDataType() != YangDataTypes.STRING && type.getDataType() != YangDataTypes.DERIVED) {
if (type.getDataType() == YangDataTypes.STRING) {
YangStringRestriction stringRestriction = (YangStringRestriction) type.getDataTypeExtendedInfo();
if (stringRestriction == null) {
代码示例来源:origin: org.onosproject/onos-yang-utils-parser
/**
* Performs validation and updates the data model tree.
* It is called when parser exits from grammar rule (length).
*
* @param listener listener's object
* @param ctx context object of the grammar rule
*/
public static void processLengthRestrictionExit(TreeWalkListener listener,
GeneratedYangParser.LengthStatementContext ctx) {
// Check for stack to be non empty.
checkStackIsNotEmpty(listener, MISSING_HOLDER, LENGTH_DATA, ctx.length().getText(), EXIT);
Parsable tmpData = listener.getParsedDataStack().peek();
if (tmpData instanceof YangRangeRestriction) {
listener.getParsedDataStack().pop();
} else if (tmpData instanceof YangType
&& ((YangType) tmpData).getDataType() == DERIVED) {
// TODO : need to handle in linker
} else {
throw new ParserException(constructListenerErrorMessage(MISSING_CURRENT_HOLDER, LENGTH_DATA,
ctx.length().getText(), EXIT));
}
}
}
代码示例来源:origin: org.onosproject/onos-yang-datamodel
@Override
public Object resolve()
throws DataModelException {
/*
* Check whether the data type is derived.
*/
if (getDataType() != DERIVED) {
throw new DataModelException("Linker Error: Resolve should only be called for derived data types. "
+ " in " +
getLineNumber() + " at " +
getCharPosition()
+ " in " + getFileName() + "\"");
}
// Check if the derived info is present.
YangDerivedInfo<?> derivedInfo = (YangDerivedInfo<?>) getDataTypeExtendedInfo();
if (derivedInfo == null) {
throw new DataModelException("Linker Error: Derived information is missing. " + " in " +
getLineNumber() + " at " +
getCharPosition()
+ " in " + getFileName() + "\"");
}
// Initiate the resolution
try {
setResolvableStatus(derivedInfo.resolve());
} catch (DataModelException e) {
throw new DataModelException(e.getMessage());
}
return null;
}
代码示例来源:origin: org.onosproject/onos-yang-utils-parser
/**
* Performs validation and updates the data model tree.
* It is called when parser exits from grammar rule (pattern).
*
* @param listener listener's object
* @param ctx context object of the grammar rule
*/
public static void processPatternRestrictionExit(TreeWalkListener listener,
GeneratedYangParser.PatternStatementContext ctx) {
// Check for stack to be non empty.
checkStackIsNotEmpty(listener, MISSING_HOLDER, PATTERN_DATA, ctx.string().getText(), EXIT);
Parsable tmpData = listener.getParsedDataStack().peek();
if (tmpData instanceof YangStringRestriction) {
listener.getParsedDataStack().pop();
} else if (tmpData instanceof YangType
&& ((YangType) tmpData).getDataType() == DERIVED) {
// TODO : need to handle in linker
} else {
throw new ParserException(constructListenerErrorMessage(MISSING_CURRENT_HOLDER, PATTERN_DATA,
ctx.string().getText(), EXIT));
}
}
代码示例来源:origin: org.onosproject/onos-yang-utils-parser
GeneratedYangParser.LengthStatementContext ctx) {
if (type.getDataType() == DERIVED) {
((YangDerivedInfo<YangRangeRestriction>) type.getDataTypeExtendedInfo())
.setLengthRestrictionString(ctx.length().getText());
if (type.getDataType() != STRING && type.getDataType() != BINARY) {
ParserException parserException =
new ParserException(
if (type.getDataType() == STRING) {
YangStringRestriction stringRestriction = (YangStringRestriction) type.getDataTypeExtendedInfo();
if (stringRestriction == null) {
代码示例来源:origin: org.onosproject/onos-yang-datamodel
for (YangLeaf leaf : leaves) {
if (key.equals(leaf.getName())) {
if (leaf.getDataType().getDataType() == YangDataTypes.EMPTY) {
throw new DataModelException(" A leaf that is part of the key must not be the built-in " +
"type \"empty\"." +
代码示例来源:origin: org.onosproject/onos-yang-datamodel
YangType baseType = yangLeaf.getDataType();
if (baseType.getDataType() == LEAFREF) {
YangLeafRef referredLeafRefInfo = (YangLeafRef) (yangLeaf.getDataType().getDataTypeExtendedInfo());
} else if (baseType.getDataType() == YangDataTypes.DERIVED) {
YangType baseType = yangLeafList.getDataType();
if (baseType.getDataType() == LEAFREF) {
YangLeafRef referredLeafRefInfo = (YangLeafRef) yangLeafList.getDataType().getDataTypeExtendedInfo();
} else if (baseType.getDataType() == YangDataTypes.DERIVED) {
代码示例来源:origin: org.onosproject/onos-yang-utils-parser
if (((YangType) curData).getDataType() == YangDataTypes.INSTANCE_IDENTIFIER) {
代码示例来源:origin: org.onosproject/onos-yang-datamodel
YangDataTypes type = baseType.getDataType();
T extended = (T) baseType.getDataTypeExtendedInfo();
本文整理了Java中org.batfish.datamodel.Zone类的一些代码示例,展示了Zone类的具体用法。这些代码示例主要来源于Github/Stackoverflow/Maven等平台,
我似乎无法将文本数据(例如 CSV、JSON 或 XML 文件)添加到 Roblox DataModel 、Workspace、ServerStorage 还是任何地方? 关于如何高效执行此操作的任何
我有一个用位置更新创建的数据库,数据库中有一堆位置 x 和 y。在第二种方法中,readFirestore() 读取位置数据并比较来自 sqlite 数据库的最喜欢的位置,如果最喜欢的位置靠近来自 f
本文整理了Java中org.onosproject.yangutils.datamodel.YangReferenceResolver类的一些代码示例,展示了YangReferenceResolver
本文整理了Java中org.onosproject.yangutils.datamodel.YangNode类的一些代码示例,展示了YangNode类的具体用法。这些代码示例主要来源于Github/S
本文整理了Java中org.onosproject.yangutils.datamodel.YangUnion类的一些代码示例,展示了YangUnion类的具体用法。这些代码示例主要来源于Github
本文整理了Java中org.onosproject.yangutils.datamodel.YangTypeDef类的一些代码示例,展示了YangTypeDef类的具体用法。这些代码示例主要来源于Gi
本文整理了Java中org.onosproject.yangutils.datamodel.YangType类的一些代码示例,展示了YangType类的具体用法。这些代码示例主要来源于Github/S
本文整理了Java中org.onosproject.yangutils.datamodel.YangSubModule类的一些代码示例,展示了YangSubModule类的具体用法。这些代码示例主要来
本文整理了Java中org.onosproject.yangutils.datamodel.YangRevision类的一些代码示例,展示了YangRevision类的具体用法。这些代码示例主要来源于
本文整理了Java中org.onosproject.yangutils.datamodel.YangRpc类的一些代码示例,展示了YangRpc类的具体用法。这些代码示例主要来源于Github/Sta
本文整理了Java中org.onosproject.yangutils.datamodel.YangPatternRestriction类的一些代码示例,展示了YangPatternRestricti
本文整理了Java中org.onosproject.yangutils.datamodel.YangStringRestriction类的一些代码示例,展示了YangStringRestriction
本文整理了Java中org.onosproject.yangutils.datamodel.YangFeature类的一些代码示例,展示了YangFeature类的具体用法。这些代码示例主要来源于Gi
本文整理了Java中org.onosproject.yangutils.datamodel.YangLeafRef类的一些代码示例,展示了YangLeafRef类的具体用法。这些代码示例主要来源于Gi
本文整理了Java中org.onosproject.yangutils.datamodel.YangLeafList类的一些代码示例,展示了YangLeafList类的具体用法。这些代码示例主要来源于
本文整理了Java中org.onosproject.yangutils.datamodel.YangLeaf类的一些代码示例,展示了YangLeaf类的具体用法。这些代码示例主要来源于Github/S
本文整理了Java中org.onosproject.yangutils.datamodel.YangList类的一些代码示例,展示了YangList类的具体用法。这些代码示例主要来源于Github/S
本文整理了Java中org.onosproject.yangutils.datamodel.YangNodeIdentifier类的一些代码示例,展示了YangNodeIdentifier类的具体用法
本文整理了Java中org.onosproject.yangutils.datamodel.YangAugment类的一些代码示例,展示了YangAugment类的具体用法。这些代码示例主要来源于Gi
我是一名优秀的程序员,十分优秀!