Package org.dom4j

Examples of org.dom4j.Element.attribute()


                    {
                        serverConfiguration.setSaslPrincipal( saslPrincipalAttribute.getValue() );
                    }

                    // SearchBaseDn
                    org.dom4j.Attribute searchBaseDnAttribute = ldapServerElement
                        .attribute( ServerXmlIOV152.ATTRIBUTE_SEARCH_BASE_DN );
                    if ( searchBaseDnAttribute == null )
                    {
                        // If the 'searchBaseDn' attribute does not exists,
                        // we throw an exception
View Full Code Here


                    {
                        serverConfiguration.setSearchBaseDn( searchBaseDnAttribute.getValue() );
                    }

                    // MaxTimeLimit
                    org.dom4j.Attribute maxTimeLimitAttribute = ldapServerElement
                        .attribute( ServerXmlIOV152.ATTRIBUTE_MAX_TIME_LIMIT );
                    if ( maxTimeLimitAttribute == null )
                    {
                        // If the 'maxTimeLimit' attribute does not exists,
                        // we throw an exception
View Full Code Here

                    {
                        serverConfiguration.setMaxTimeLimit( Integer.parseInt( maxTimeLimitAttribute.getValue() ) );
                    }

                    // MaxSizeLimit
                    org.dom4j.Attribute maxSizeLimitAttribute = ldapServerElement
                        .attribute( ServerXmlIOV152.ATTRIBUTE_MAX_SIZE_LIMIT );
                    if ( maxSizeLimitAttribute == null )
                    {
                        // If the 'maxSizeLimit' attribute does not exists,
                        // we throw an exception
View Full Code Here

        // Getting the 'apacheDS' element
        Element apacheDsElement = element.element( ServerXmlIOV152.ELEMENT_APACHE_DS );
        if ( apacheDsElement != null )
        {
            // SynchPeriodMillis
            org.dom4j.Attribute synchPeriodMillisAttribute = apacheDsElement
                .attribute( ServerXmlIOV152.ATTRIBUTE_SYNCH_PERIOD_MILLIS );
            if ( synchPeriodMillisAttribute == null )
            {
                // If the 'synchPeriodMillis' attribute does not exists,
                // we throw an exception
View Full Code Here

  private Inheritance getInheritance(Element tree, XMLContext.Default defaults) {
    Element element = tree != null ? tree.element( "inheritance" ) : null;
    if ( element != null ) {
      AnnotationDescriptor ad = new AnnotationDescriptor( Inheritance.class );
      Attribute attr = element.attribute( "strategy" );
      InheritanceType strategy = InheritanceType.SINGLE_TABLE;
      if ( attr != null ) {
        String value = attr.getValue();
        if ( "SINGLE_TABLE".equals( value ) ) {
          strategy = InheritanceType.SINGLE_TABLE;
View Full Code Here

  }

  private IdClass getIdClass(Element tree, XMLContext.Default defaults) {
    Element element = tree == null ? null : tree.element( "id-class" );
    if ( element != null ) {
      Attribute attr = element.attribute( "class" );
      if ( attr != null ) {
        AnnotationDescriptor ad = new AnnotationDescriptor( IdClass.class );
        Class clazz;
        try {
          clazz = ReflectHelper.classForName(
View Full Code Here

      if ( "mapping".equals( subelementName ) ) {
        parseMappingElement( subelement, name );
      }
      else if ( "class-cache".equals( subelementName ) ) {
        String className = subelement.attributeValue( "class" );
        Attribute regionNode = subelement.attribute( "region" );
        final String region = ( regionNode == null ) ? className : regionNode.getValue();
        boolean includeLazy = !"non-lazy".equals( subelement.attributeValue( "include" ) );
        setCacheConcurrencyStrategy( className, subelement.attributeValue( "usage" ), region, includeLazy );
      }
      else if ( "collection-cache".equals( subelementName ) ) {
View Full Code Here

        boolean includeLazy = !"non-lazy".equals( subelement.attributeValue( "include" ) );
        setCacheConcurrencyStrategy( className, subelement.attributeValue( "usage" ), region, includeLazy );
      }
      else if ( "collection-cache".equals( subelementName ) ) {
        String role = subelement.attributeValue( "collection" );
        Attribute regionNode = subelement.attribute( "region" );
        final String region = ( regionNode == null ) ? role : regionNode.getValue();
        setCollectionCacheConcurrencyStrategy( role, subelement.attributeValue( "usage" ), region );
      }
    }
  }
View Full Code Here

    }

    public void add(XmlDocument metadataXml) {
      final Document document = metadataXml.getDocumentTree();
      final Element hmNode = document.getRootElement();
      Attribute packNode = hmNode.attribute( "package" );
      String defaultPackage = packNode != null ? packNode.getValue() : "";
      Set<String> entityNames = new HashSet<String>();
      findClassNames( defaultPackage, hmNode, entityNames );
      for ( String entity : entityNames ) {
        hbmMetadataByEntityNameXRef.put( entity, metadataXml );
View Full Code Here

      Iterator classIterator = new JoinedIterator( classes );
      while ( classIterator.hasNext() ) {
        Element element = ( Element ) classIterator.next();
        String entityName = element.attributeValue( "entity-name" );
        if ( entityName == null ) {
          entityName = getClassName( element.attribute( "name" ), defaultPackage );
        }
        names.add( entityName );
        findClassNames( defaultPackage, element, names );
      }
    }
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.