Package org.dom4j

Examples of org.dom4j.Node.valueOf()


            final String importScript = n.valueOf("@script");
            final Task k = importTasks.get(importScript);
           
            // Figure out what the type/description should be...
            final Class<?> type = Class.forName(n.valueOf("name"));
            final String desc = n.valueOf("desc-name");

            if (k == null) {
                fail("There is no importTask defined for this entity:"
                        + "\n\tscriptLocation=" + importScript
                        + "\n\tentityDocument=" + et.getURL().toExternalForm());
View Full Code Here


    @Override
    public LDIFChangeRecord nextRecord() {
        if (entryIterator.hasNext()) {
            try {
                final Node entryNode = entryIterator.next();
                final String dn = entryNode.valueOf("@dn");
                final List<Attribute> attributes = new ArrayList<Attribute>();

                final List<Node> objectClassList = (List<Node>) objectClassXPath.selectNodes(entryNode);
                final String[] objectClasses = new String[objectClassList.size()];
                for (int j = 0; j < objectClasses.length; ++j) {
View Full Code Here

      reader.setEntityResolver(new LocalEntityResolver());
      Document root = reader.read(getClass().getResource(path));
          List<?> nodes = root.selectNodes("/generators/generator");
          for(Object nodeObj : nodes) {
            Node node = (Node)nodeObj;
            configs.put(node.valueOf("@id").toLowerCase(), Config.createConfig(node));
          }
    }
   
    public Config newInstance(String id) {
      return configs.get(id.toLowerCase());
View Full Code Here

      throw new Config.ConfigException("unsupported generator type!");
    }
   
    Node route = generator.selectSingleNode("route");
    if(route != null) {
      String position = route.valueOf("@position");
      if("right".equals(position) || "".equals(position)) {
        config.setPositionRight(true);
      } else if("left".equals(position)) {
        config.setPositionRight(false);
      } else {
View Full Code Here

      } else if("left".equals(position)) {
        config.setPositionRight(false);
      } else {
        throw new Config.ConfigException();
      }
      String overFlowCheckStr = route.valueOf("@overflowcheck");
      if("on".equals(overFlowCheckStr) || "".equals(overFlowCheckStr)) {
        config.setOverFlowCheck(true);
      } else if("off".equals(overFlowCheckStr)) {
        config.setOverFlowCheck(false);
      } else {
View Full Code Here

      } else if("off".equals(overFlowCheckStr)) {
        config.setOverFlowCheck(false);
      } else {
        throw new Config.ConfigException();
      }
      String totalSizeStr = route.valueOf("@size");
      if (totalSizeStr != null && !"".equals(totalSizeStr)) {
        try {
          config.setTotalSize(Integer.parseInt(totalSizeStr));
        } catch (NumberFormatException e) {
          throw new Config.ConfigException();
View Full Code Here

      Node database = route.selectSingleNode("database");
      int routeSize = 0;
      if(database != null) {
        Route dbRoute = new Route();
        try {
          dbRoute.setSize(Integer.parseInt(database.valueOf("@size")));
          routeSize += dbRoute.getSize();
        } catch (NumberFormatException e) {
          throw new Config.ConfigException();
        }
        dbRoute.setExpression(ExpressionFactory.create(database.selectSingleNode("*")));
 
View Full Code Here

     
      Node table = route.selectSingleNode("table");
      if(table != null) {
        Route tableRoute = new Route();
        try {
          tableRoute.setSize(Integer.parseInt(table.valueOf("@size")));
          routeSize += tableRoute.getSize();
        } catch (NumberFormatException e) {
          throw new Config.ConfigException();
        }
        tableRoute.setExpression(ExpressionFactory.create(table.selectSingleNode("*")));
 
View Full Code Here

      for ( final Object node1 : nodes ) {

        final Node node = (Node) node1;
        final JSONObject json = new JSONObject();
        JSONArray children = null;
        String name = node.valueOf( "@name" );

        if ( parentPathArray.length > 0 ) {

          final String localizedName = node.valueOf( "@localized-name" );
          final String description = node.valueOf( "@description" );
View Full Code Here

        JSONArray children = null;
        String name = node.valueOf( "@name" );

        if ( parentPathArray.length > 0 ) {

          final String localizedName = node.valueOf( "@localized-name" );
          final String description = node.valueOf( "@description" );
          final boolean visible = node.valueOf( "@visible" ).equals( "true" );
          final boolean isDirectory = node.valueOf( "@isDirectory" ).equals( "true" );
          final String path = solutionName.length() == 0 ? "" : solutionPath + name;
          final String solution = solutionName.length() == 0 ? name : solutionName;
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.