private void addNamedFacetAndPluralFacetIfRequired() {
    NamedFacet namedFacet = getFacet(NamedFacet.class);
    if (namedFacet == null) {
      namedFacet = new NamedFacetInferred(NameUtils.naturalName(getShortIdentifier()), this);
      addFacet(namedFacet);
    }

    PluralFacet pluralFacet = getFacet(PluralFacet.class);
    if (pluralFacet == null) {
      pluralFacet = new PluralFacetInferred(NameUtils.pluralName(namedFacet.value()), this);
      addFacet(pluralFacet);
    }
  }
Exemplo n.º 2
0
  protected ObjectMemberAbstract(
      final FacetedMethod facetedMethod,
      final FeatureType featureType,
      final ObjectMemberContext objectMemberContext) {
    final String id = facetedMethod.getIdentifier().getMemberName();
    if (id == null) {
      throw new IllegalArgumentException("Name must always be set");
    }
    this.facetedMethod = facetedMethod;
    this.featureType = featureType;
    this.id = id;
    this.defaultName = NameUtils.naturalName(this.id);

    this.deploymentCategory = objectMemberContext.getDeploymentCategory();
    this.authenticationSessionProvider = objectMemberContext.getAuthenticationSessionProvider();
    this.specificationLookup = objectMemberContext.getSpecificationLookup();
    this.adapterManager = objectMemberContext.getAdapterManager();
    this.querySubmitter = objectMemberContext.getQuerySubmitter();
    this.collectionTypeRegistry = objectMemberContext.getCollectionTypeRegistry();
  }