Package com.codingcrayons.aspectfaces.exceptions

Examples of com.codingcrayons.aspectfaces.exceptions.ConfigurationParsingException


    try {
      properties.load(reader);
    } catch (IOException e) {
      // if happens then properties will be null
      LOGGER.error("Loading property file.", e);
      throw new ConfigurationParsingException("Loading property file.", e);
    }
  }
View Full Code Here


    SAXReader reader = new SAXReader();
    Document document;
    try {
      document = reader.read(in);
    } catch (DocumentException e) {
      throw new ConfigurationParsingException(e);
    }
    Element root = document.getRootElement();

    @SuppressWarnings("rawtypes")
    Iterator iterator = root.elementIterator();
View Full Code Here

      } else if (element.getName().equals("var")) {
        guards.add(this.parseVarGuards(element));
      } else if (element.getName().equals("condition")) {
        guards.add(this.parseConditionGuards(element));
      } else {
        throw new ConfigurationParsingException("Configuration error: " + element.getName() + " element is "
          + "not approved in element mapping!");
      }
    }

    if (types.isEmpty()) {
      throw new ConfigurationParsingException(
        "Configuration error: element type must be defined in element mapping at least once!");
    }
    if (tag == null) {
      throw new ConfigurationParsingException(
        "Configuration error: element default with attribute tag must be defined in element mapping!");
    }

    List<Mapping> mappings = new ArrayList<Mapping>();
View Full Code Here

      } else if (attribute.getName().equals("user-roles")) {
        userRoles = attribute.getValue().split("\\s");
      } else if (attribute.getName().equals("profiles")) {
        profiles = attribute.getValue().split("\\s");
      } else {
        throw new ConfigurationParsingException("Configuration error: " + attribute.getName() + " attribute "
          + "is not approved in var-guard element!");
      }
    }
    if (var == null) {
      throw new ConfigurationParsingException(
        "Configuration error: name attribute must be defined in element var!");
    }
    if (tagPath == null) {
      throw new ConfigurationParsingException(
        "Configuration error: tag attribute must be defined in element var!");
    }
    return new VarGuard(var, tagPath, profiles, userRoles);
  }
View Full Code Here

      } else if (attribute.getName().equals("user-roles")) {
        userRoles = attribute.getValue().split("\\s");
      } else if (attribute.getName().equals("profiles")) {
        profiles = attribute.getValue().split("\\s");
      } else {
        throw new ConfigurationParsingException("Configuration error: " + attribute.getName() + " attribute "
          + "is not approved in condition element!");
      }
    }
    if (expression == null) {
      throw new ConfigurationParsingException(
        "Configuration error: expression attribute must be defined in element condition!");
    }
    if (tagPath == null) {
      throw new ConfigurationParsingException(
        "Configuration error: tag attribute must be defined in element condition!");
    }
    return new ConditionGuard(expression, tagPath, profiles, userRoles);
  }
View Full Code Here

TOP

Related Classes of com.codingcrayons.aspectfaces.exceptions.ConfigurationParsingException

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.