Examples of RetentionPolicy


Examples of java.lang.annotation.RetentionPolicy

    {
        for(Annotation ann : annotations)
        {
            //This is added, because TCK Event tests for this.
            Retention retention = ann.annotationType().getAnnotation(Retention.class);
            RetentionPolicy policy = retention.value();
            if(!policy.equals(RetentionPolicy.RUNTIME))
            {
                throw new IllegalArgumentException("Event qualifiere RetentionPolicy must be RUNTIME for qualifier : " + ann);
            }
            ///////////////////////////////////////////////////////
View Full Code Here

Examples of java.lang.annotation.RetentionPolicy

 
  public boolean isAnnotationWithRuntimeRetention() {
    if (!isAnnotation()) return false;
    if (getBaseClass().isAnnotationPresent(Retention.class)) {
      Retention retention = (Retention) getBaseClass().getAnnotation(Retention.class);
      RetentionPolicy policy = retention.value();
      return policy == RetentionPolicy.RUNTIME;
    } else {
      return false;
    }
  }
View Full Code Here

Examples of java.lang.annotation.RetentionPolicy

        if (clazz == Retention.class) {
            Expression exp = definition.getMember("value");
            if (!(exp instanceof PropertyExpression)) return;
            PropertyExpression pe = (PropertyExpression) exp;
            String name = pe.getPropertyAsString();
            RetentionPolicy policy = RetentionPolicy.valueOf(name);
            setRetentionPolicy(policy, root);
        } else if (clazz == Target.class) {
            Expression exp = definition.getMember("value");
            if (!(exp instanceof ListExpression)) return;
            ListExpression le = (ListExpression) exp;
View Full Code Here

Examples of java.lang.annotation.RetentionPolicy

    private void configureAnnotation(AnnotationNode node, Annotation annotation) {
        Class type = annotation.annotationType();
        if (type == Retention.class) {
            Retention r = (Retention) annotation;
            RetentionPolicy value = r.value();
            setRetentionPolicy(value, node);
            node.setMember("value", new PropertyExpression(
                    new ClassExpression(ClassHelper.makeWithoutCaching(RetentionPolicy.class, false)),
                    value.toString()));
        } else if (type == Target.class) {
            Target t = (Target) annotation;
            ElementType[] elements = t.value();
            ListExpression elementExprs = new ListExpression();
            for (ElementType element : elements) {
View Full Code Here

Examples of javax.jcr.retention.RetentionPolicy

    /**
     * Creates a node with a RetentionPolicy
     */
    private  void addRetentionTestData(Node node) throws RepositoryException {
        RetentionPolicy rp = RetentionPolicyImpl.createRetentionPolicy("testRetentionPolicy", node.getSession());
        node.getSession().getRetentionManager().setRetentionPolicy(node.getPath(), rp);
    }
View Full Code Here

Examples of javax.jcr.retention.RetentionPolicy

        }
    }

    private void addRetentionPolicy(Path nodePath, PropertyImpl p) throws RepositoryException {
        synchronized (retentionMap) {
            RetentionPolicy rp = new RetentionPolicyImpl(p.getString(), ((PropertyId) p.getId()).getParentId(), session);
            retentionMap.put(nodePath, rp);
            retentionCnt++;
        }
    }
View Full Code Here

Examples of javax.jcr.retention.RetentionPolicy

            throw new IllegalStateException("Not initialized.");
        }
        if (retentionCnt <= 0) {
            return false;
        }
        RetentionPolicy rp = null;
        PathMap.Element element = retentionMap.map(nodePath, true);
        if (element != null) {
            rp = (RetentionPolicy) element.get();
        }
        if (rp == null && checkParent) {
View Full Code Here

Examples of javax.jcr.retention.RetentionPolicy

            for (NodeIterator children = testRootNode.getNodes(); children.hasNext();) {
                Node child = children.nextNode();

                // Remove retention policy if needed
                if (rm != null) {
                    RetentionPolicy pol = rm.getRetentionPolicy(child.getPath());
                    if (pol != null) {
                        rm.removeRetentionPolicy(child.getPath());
                        s.save();
                    }
                }
View Full Code Here

Examples of javax.jcr.retention.RetentionPolicy

    /**
     * Creates a node with a RetentionPolicy
     */
    private void addRetentionTestData(Node node) throws RepositoryException {
        RetentionPolicy rp = RetentionPolicyImpl.createRetentionPolicy("testRetentionPolicy", node.getSession());
        node.getSession().getRetentionManager().setRetentionPolicy(node.getPath(), rp);
    }
View Full Code Here

Examples of javax.jcr.retention.RetentionPolicy

            for (NodeIterator children = testRootNode.getNodes(); children.hasNext();) {
                Node child = children.nextNode();

                // Remove retention policy if needed
                if (rm != null) {
                    RetentionPolicy pol = rm.getRetentionPolicy(child.getPath());
                    if (pol != null) {
                        rm.removeRetentionPolicy(child.getPath());
                        s.save();
                    }
                }
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.