Package java.lang.annotation

Examples of java.lang.annotation.Annotation


        return false;
    }

    private Annotation getAnnotation(Class type, AbstractMemberMetaData ammd, Member member, Locatable loc)
    {
        Annotation annotation = getAnnotationHandler(type, ammd);
        if (annotation != null)
        {
            return annotation;
        }
        annotation = ((AnnotatedElement)member).getAnnotation(type);
View Full Code Here


        try {
          clazz = (Class<? extends Annotation>) Class.forName(clazzName);
        } catch (ClassNotFoundException e1) {
          throw new JibeRuntimeException("Annotation class could not be found: " + clazzName);
        }
        Annotation annotation = method.getAnnotation(clazz);
        if (annotation != null) {
          String id = null;
          try {
            id = (String) annotation.getClass().getMethod("value").invoke(annotation);
          } catch (Exception e) {
            throw new JibeRuntimeException("Annotation does not have value property: "
                + annotation.annotationType().getName());
          }

          if (StringUtils.isEmpty(id)) {
            id = String.format("%1$s.%2$s", beanName, method.getName());
          }
View Full Code Here

          autoBinding = true;
          if (f.getAnnotation(OAccess.class) == null || f.getAnnotation(OAccess.class).value() == OAccess.OAccessType.PROPERTY)
            autoBinding = true;
          // JPA 2+ AVAILABLE?
          else if (jpaAccessClass != null) {
            Annotation ann = f.getAnnotation(jpaAccessClass);
            if (ann != null) {
              // TODO: CHECK IF CONTAINS VALUE=FIELD
              autoBinding = true;
            }
          }
View Full Code Here

          member.getAnnotation(XmlTransient.class) != null) {
        it.remove();
        continue;
      }
     
      Annotation attribute = member.getAnnotation(atype);
     
      switch (xat) {
        case PUBLIC_MEMBER:
          if (!Modifier.isPublic( member.getJavaMember().getModifiers() )) it.remove();
          break;
View Full Code Here

    if (getInstanceClass() == null)
      throw new ConfigException(L.l("ejb-stateful-bean requires a 'class' attribute"));

    final String name = getName();

    Annotation statefulAnn = new Stateful() {
        public Class annotationType() { return Stateful.class; }
        public String name() { return name; }
        public String mappedName() { return name; }
        public String description() { return ""; }
    };
View Full Code Here

    if (getInstanceClass() == null)
      throw new ConfigException(L.l("ejb-stateless-bean requires a 'class' attribute"));

    final String name = getName();

    Annotation ann = new Stateless() {
        public Class annotationType() { return Stateless.class; }
        public String name() { return name; }
        public String mappedName() { return name; }
        public String description() { return ""; }
    };
View Full Code Here

   * Returns true for embeddable type.
   */
  public boolean isEmbeddable(Class type)
  {
    getInternalEmbeddableConfig(type, _annotationCfg);
    Annotation embeddableAnn = _annotationCfg.getAnnotation();
    EmbeddableConfig embeddableConfig = _annotationCfg.getEmbeddableConfig();

    return (! _annotationCfg.isNull());
  }
View Full Code Here

   */
  public EmbeddableType introspect(Class type)
    throws ConfigException, SQLException
  {
    getInternalEmbeddableConfig(type, _annotationCfg);
    Annotation embeddableAnn = _annotationCfg.getAnnotation();
    EmbeddableConfig embeddableConfig = _annotationCfg.getEmbeddableConfig();

    String typeName = type.getName();

    EmbeddableType embeddableType = _embeddableMap.get(typeName);

    if (embeddableType != null)
      return embeddableType;

    try {
      embeddableType = _persistenceUnit.createEmbeddable(typeName, type);
      _embeddableMap.put(typeName, embeddableType);

      boolean isField = isField(type, embeddableConfig);

      if (isField)
        embeddableType.setFieldAccess(true);

      // XXX: jpa/0u21
      Annotation ann = type.getAnnotation(javax.persistence.Embeddable.class);

      if (ann == null) {
        isField = true;
        embeddableType.setIdClass(true);
        _persistenceUnit.getAmberContainer().addEmbeddable(typeName,
View Full Code Here

  boolean isField(Class type,
                  AbstractEnhancedConfig typeConfig)
    throws ConfigException
  {
    for (Method method : type.getDeclaredMethods()) {
      Annotation ann[] = method.getDeclaredAnnotations();

      for (int i = 0; ann != null && i < ann.length; i++) {
        if (isPropertyAnnotation(ann[i]))
          return false;
      }
View Full Code Here

  private void configureXA(AnnotatedMethod<?> apiMethod)
  {
    if (_transactionType == null)
      return;

    Annotation ann = new TransactionAttribute() {
        public Class annotationType() { return TransactionAttribute.class; }
        public TransactionAttributeType value() { return _transactionType; }
      };

    ((AnnotatedMethodImpl<?>) apiMethod).addAnnotation(ann);
View Full Code Here

TOP

Related Classes of java.lang.annotation.Annotation

Copyright © 2018 www.massapicom. 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.