Examples of Named


Examples of net.sf.autodao.Named

    }
    if (Utils.getOffset(annotations) != null) {
      offsetCheck(type);
      processed = true;
    }
    final Named named = Utils.getNamed(annotations);
    if (processed) {
      if (named != null)
        throw new SpecificationViolationException("@Named cannot be present on @Limit/@Offset param", method);
    } else {
      if (named == null) {
        if (!names.isEmpty())
          throw new SpecificationViolationException("You're not allowed to mix @Named and indexed params", method);

        final int paramIndex = index + 1
            - (limit ? 1 : 0)
            - (offset ? 1 : 0);
        final Class<?> expectedType = getExpectedType(paramIndex);
        if (expectedType != null) {
          final Class<?> actualType = getActualParameterType(type, false);
          if (!expectedType.isAssignableFrom(actualType)) {
            final String msg = String.format("Indexed parameter '%s' of type %s cannot be assigned to query parameter of type %s", paramIndex, actualType.getName(), expectedType.getName());
            throw new SpecificationViolationException(msg, method);
          }
        }
        indexed++;
      } else {
        if (indexed > 0)
          throw new SpecificationViolationException("You're not allowed to mix @Named and indexed params", method);

        final String name = named.value();
        final Class<?> expectedType = getExpectedType(name);
        if (expectedType != null) {
          final Class<?> actualClass = getActualParameterType(type, true);
          if (!Collection.class.isAssignableFrom(actualClass) && !expectedType.isAssignableFrom(actualClass)) {
            final String msg = String.format("Named parameter '%s' of type %s cannot be assigned to query parameter of type %s", name, actualClass.getName(), expectedType.getName());
View Full Code Here

Examples of org.apache.isis.applib.annotation.Named

    @Override
    public void processParams(final ProcessParameterContext processParameterContext) {
        final Annotation[] parameterAnnotations = Annotations.getParameterAnnotations(processParameterContext.getMethod())[processParameterContext.getParamNum()];
        for (final Annotation parameterAnnotation : parameterAnnotations) {
            if (parameterAnnotation instanceof Named) {
                final Named annotation = (Named) parameterAnnotation;
                FacetUtil.addFacet(create(annotation, processParameterContext.getFacetHolder()));
                return;
            }
        }
    }
View Full Code Here

Examples of org.apache.isis.applib.annotation.Named

        super(FeatureType.OBJECTS_ONLY);
    }

    @Override
    public void process(final ProcessClassContext processClassContaxt) {
        final Named annotation = Annotations.getAnnotation(processClassContaxt.getCls(), Named.class);
        FacetUtil.addFacet(create(annotation, processClassContaxt.getFacetHolder()));
    }
View Full Code Here

Examples of org.apache.isis.applib.annotation.Named

        final Properties properties = pcwmp.metadataProperties("named");
        return properties != null ? new NamedFacetOnMemberFromProperties(properties, holder) : null;
    }

    private static NamedFacet createFromAnnotationIfPossible(final ProcessMethodContext processMethodContext) {
        final Named annotation = Annotations.getAnnotation(processMethodContext.getMethod(), Named.class);
        return annotation != null ? new NamedFacetOnMemberAnnotation(annotation.value(), processMethodContext.getFacetHolder()) : null;
    }
View Full Code Here

Examples of org.apache.isis.applib.annotation.Named

        final Properties properties = pcwmp.metadataProperties("named");
        return properties != null ? new NamedFacetOnMemberFromProperties(properties, holder) : null;
    }

    private static NamedFacet createFromAnnotationIfPossible(final ProcessMethodContext processMethodContext) {
        final Named annotation = Annotations.getAnnotation(processMethodContext.getMethod(), Named.class);
        return annotation != null ? new NamedFacetOnMemberAnnotation(annotation.value(), processMethodContext.getFacetHolder()) : null;
    }
View Full Code Here

Examples of org.apache.isis.applib.annotation.Named

        super(FeatureType.OBJECTS_ONLY);
    }

    @Override
    public void process(final ProcessClassContext processClassContaxt) {
        final Named annotation = Annotations.getAnnotation(processClassContaxt.getCls(), Named.class);
        FacetUtil.addFacet(create(annotation, processClassContaxt.getFacetHolder()));
    }
View Full Code Here

Examples of org.apache.isis.applib.annotation.Named

    @Override
    public void processParams(final ProcessParameterContext processParameterContext) {
        final Annotation[] parameterAnnotations = Annotations.getParameterAnnotations(processParameterContext.getMethod())[processParameterContext.getParamNum()];
        for (final Annotation parameterAnnotation : parameterAnnotations) {
            if (parameterAnnotation instanceof Named) {
                final Named annotation = (Named) parameterAnnotation;
                FacetUtil.addFacet(create(annotation, processParameterContext.getFacetHolder()));
                return;
            }
        }
    }
View Full Code Here

Examples of org.glassfish.api.admin.config.Named

        return null;
    }

    public String getNameForConfigBean(Object configBean, Class configBeanType) throws InvocationTargetException, IllegalAccessException {
        if (configBean instanceof Named) {
            Named nme = (Named) configBean;
            return nme.getName();
        }
        if (configBean instanceof Resource) {
            Resource res = (Resource) configBean;
            return res.getIdentity();
        }
View Full Code Here

Examples of org.grouplens.common.dto.Dto.Named

    private class DtoContainerSerializer implements JsonSerializer<DtoContainer<?>>, JsonDeserializer<DtoContainer<?>> {
        private final ConcurrentMap<String, Class<? extends Dto>> singleDtoMap = new ConcurrentHashMap<String, Class<? extends Dto>>();
        private final ConcurrentMap<String, Class<? extends Dto>> pluralDtoMap = new ConcurrentHashMap<String, Class<? extends Dto>>();
       
        public void registerType(Class<? extends Dto> type) {
            Named typeName = type.getAnnotation(Named.class);
            String single = getDtoSingularName(type, typeName);
            String plural = getDtoPluralName(single, typeName);
           
            // in the event that registerType is called simultaneously with
            // the same type, we're still okay since getDtoXName() will return
View Full Code Here

Examples of org.richfaces.model.entity.Named

      assertNull(stackingTreeModel.getTreeNode());
      Object rowData = stackingTreeModel.getRowData();
      assertNotNull(rowData);
      assertTrue(rowData instanceof Named);

      Named named = (Named) rowData;

      int currentTag = named.getTag();
      assertTrue(currentTag > tag);
      this.tag = currentTag;

      if (this.tag % 10 == 1) {
        assertTrue(last);
      } else {
        assertFalse(last);
      }

      if (named instanceof Directory) {
        if ("ADir1".equals(named.getName())) {
          assertFalse(stackingTreeModel.isLeaf());
        } else {
          assertTrue(stackingTreeModel.isLeaf());
        }
      } else if (named instanceof Project) {
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.