--- /dev/null
+/*
+ * Copyright (c) 2015 Cisco Systems, Inc. and others. All rights reserved.
+ *
+ * This program and the accompanying materials are made available under the
+ * terms of the Eclipse Public License v1.0 which accompanies this distribution,
+ * and is available at http://www.eclipse.org/legal/epl-v10.html
+ */
+package org.opendaylight.yangtools.yang.model.api.stmt;
+
+import com.google.common.annotations.Beta;
+import javax.annotation.Nonnull;
+import org.opendaylight.yangtools.yang.model.api.TypeDefinition;
+
+/**
+ * Interface indicating an entity which acts as a holder of a {@link TypeDefinition}.
+ */
+@Beta
+public interface TypeDefinitionAware {
+ /**
+ * Return this statement's effective type definition.
+ *
+ * @return Effective {@link TypeDefinition} as defined by this statement.
+ */
+ @Nonnull TypeDefinition<?> getTypeDefinition();
+}
--- /dev/null
+/*
+ * Copyright (c) 2015 Cisco Systems, Inc. and others. All rights reserved.
+ *
+ * This program and the accompanying materials are made available under the
+ * terms of the Eclipse Public License v1.0 which accompanies this distribution,
+ * and is available at http://www.eclipse.org/legal/epl-v10.html
+ */
+package org.opendaylight.yangtools.yang.model.api.stmt;
+
+import org.opendaylight.yangtools.yang.model.api.meta.EffectiveStatement;
+
+public interface TypeEffectiveStatement<T extends TypeStatement> extends EffectiveStatement<String, T>, TypeDefinitionAware {
+
+}
--- /dev/null
+/*
+ * Copyright (c) 2015 Cisco Systems, Inc. and others. All rights reserved.
+ *
+ * This program and the accompanying materials are made available under the
+ * terms of the Eclipse Public License v1.0 which accompanies this distribution,
+ * and is available at http://www.eclipse.org/legal/epl-v10.html
+ */
+package org.opendaylight.yangtools.yang.model.api.stmt;
+
+import org.opendaylight.yangtools.yang.common.QName;
+import org.opendaylight.yangtools.yang.model.api.meta.EffectiveStatement;
+
+/**
+ * Effective model statement which should be used to derive application behaviour related to typedefs.
+ */
+public interface TypedefEffectiveStatement extends EffectiveStatement<QName, TypedefStatement>, TypeDefinitionAware {
+
+}
package org.opendaylight.yangtools.yang.parser.spi;
import org.opendaylight.yangtools.yang.common.QName;
-import org.opendaylight.yangtools.yang.model.api.meta.EffectiveStatement;
+import org.opendaylight.yangtools.yang.model.api.stmt.TypedefEffectiveStatement;
import org.opendaylight.yangtools.yang.model.api.stmt.TypedefStatement;
-import org.opendaylight.yangtools.yang.parser.spi.meta.StatementNamespace;
+import org.opendaylight.yangtools.yang.parser.spi.meta.StatementNamespace.TreeScoped;
/**
* Derived types namespace
* This means that any descendant node may use that typedef, and it MUST NOT
* define a typedef with the same name.
*
+ * This namespace includes all type definitions implied by the language in which
+ * the current statement resides (e.g. RFC6020 for YANG).
*/
-public interface TypeNamespace extends StatementNamespace.TreeScoped<QName, TypedefStatement, EffectiveStatement<QName,TypedefStatement>> {
+public interface TypeNamespace extends TreeScoped<QName, TypedefStatement, TypedefEffectiveStatement> {
}
import java.util.Set;
import org.opendaylight.yangtools.yang.model.api.TypeDefinition;
import org.opendaylight.yangtools.yang.model.api.meta.EffectiveStatement;
+import org.opendaylight.yangtools.yang.model.api.stmt.TypeDefinitionAware;
import org.opendaylight.yangtools.yang.model.api.type.LengthConstraint;
import org.opendaylight.yangtools.yang.model.api.type.RangeConstraint;
import org.opendaylight.yangtools.yang.model.util.BinaryType;
import org.opendaylight.yangtools.yang.model.util.Uint8;
import org.opendaylight.yangtools.yang.parser.stmt.rfc6020.effective.type.LengthConstraintEffectiveImpl;
import org.opendaylight.yangtools.yang.parser.stmt.rfc6020.effective.type.RangeConstraintEffectiveImpl;
-import org.opendaylight.yangtools.yang.parser.stmt.rfc6020.effective.type.TypeDefinitionEffectiveBuilder;
import org.opendaylight.yangtools.yang.parser.util.UnknownBoundaryNumber;
/**
}
public static TypeDefinition<?> getTypeFromEffectiveStatement(final EffectiveStatement<?, ?> effectiveStatement) {
- if (effectiveStatement instanceof TypeDefinitionEffectiveBuilder) {
- TypeDefinitionEffectiveBuilder typeDefEffectiveBuilder = (TypeDefinitionEffectiveBuilder) effectiveStatement;
- return typeDefEffectiveBuilder.buildType();
+ if (effectiveStatement instanceof TypeDefinitionAware) {
+ TypeDefinitionAware typeDefEffectiveBuilder = (TypeDefinitionAware) effectiveStatement;
+ return typeDefEffectiveBuilder.getTypeDefinition();
} else {
final String typeName = ((TypeDefinition<?>) effectiveStatement).getQName().getLocalName();
return PRIMITIVE_TYPES_MAP.get(typeName);
import org.opendaylight.yangtools.yang.model.api.UsesNode;
import org.opendaylight.yangtools.yang.model.api.meta.DeclaredStatement;
import org.opendaylight.yangtools.yang.model.api.meta.EffectiveStatement;
-import org.opendaylight.yangtools.yang.model.util.ExtendedType;
import org.opendaylight.yangtools.yang.parser.spi.meta.StmtContext;
abstract class AbstractEffectiveDocumentedDataNodeContainer<A, D extends DeclaredStatement<A>>
}
if (effectiveStatement instanceof TypeDefEffectiveStatementImpl) {
TypeDefEffectiveStatementImpl typeDef = (TypeDefEffectiveStatementImpl) effectiveStatement;
- ExtendedType extendedType = typeDef.buildType();
- if (!mutableTypeDefinitions.contains(extendedType)) {
- mutableTypeDefinitions.add(extendedType);
+ TypeDefinition<?> type = typeDef.getTypeDefinition();
+ if (!mutableTypeDefinitions.contains(type)) {
+ mutableTypeDefinitions.add(type);
} else {
throw EffectiveStmtUtils.createNameCollisionSourceException(ctx, effectiveStatement);
}
import org.opendaylight.yangtools.yang.model.api.meta.DeclaredStatement;
import org.opendaylight.yangtools.yang.model.api.meta.EffectiveStatement;
import org.opendaylight.yangtools.yang.model.api.stmt.SubmoduleStatement;
-import org.opendaylight.yangtools.yang.model.util.ExtendedType;
import org.opendaylight.yangtools.yang.model.util.ModuleImportImpl;
import org.opendaylight.yangtools.yang.parser.spi.SubmoduleNamespace;
import org.opendaylight.yangtools.yang.parser.spi.meta.StmtContext;
}
if (effectiveStatement instanceof TypeDefEffectiveStatementImpl) {
TypeDefEffectiveStatementImpl typeDef = (TypeDefEffectiveStatementImpl) effectiveStatement;
- ExtendedType extendedType = typeDef.buildType();
- if (!mutableTypeDefinitions.contains(extendedType)) {
- mutableTypeDefinitions.add(extendedType);
+ TypeDefinition<?> type = typeDef.getTypeDefinition();
+ if (!mutableTypeDefinitions.contains(type)) {
+ mutableTypeDefinitions.add(type);
} else {
throw EffectiveStmtUtils.createNameCollisionSourceException(ctx, effectiveStatement);
}
import org.opendaylight.yangtools.yang.model.api.TypeDefinition;
import org.opendaylight.yangtools.yang.model.api.UnknownSchemaNode;
import org.opendaylight.yangtools.yang.model.api.meta.EffectiveStatement;
+import org.opendaylight.yangtools.yang.model.api.stmt.TypeEffectiveStatement;
import org.opendaylight.yangtools.yang.model.api.stmt.TypeStatement;
+import org.opendaylight.yangtools.yang.model.api.stmt.TypedefEffectiveStatement;
import org.opendaylight.yangtools.yang.model.api.stmt.TypedefStatement;
import org.opendaylight.yangtools.yang.model.api.type.BinaryTypeDefinition;
import org.opendaylight.yangtools.yang.model.api.type.IntegerTypeDefinition;
import org.opendaylight.yangtools.yang.parser.stmt.rfc6020.effective.type.LengthEffectiveStatementImpl;
import org.opendaylight.yangtools.yang.parser.stmt.rfc6020.effective.type.PatternEffectiveStatementImpl;
import org.opendaylight.yangtools.yang.parser.stmt.rfc6020.effective.type.RangeEffectiveStatementImpl;
-import org.opendaylight.yangtools.yang.parser.stmt.rfc6020.effective.type.TypeDefinitionEffectiveBuilder;
import org.opendaylight.yangtools.yang.parser.util.TypeConstraints;
public final class ExtendedTypeEffectiveStatementImpl extends AbstractEffectiveDocumentedNode<String, TypeStatement>
implements
- TypeDefinition<TypeDefinition<?>>, TypeDefinitionEffectiveBuilder {
+ TypeDefinition<TypeDefinition<?>>, TypeEffectiveStatement<TypeStatement> {
private static final Splitter COLON_SPLITTER = Splitter.on(':').trimResults();
this.isExtended = isExtended;
qName = initQName(ctx, isExtended);
- final StmtContext<?, TypedefStatement, EffectiveStatement<QName, TypedefStatement>> typeStmt =
+ final StmtContext<?, TypedefStatement, TypedefEffectiveStatement> typeStmt =
ctx.getFromNamespace(TypeNamespace.class, qName);
if (typeStmt == null) {
path = Utils.getSchemaPath(ctx);
if (TypeUtils.isYangPrimitiveTypeString(baseTypeQName.getLocalName())) {
baseType = TypeUtils.getYangPrimitiveTypeFromString(baseTypeQName.getLocalName());
} else {
- StmtContext<?, TypedefStatement, EffectiveStatement<QName, TypedefStatement>> baseTypeCtx = ctx
+ StmtContext<?, TypedefStatement, TypedefEffectiveStatement> baseTypeCtx = ctx
.getParentContext().getFromNamespace(TypeNamespace.class, baseTypeQName);
if (baseTypeCtx == null) {
}
@Override
- public ExtendedType buildType() {
-
+ public TypeDefinition<?> getTypeDefinition() {
if (extendedType != null) {
return extendedType;
}
if (!isExtended && baseType instanceof TypeDefEffectiveStatementImpl) {
TypeDefEffectiveStatementImpl originalTypeDef = (TypeDefEffectiveStatementImpl) baseType;
- return originalTypeDef.buildType();
+ return originalTypeDef.getTypeDefinition();
}
Builder extendedTypeBuilder;
if (baseType instanceof TypeDefEffectiveStatementImpl) {
TypeDefEffectiveStatementImpl typeDefBaseType = (TypeDefEffectiveStatementImpl) baseType;
- extendedTypeBuilder = ExtendedType.builder(qName, typeDefBaseType.buildType(),
+ extendedTypeBuilder = ExtendedType.builder(qName, typeDefBaseType.getTypeDefinition(),
Optional.fromNullable(getDescription()), Optional.fromNullable(getReference()), path);
} else {
extendedTypeBuilder = ExtendedType.builder(qName, baseType, Optional.fromNullable(getDescription()),
import org.opendaylight.yangtools.yang.model.api.TypeDefinition;
import org.opendaylight.yangtools.yang.model.api.UnknownSchemaNode;
import org.opendaylight.yangtools.yang.model.api.meta.EffectiveStatement;
+import org.opendaylight.yangtools.yang.model.api.stmt.TypeDefinitionAware;
import org.opendaylight.yangtools.yang.model.api.stmt.TypeStatement;
+import org.opendaylight.yangtools.yang.model.api.stmt.TypedefEffectiveStatement;
import org.opendaylight.yangtools.yang.model.api.stmt.TypedefStatement;
import org.opendaylight.yangtools.yang.model.api.type.LengthConstraint;
import org.opendaylight.yangtools.yang.model.api.type.PatternConstraint;
import org.opendaylight.yangtools.yang.parser.stmt.rfc6020.effective.type.LengthEffectiveStatementImpl;
import org.opendaylight.yangtools.yang.parser.stmt.rfc6020.effective.type.PatternEffectiveStatementImpl;
import org.opendaylight.yangtools.yang.parser.stmt.rfc6020.effective.type.RangeEffectiveStatementImpl;
-import org.opendaylight.yangtools.yang.parser.stmt.rfc6020.effective.type.TypeDefinitionEffectiveBuilder;
public final class TypeDefEffectiveStatementImpl extends AbstractEffectiveSchemaNode<TypedefStatement> implements
- TypeDefinition<TypeDefinition<?>>, TypeDefinitionEffectiveBuilder {
+ TypeDefinition<TypeDefinition<?>>, TypedefEffectiveStatement {
private final TypeDefinition<?> baseType;
private final String defaultValue;
private final String units;
}
}
} else {
- StmtContext<?, TypedefStatement, EffectiveStatement<QName, TypedefStatement>> baseTypeCtx = ctx
+ StmtContext<?, TypedefStatement, TypedefEffectiveStatement> baseTypeCtx = ctx
.getParentContext().getFromNamespace(TypeNamespace.class, baseTypeQName);
baseTypeInit = (TypeDefEffectiveStatementImpl) baseTypeCtx.buildEffective();
}
return baseTypeInit;
}
- protected Integer initFractionDigits(final EffectiveStatementBase<?, ?> typeEffectiveStmt) {
+ private static Integer initFractionDigits(final EffectiveStatementBase<?, ?> typeEffectiveStmt) {
final FractionDigitsEffectiveStatementImpl fractionDigitsEffStmt = typeEffectiveStmt
.firstEffective(FractionDigitsEffectiveStatementImpl.class);
return fractionDigitsEffStmt != null ? fractionDigitsEffStmt.argument() : null;
}
- protected List<RangeConstraint> initRanges(final EffectiveStatementBase<?, ?> typeEffectiveStmt) {
+ private static List<RangeConstraint> initRanges(final EffectiveStatementBase<?, ?> typeEffectiveStmt) {
final RangeEffectiveStatementImpl rangeConstraints = typeEffectiveStmt
.firstEffective(RangeEffectiveStatementImpl.class);
return rangeConstraints != null ? rangeConstraints.argument() : Collections.<RangeConstraint> emptyList();
}
- protected List<LengthConstraint> initLengths(final EffectiveStatementBase<?, ?> typeEffectiveStmt) {
+ private static List<LengthConstraint> initLengths(final EffectiveStatementBase<?, ?> typeEffectiveStmt) {
final LengthEffectiveStatementImpl lengthConstraints = typeEffectiveStmt
.firstEffective(LengthEffectiveStatementImpl.class);
return lengthConstraints != null ? lengthConstraints.argument() : Collections.<LengthConstraint> emptyList();
}
- protected List<PatternConstraint> initPatterns(final EffectiveStatementBase<?, ?> typeEffectiveStmt) {
+ private static List<PatternConstraint> initPatterns(final EffectiveStatementBase<?, ?> typeEffectiveStmt) {
final List<PatternConstraint> patternConstraints = new ArrayList<>();
for (final EffectiveStatement<?, ?> effectiveStatement : typeEffectiveStmt.effectiveSubstatements()) {
}
@Override
- public ExtendedType buildType() {
-
+ public TypeDefinition<?> getTypeDefinition() {
if (extendedType != null) {
return extendedType;
}
Builder extendedTypeBuilder;
- if (baseType instanceof TypeDefinitionEffectiveBuilder) {
- TypeDefinitionEffectiveBuilder typeDefBaseType = (TypeDefinitionEffectiveBuilder) baseType;
- extendedTypeBuilder = ExtendedType.builder(getQName(), typeDefBaseType.buildType(),
+ if (baseType instanceof TypeDefinitionAware) {
+ TypeDefinitionAware typeDefBaseType = (TypeDefinitionAware) baseType;
+ extendedTypeBuilder = ExtendedType.builder(getQName(), typeDefBaseType.getTypeDefinition(),
Optional.fromNullable(getDescription()), Optional.fromNullable(getReference()), getPath());
} else {
extendedTypeBuilder = ExtendedType.builder(getQName(), baseType, Optional.fromNullable(getDescription()),
import org.opendaylight.yangtools.yang.model.api.TypeDefinition;
import org.opendaylight.yangtools.yang.model.api.UnknownSchemaNode;
import org.opendaylight.yangtools.yang.model.api.meta.EffectiveStatement;
-import org.opendaylight.yangtools.yang.model.api.stmt.TypeStatement;
+import org.opendaylight.yangtools.yang.model.api.stmt.TypeEffectiveStatement;
+import org.opendaylight.yangtools.yang.model.api.stmt.TypeStatement.BitsSpecification;
import org.opendaylight.yangtools.yang.model.api.type.BitsTypeDefinition;
import org.opendaylight.yangtools.yang.model.util.BaseTypes;
import org.opendaylight.yangtools.yang.model.util.BitsType;
import org.opendaylight.yangtools.yang.parser.stmt.rfc6020.effective.EffectiveStatementBase;
public class BitsSpecificationEffectiveStatementImpl extends
- EffectiveStatementBase<String, TypeStatement.BitsSpecification> implements BitsTypeDefinition, TypeDefinitionEffectiveBuilder {
+ EffectiveStatementBase<String, BitsSpecification> implements BitsTypeDefinition, TypeEffectiveStatement<BitsSpecification> {
private static final QName QNAME = BaseTypes.BITS_QNAME;
private static final String DESCRIPTION = "The bits built-in type represents a bit set. "
private static final String UNITS = "";
private final SchemaPath path;
private final List<Bit> bits;
+ private BitsType bitsTypeInstance = null;
- public BitsSpecificationEffectiveStatementImpl(final StmtContext<String, TypeStatement.BitsSpecification, EffectiveStatement<String, TypeStatement.BitsSpecification>> ctx) {
+ public BitsSpecificationEffectiveStatementImpl(final StmtContext<String, BitsSpecification, EffectiveStatement<String, BitsSpecification>> ctx) {
super(ctx);
List<Bit> bitsInit = new ArrayList<>();
return builder.toString();
}
- private BitsType bitsTypeInstance = null;
@Override
- public TypeDefinition<?> buildType() {
-
+ public TypeDefinition<?> getTypeDefinition() {
if(bitsTypeInstance != null) {
return bitsTypeInstance;
}
import org.opendaylight.yangtools.yang.model.api.TypeDefinition;
import org.opendaylight.yangtools.yang.model.api.UnknownSchemaNode;
import org.opendaylight.yangtools.yang.model.api.meta.EffectiveStatement;
-import org.opendaylight.yangtools.yang.model.api.stmt.TypeStatement;
+import org.opendaylight.yangtools.yang.model.api.stmt.TypeEffectiveStatement;
+import org.opendaylight.yangtools.yang.model.api.stmt.TypeStatement.Decimal64Specification;
import org.opendaylight.yangtools.yang.model.api.type.DecimalTypeDefinition;
import org.opendaylight.yangtools.yang.model.api.type.RangeConstraint;
import org.opendaylight.yangtools.yang.model.util.Decimal64;
import org.opendaylight.yangtools.yang.parser.stmt.rfc6020.effective.FractionDigitsEffectiveStatementImpl;
public class Decimal64SpecificationEffectiveStatementImpl extends
- EffectiveStatementBase<String, TypeStatement.Decimal64Specification>
- implements DecimalTypeDefinition, TypeDefinitionEffectiveBuilder {
+ EffectiveStatementBase<String, Decimal64Specification>
+ implements DecimalTypeDefinition, TypeEffectiveStatement<Decimal64Specification> {
private static final String UNITS = "";
private static final BigDecimal DEFAULT_VALUE = null;
private Decimal64 decimal64Instance = null;
public Decimal64SpecificationEffectiveStatementImpl(
- final StmtContext<String, TypeStatement.Decimal64Specification, EffectiveStatement<String, TypeStatement.Decimal64Specification>> ctx) {
+ final StmtContext<String, Decimal64Specification, EffectiveStatement<String, Decimal64Specification>> ctx) {
super(ctx);
for (final EffectiveStatement<?, ?> effectiveStatement : effectiveSubstatements()) {
}
@Override
- public TypeDefinition<?> buildType() {
+ public TypeDefinition<?> getTypeDefinition() {
if (decimal64Instance == null) {
decimal64Instance = Decimal64.create(path, fractionDigits);
import org.opendaylight.yangtools.yang.model.api.TypeDefinition;
import org.opendaylight.yangtools.yang.model.api.UnknownSchemaNode;
import org.opendaylight.yangtools.yang.model.api.meta.EffectiveStatement;
-import org.opendaylight.yangtools.yang.model.api.stmt.TypeStatement;
+import org.opendaylight.yangtools.yang.model.api.stmt.TypeEffectiveStatement;
+import org.opendaylight.yangtools.yang.model.api.stmt.TypeStatement.EnumSpecification;
import org.opendaylight.yangtools.yang.model.api.type.EnumTypeDefinition;
import org.opendaylight.yangtools.yang.model.util.EnumerationType;
import org.opendaylight.yangtools.yang.parser.spi.meta.StmtContext;
import org.opendaylight.yangtools.yang.parser.stmt.rfc6020.effective.EffectiveStatementBase;
public class EnumSpecificationEffectiveStatementImpl extends
- EffectiveStatementBase<String, TypeStatement.EnumSpecification> implements EnumTypeDefinition, TypeDefinitionEffectiveBuilder {
+ EffectiveStatementBase<String, EnumSpecification> implements EnumTypeDefinition, TypeEffectiveStatement<EnumSpecification> {
private static final QName QNAME = QName.create(YangConstants.RFC6020_YANG_MODULE, "enumeration");
private final List<EnumPair> enums;
private EnumerationType enumerationTypeInstance = null;
- public EnumSpecificationEffectiveStatementImpl(final StmtContext<String, TypeStatement.EnumSpecification, EffectiveStatement<String, TypeStatement.EnumSpecification>> ctx) {
+ public EnumSpecificationEffectiveStatementImpl(final StmtContext<String, EnumSpecification, EffectiveStatement<String, EnumSpecification>> ctx) {
super(ctx);
List<EnumPair> enumsInit = new ArrayList<>();
}
@Override
- public TypeDefinition<?> buildType() {
+ public TypeDefinition<?> getTypeDefinition() {
if (enumerationTypeInstance !=null) {
return enumerationTypeInstance;
*/
package org.opendaylight.yangtools.yang.parser.stmt.rfc6020.effective.type;
-import org.opendaylight.yangtools.yang.model.api.stmt.IdentityStatement;
-
-import org.opendaylight.yangtools.yang.parser.spi.IdentityNamespace;
-import org.opendaylight.yangtools.yang.parser.stmt.rfc6020.effective.BaseEffectiveStatementImpl;
-import org.opendaylight.yangtools.yang.model.util.IdentityrefType;
-import org.opendaylight.yangtools.yang.model.api.TypeDefinition;
-import org.opendaylight.yangtools.yang.model.api.stmt.TypeStatement;
-import org.opendaylight.yangtools.yang.parser.stmt.rfc6020.effective.EffectiveStatementBase;
import java.util.Collections;
import java.util.List;
import org.opendaylight.yangtools.yang.common.QName;
import org.opendaylight.yangtools.yang.model.api.IdentitySchemaNode;
import org.opendaylight.yangtools.yang.model.api.SchemaPath;
import org.opendaylight.yangtools.yang.model.api.Status;
+import org.opendaylight.yangtools.yang.model.api.TypeDefinition;
import org.opendaylight.yangtools.yang.model.api.UnknownSchemaNode;
import org.opendaylight.yangtools.yang.model.api.meta.EffectiveStatement;
+import org.opendaylight.yangtools.yang.model.api.stmt.IdentityStatement;
+import org.opendaylight.yangtools.yang.model.api.stmt.TypeEffectiveStatement;
+import org.opendaylight.yangtools.yang.model.api.stmt.TypeStatement.IdentityRefSpecification;
import org.opendaylight.yangtools.yang.model.api.type.IdentityrefTypeDefinition;
+import org.opendaylight.yangtools.yang.model.util.IdentityrefType;
+import org.opendaylight.yangtools.yang.parser.spi.IdentityNamespace;
import org.opendaylight.yangtools.yang.parser.spi.meta.StmtContext;
import org.opendaylight.yangtools.yang.parser.stmt.rfc6020.TypeUtils;
import org.opendaylight.yangtools.yang.parser.stmt.rfc6020.Utils;
+import org.opendaylight.yangtools.yang.parser.stmt.rfc6020.effective.BaseEffectiveStatementImpl;
+import org.opendaylight.yangtools.yang.parser.stmt.rfc6020.effective.EffectiveStatementBase;
public class IdentityRefSpecificationEffectiveStatementImpl extends
- EffectiveStatementBase<String, TypeStatement.IdentityRefSpecification> implements IdentityrefTypeDefinition,
- TypeDefinitionEffectiveBuilder {
+ EffectiveStatementBase<String, IdentityRefSpecification> implements IdentityrefTypeDefinition,
+ TypeEffectiveStatement<IdentityRefSpecification> {
private static final QName QNAME = QName.create(YangConstants.RFC6020_YANG_MODULE, TypeUtils.IDENTITY_REF);
private IdentityrefType identityRefTypeInstance = null;
public IdentityRefSpecificationEffectiveStatementImpl(
- StmtContext<String, TypeStatement.IdentityRefSpecification, EffectiveStatement<String, TypeStatement.IdentityRefSpecification>> ctx) {
+ final StmtContext<String, IdentityRefSpecification, EffectiveStatement<String, IdentityRefSpecification>> ctx) {
super(ctx);
path = Utils.getSchemaPath(ctx.getParentContext()).createChild(QNAME);
}
@Override
- public TypeDefinition<?> buildType() {
+ public TypeDefinition<?> getTypeDefinition() {
if (identityRefTypeInstance != null) {
return identityRefTypeInstance;
*/
package org.opendaylight.yangtools.yang.parser.stmt.rfc6020.effective.type;
-import org.opendaylight.yangtools.yang.model.util.InstanceIdentifierType;
-
-import org.opendaylight.yangtools.yang.model.api.TypeDefinition;
-import org.opendaylight.yangtools.yang.model.api.stmt.TypeStatement;
-import org.opendaylight.yangtools.yang.parser.stmt.rfc6020.effective.EffectiveStatementBase;
import java.util.Collections;
import java.util.List;
import org.opendaylight.yangtools.yang.common.QName;
import org.opendaylight.yangtools.yang.model.api.RevisionAwareXPath;
import org.opendaylight.yangtools.yang.model.api.SchemaPath;
import org.opendaylight.yangtools.yang.model.api.Status;
+import org.opendaylight.yangtools.yang.model.api.TypeDefinition;
import org.opendaylight.yangtools.yang.model.api.UnknownSchemaNode;
import org.opendaylight.yangtools.yang.model.api.meta.EffectiveStatement;
+import org.opendaylight.yangtools.yang.model.api.stmt.TypeEffectiveStatement;
+import org.opendaylight.yangtools.yang.model.api.stmt.TypeStatement.InstanceIdentifierSpecification;
import org.opendaylight.yangtools.yang.model.api.type.InstanceIdentifierTypeDefinition;
+import org.opendaylight.yangtools.yang.model.util.InstanceIdentifierType;
import org.opendaylight.yangtools.yang.parser.spi.meta.StmtContext;
+import org.opendaylight.yangtools.yang.parser.stmt.rfc6020.effective.EffectiveStatementBase;
import org.opendaylight.yangtools.yang.parser.stmt.rfc6020.effective.RequireInstanceEffectiveStatementImpl;
public class InstanceIdentifierSpecificationEffectiveStatementImpl extends
- EffectiveStatementBase<String, TypeStatement.InstanceIdentifierSpecification> implements TypeDefinitionEffectiveBuilder, InstanceIdentifierTypeDefinition {
+ EffectiveStatementBase<String, InstanceIdentifierSpecification> implements InstanceIdentifierTypeDefinition,
+ TypeEffectiveStatement<InstanceIdentifierSpecification> {
private static final QName QNAME = QName.create(YangConstants.RFC6020_YANG_MODULE, "instance-identifier");
private static final SchemaPath PATH = SchemaPath.create(true, QNAME);
private final Boolean requireInstance;
public InstanceIdentifierSpecificationEffectiveStatementImpl(
- StmtContext<String, TypeStatement.InstanceIdentifierSpecification, EffectiveStatement<String, TypeStatement.InstanceIdentifierSpecification>> ctx) {
+ final StmtContext<String, InstanceIdentifierSpecification, EffectiveStatement<String, InstanceIdentifierSpecification>> ctx) {
super(ctx);
RequireInstanceEffectiveStatementImpl requireInstanceStmtCtx = firstEffective(RequireInstanceEffectiveStatementImpl.class);
}
@Override
- public TypeDefinition<?> buildType() {
+ public TypeDefinition<?> getTypeDefinition() {
return InstanceIdentifierType.create(requireInstance);
}
}
import org.opendaylight.yangtools.yang.model.api.RevisionAwareXPath;
import org.opendaylight.yangtools.yang.model.api.SchemaPath;
import org.opendaylight.yangtools.yang.model.api.Status;
+import org.opendaylight.yangtools.yang.model.api.TypeDefinition;
import org.opendaylight.yangtools.yang.model.api.UnknownSchemaNode;
import org.opendaylight.yangtools.yang.model.api.meta.EffectiveStatement;
-import org.opendaylight.yangtools.yang.model.api.stmt.TypeStatement;
+import org.opendaylight.yangtools.yang.model.api.stmt.TypeEffectiveStatement;
+import org.opendaylight.yangtools.yang.model.api.stmt.TypeStatement.LeafrefSpecification;
import org.opendaylight.yangtools.yang.model.api.type.LeafrefTypeDefinition;
import org.opendaylight.yangtools.yang.model.util.Leafref;
import org.opendaylight.yangtools.yang.parser.spi.meta.StmtContext;
import org.opendaylight.yangtools.yang.parser.stmt.rfc6020.effective.EffectiveStatementBase;
import org.opendaylight.yangtools.yang.parser.stmt.rfc6020.effective.PathEffectiveStatementImpl;
-public class LeafrefSpecificationEffectiveStatementImpl extends
- EffectiveStatementBase<String, TypeStatement.LeafrefSpecification> implements LeafrefTypeDefinition, TypeDefinitionEffectiveBuilder {
+public class LeafrefSpecificationEffectiveStatementImpl extends EffectiveStatementBase<String, LeafrefSpecification>
+ implements LeafrefTypeDefinition, TypeEffectiveStatement<LeafrefSpecification> {
public static final String LOCAL_NAME = "leafref";
private static final QName QNAME = QName.create(YangConstants.RFC6020_YANG_MODULE, LOCAL_NAME);
private RevisionAwareXPath xpath;
private Leafref leafrefInstance = null;
- public LeafrefSpecificationEffectiveStatementImpl(final StmtContext<String, TypeStatement.LeafrefSpecification, EffectiveStatement<String, TypeStatement.LeafrefSpecification>> ctx) {
+ public LeafrefSpecificationEffectiveStatementImpl(final StmtContext<String, LeafrefSpecification, EffectiveStatement<String, LeafrefSpecification>> ctx) {
super(ctx);
path = Utils.getSchemaPath(ctx.getParentContext()).createChild(QNAME);
}
@Override
- public Leafref buildType() {
-
+ public TypeDefinition<?> getTypeDefinition() {
if (leafrefInstance != null) {
return leafrefInstance;
}
+++ /dev/null
-/*
- * Copyright (c) 2015 Cisco Systems, Inc. and others. All rights reserved.
- *
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0 which accompanies this distribution,
- * and is available at http://www.eclipse.org/legal/epl-v10.html
- */
-
-package org.opendaylight.yangtools.yang.parser.stmt.rfc6020.effective.type;
-
-import org.opendaylight.yangtools.yang.model.api.TypeDefinition;
-
-/**
- * Effective statements of TypeDef, ExtendedType, Decimal64, Enumeration, Leafref, Union, IndetityRef, Bits
- * should implement this interface and method buildType() should create particular object from
- * yang.model.util (e.g. Decimal64)
- */
-public interface TypeDefinitionEffectiveBuilder {
-
- TypeDefinition<?> buildType();
-
-}
import org.opendaylight.yangtools.yang.model.api.TypeDefinition;
import org.opendaylight.yangtools.yang.model.api.UnknownSchemaNode;
import org.opendaylight.yangtools.yang.model.api.meta.EffectiveStatement;
-import org.opendaylight.yangtools.yang.model.api.stmt.TypeStatement;
+import org.opendaylight.yangtools.yang.model.api.stmt.TypeEffectiveStatement;
+import org.opendaylight.yangtools.yang.model.api.stmt.TypeStatement.UnionSpecification;
import org.opendaylight.yangtools.yang.model.api.type.UnionTypeDefinition;
import org.opendaylight.yangtools.yang.model.util.UnionType;
import org.opendaylight.yangtools.yang.parser.spi.meta.StmtContext;
import org.opendaylight.yangtools.yang.parser.stmt.rfc6020.effective.EffectiveStatementBase;
public class UnionSpecificationEffectiveStatementImpl extends
- EffectiveStatementBase<String, TypeStatement.UnionSpecification> implements UnionTypeDefinition,
- TypeDefinitionEffectiveBuilder {
+ EffectiveStatementBase<String, UnionSpecification> implements UnionTypeDefinition,
+ TypeEffectiveStatement<UnionSpecification> {
private static final QName QNAME = QName.create(YangConstants.RFC6020_YANG_MODULE, "union");
private static final SchemaPath PATH = SchemaPath.create(true, QNAME);
private UnionType unionTypeInstance = null;
public UnionSpecificationEffectiveStatementImpl(
- StmtContext<String, TypeStatement.UnionSpecification, EffectiveStatement<String, TypeStatement.UnionSpecification>> ctx) {
+ final StmtContext<String, UnionSpecification, EffectiveStatement<String, UnionSpecification>> ctx) {
super(ctx);
List<TypeDefinition<?>> typesInit = new ArrayList<>();
return builder.toString();
}
- public TypeDefinition<?> buildType() {
+ @Override
+ public TypeDefinition<?> getTypeDefinition() {
if (unionTypeInstance != null) {
return unionTypeInstance;