Tabnine Logo
FeatureReferenceSpec
Code IndexAdd Tabnine to your IDE (free)

How to use
FeatureReferenceSpec
in
org.jboss.galleon.spec

Best Java code snippets using org.jboss.galleon.spec.FeatureReferenceSpec (Showing top 16 results out of 315)

origin: org.jboss.galleon/galleon-core

  public FeatureReferenceSpec build() throws ProvisioningDescriptionException {
    return new FeatureReferenceSpec(origin, name, featureSpec, nillable, include, mappedParams);
  }
}
origin: org.jboss.galleon/galleon-core

public static FeatureReferenceSpec create(String str, boolean nillable) throws ProvisioningDescriptionException {
  return create(str, str, nillable);
}
origin: org.jboss.galleon/galleon-core

private void assertRefNotNillable(final ResolvedFeature feature, final FeatureReferenceSpec refSpec)
    throws ProvisioningDescriptionException {
  if (!refSpec.isNillable()) {
    throw new ProvisioningDescriptionException(Errors.nonNillableRefIsNull(feature, refSpec.getName()));
  }
}
origin: org.jboss.galleon/galleon-core

for(FeatureReferenceSpec ref : featureSpec.getFeatureRefs()) {
  final ElementNode refE = addElement(refsE, Element.REFERENCE);
  final String feature = ref.getFeature().toString();
  if(ref.getOrigin() != null) {
    addAttribute(refE, Attribute.DEPENDENCY, ref.getOrigin());
  if(!feature.equals(ref.getName())) {
    addAttribute(refE, Attribute.NAME, ref.getName());
  if(ref.isNillable()) {
    addAttribute(refE, Attribute.NILLABLE, TRUE);
  if(ref.isInclude()) {
    addAttribute(refE, Attribute.INCLUDE, TRUE);
  for(Map.Entry<String, String> mapping : ref.getMappedParams().entrySet()) {
    final ElementNode paramE = addElement(refE, Element.PARAMETER);
    addAttribute(paramE, Attribute.NAME, mapping.getKey());
origin: org.jboss.galleon/galleon-core

private void assertRefParamMapping(final FeatureReferenceSpec refSpec, final ResolvedFeatureSpec targetSpec)
    throws ProvisioningDescriptionException {
  if (!targetSpec.xmlSpec.hasId()) {
    throw new ProvisioningDescriptionException(id + " feature spec declares reference "
        + refSpec.getName() + " to feature spec " + targetSpec.id
        + " that has no ID parameters");
  }
  if(!refSpec.hasMappedParams()) {
    for(FeatureParameterSpec targetIdParam : targetSpec.xmlSpec.getIdParams()) {
      if(!xmlSpec.hasParam(targetIdParam.getName())) {
        throw new ProvisioningDescriptionException(Errors.nonExistingForeignKeyParam(refSpec.getName(), id, targetIdParam.getName()));
      }
    }
    return;
  }
  if (targetSpec.xmlSpec.getIdParams().size() != refSpec.getParamsMapped()) {
    throw new ProvisioningDescriptionException("The number of foreign key parameters of reference " + refSpec.getName() +
        " in feature spec " + id + " does not match the number of the ID parameters of the referenced feature spec "
        + targetSpec.id);
  }
  for(Map.Entry<String, String> mapping : refSpec.getMappedParams().entrySet()) {
    if (!xmlSpec.hasParam(mapping.getKey())) {
      throw new ProvisioningDescriptionException(Errors.nonExistingForeignKeyParam(refSpec.getName(), id, mapping.getKey()));
    }
    if (!targetSpec.xmlSpec.hasParam(mapping.getValue())) {
      throw new ProvisioningDescriptionException(
          Errors.nonExistingForeignKeyTarget(mapping.getKey(), refSpec.getName(), id, mapping.getValue(), targetSpec.id));
    }
  }
}
origin: org.jboss.galleon/galleon-core

parentFeature = resolvedFeature;
for(FeatureReferenceSpec refSpec : spec.xmlSpec.getFeatureRefs()) {
  if(!refSpec.isInclude()) {
    continue;
  final FeaturePackRuntimeBuilder originalFp = setOrigin(refSpec.getOrigin());
  try {
    final ResolvedFeatureSpec refResolvedSpec = getFeatureSpec(refSpec.getFeature().getName());
    final List<ResolvedFeatureId> refIds = spec.resolveRefId(parentFeature, refSpec, refResolvedSpec);
    if (!refIds.isEmpty()) {
origin: org.jboss.galleon/galleon-core

private ResolvedFeatureSpec resolveRefMapping(ProvisioningRuntimeBuilder rt, FeaturePackRuntimeBuilder origin,
    FeatureReferenceSpec refSpec) throws ProvisioningException {
  try {
    if(refSpec.getOrigin() != null) {
      origin = rt.layout.getFeaturePack(origin.getSpec().getFeaturePackDep(refSpec.getOrigin()).getLocation().getProducer());
    }
    final ResolvedFeatureSpec resolvedRefSpec = rt.getFeatureSpec(origin, refSpec.getFeature().getName());
    assertRefParamMapping(refSpec, resolvedRefSpec);
    return resolvedRefSpec;
  } catch (ProvisioningDescriptionException e) {
    throw new ProvisioningDescriptionException(Errors.failedToResolveFeatureReference(refSpec, id), e);
  }
}
origin: org.jboss.galleon/galleon-core

if (refSpec.hasMappedParams()) {
  for (Map.Entry<String, String> mapping : refSpec.getMappedParams().entrySet()) {
    if (xmlSpec.getParam(mapping.getKey()).isFeatureId()) {
      continue;
origin: org.jboss.galleon/galleon-cli

} else {
  for (FeatureReferenceSpec c : f.getSpec().getFeatureRefs()) {
    session.println(tab + c.getFeature());
origin: org.jboss.galleon/galleon-core

static String failedToResolveFeatureReference(FeatureReferenceSpec refSpec, ResolvedSpecId spec) {
  return "Failed to resolve feature reference " + refSpec.getName() + " for " + spec;
}
origin: org.jboss.galleon/galleon-core

  name = feature;
final FeatureReferenceSpec.Builder refBuilder = FeatureReferenceSpec.builder(feature).setOrigin(dependency).setName(name).setNillable(nillable).setInclude(include);
origin: org.jboss.galleon/galleon-core

Map<String, Object> params = Collections.emptyMap();
boolean child = feature.hasId() ? false : true; // no id is considered a child to make the list-add not break the branch
if(refSpec.hasMappedParams()) {
  for (Map.Entry<String, String> mapping : refSpec.getMappedParams().entrySet()) {
    final String paramName = mapping.getKey();
    final String refParamName = mapping.getValue();
origin: org.jboss.galleon/galleon-core

void resolveRefMappings(ProvisioningRuntimeBuilder rt) throws ProvisioningException {
  if(!xmlSpec.hasFeatureRefs()) {
    resolvedRefTargets = Collections.emptyMap();
    return;
  }
  final FeaturePackRuntimeBuilder ownFp = rt.layout.getFeaturePack(id.producer);
  Collection<FeatureReferenceSpec> refs = xmlSpec.getFeatureRefs();
  if (refs.size() == 1) {
    resolvedRefTargets = Collections.singletonMap(refs.iterator().next().getName(), resolveRefMapping(rt, ownFp, refs.iterator().next()));
    return;
  }
  final Map<String, ResolvedFeatureSpec> tmp = new HashMap<>(refs.size());
  for (FeatureReferenceSpec refSpec : refs) {
    tmp.put(refSpec.getName(), resolveRefMapping(rt, ownFp, refSpec));
  }
  this.resolvedRefTargets = Collections.unmodifiableMap(tmp);
}
origin: org.jboss.galleon/galleon-core

if (refSpec.hasMappedParams()) {
  for (Map.Entry<String, String> mapping : refSpec.getMappedParams().entrySet()) {
    final FeatureParameterSpec param = xmlSpec.getParam(mapping.getKey());
    if(!param.isFeatureId()) {
origin: org.jboss.galleon/galleon-core

public static FeatureReferenceSpec create(String str) throws ProvisioningDescriptionException {
  return create(str, str, false);
}
origin: org.jboss.galleon/galleon-core

public static FeatureReferenceSpec create(String name, String feature, boolean nillable) throws ProvisioningDescriptionException {
  return new FeatureReferenceSpec(null, name, feature, nillable, false, Collections.emptyMap());
}
org.jboss.galleon.specFeatureReferenceSpec

Most used methods

  • getFeature
  • <init>
  • builder
  • create
  • getMappedParams
  • getName
  • getOrigin
  • getParamsMapped
  • hasMappedParams
  • isInclude
  • isNillable
  • isNillable

Popular in Java

  • Making http post requests using okhttp
  • onRequestPermissionsResult (Fragment)
  • setContentView (Activity)
  • scheduleAtFixedRate (Timer)
  • Pointer (com.sun.jna)
    An abstraction for a native pointer data type. A Pointer instance represents, on the Java side, a na
  • Font (java.awt)
    The Font class represents fonts, which are used to render text in a visible way. A font provides the
  • SocketTimeoutException (java.net)
    This exception is thrown when a timeout expired on a socket read or accept operation.
  • Date (java.sql)
    A class which can consume and produce dates in SQL Date format. Dates are represented in SQL as yyyy
  • HashMap (java.util)
    HashMap is an implementation of Map. All optional operations are supported.All elements are permitte
  • TimeUnit (java.util.concurrent)
    A TimeUnit represents time durations at a given unit of granularity and provides utility methods to
  • Top plugins for Android Studio
Tabnine Logo
  • Products

    Search for Java codeSearch for JavaScript code
  • IDE Plugins

    IntelliJ IDEAWebStormVisual StudioAndroid StudioEclipseVisual Studio CodePyCharmSublime TextPhpStormVimGoLandRubyMineEmacsJupyter NotebookJupyter LabRiderDataGripAppCode
  • Company

    About UsContact UsCareers
  • Resources

    FAQBlogTabnine AcademyTerms of usePrivacy policyJava Code IndexJavascript Code Index
Get Tabnine for your IDE now