Search in sources :

Example 1 with ResolvedLeafref

use of org.opendaylight.mdsal.binding.generator.impl.reactor.TypeReference.ResolvedLeafref in project mdsal by opendaylight.

the class AbstractTypeObjectGenerator method addAsGetterMethodOverride.

@Override
final void addAsGetterMethodOverride(final GeneratedTypeBuilderBase<?> builder, final TypeBuilderFactory builderFactory) {
    if (!(refType instanceof ResolvedLeafref)) {
        // We are not dealing with a leafref or have nothing to add
        return;
    }
    final AbstractTypeObjectGenerator<?, ?> prev = (AbstractTypeObjectGenerator<?, ?>) verifyNotNull(previous(), "Missing previous link in %s", this);
    if (prev.refType instanceof ResolvedLeafref) {
        // We should be already inheriting the correct type
        return;
    }
    // Note: this may we wrapped for leaf-list, hence we need to deal with that
    final Type myType = methodReturnType(builderFactory);
    LOG.trace("Override of {} to {}", this, myType);
    final MethodSignatureBuilder getter = constructGetter(builder, myType);
    getter.addAnnotation(OVERRIDE_ANNOTATION);
    annotateDeprecatedIfNecessary(getter);
}
Also used : RuntimeType(org.opendaylight.mdsal.binding.runtime.api.RuntimeType) Type(org.opendaylight.mdsal.binding.model.api.Type) ConcreteType(org.opendaylight.mdsal.binding.model.api.ConcreteType) GeneratedType(org.opendaylight.mdsal.binding.model.api.GeneratedType) ResolvedLeafref(org.opendaylight.mdsal.binding.generator.impl.reactor.TypeReference.ResolvedLeafref) MethodSignatureBuilder(org.opendaylight.mdsal.binding.model.api.type.builder.MethodSignatureBuilder)

Aggregations

ResolvedLeafref (org.opendaylight.mdsal.binding.generator.impl.reactor.TypeReference.ResolvedLeafref)1 ConcreteType (org.opendaylight.mdsal.binding.model.api.ConcreteType)1 GeneratedType (org.opendaylight.mdsal.binding.model.api.GeneratedType)1 Type (org.opendaylight.mdsal.binding.model.api.Type)1 MethodSignatureBuilder (org.opendaylight.mdsal.binding.model.api.type.builder.MethodSignatureBuilder)1 RuntimeType (org.opendaylight.mdsal.binding.runtime.api.RuntimeType)1