Package net.sf.toxicity

Examples of net.sf.toxicity.XPathRef


        // get all fields of the parent class
        Class clazz = this.getClass();
        Field[] fields = clazz.getFields();
        for(Field f : fields) {
            // get the xpath value provided through the annotation
            XPathRef bind = f.getAnnotation(XPathRef.class);
            if(bind == null) continue;
           
            // skip if value is already set
            try {
                if(f.get(this) != null) continue;
            } catch (IllegalAccessException e) {
                log.error(e.getMessage(), e);
                ret = false;
            }
           
            String expr = bind.xpath();
            String cond = bind.condition();
            boolean optional = bind.optional();
           
            try {
                // make ns available
                if(!bind.nsUri().equals("")) {
                    NamespaceContext nsContext = new NamespaceContext();
                    nsContext.addPrefix(bind.nsUri(), bind.nsPrefix());
                    xpath.setNamespaceContext(nsContext);
                }
               
                // check if condition applies before evaluation xpath
                if(!cond.equals("")) {
View Full Code Here

TOP

Related Classes of net.sf.toxicity.XPathRef

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.