Package org.vfny.geoserver.global.xml

Examples of org.vfny.geoserver.global.xml.NameSpaceElement


        minOccurs = 1;
        maxOccurs = 1;

  NameSpaceTranslatorFactory nsFactory = NameSpaceTranslatorFactory.getInstance();
        NameSpaceTranslator nst = nsFactory.getNameSpaceTranslator("xs");
        NameSpaceElement nse = nst.getElement(name);
  if (nse == null) {
      nse = nst.getDefaultElement(attributeType.getType());
  }
        if (nse == null) {
      nst = nsFactory.getNameSpaceTranslator("gml");
      nse = nst.getElement(name);
      if (nse == null) {
    nse = nst.getDefaultElement(attributeType.getType());
      }
  }
     
  //System.out.println("creating new atypininfig for: " + attributeType +
  //       ", nse = " + nse);
  //if (nse != null) System.out.println(", nse type = " + nse.getTypeDefName());
  fragment = "<!-- definition for " + attributeType.getType()
      + " -->";
        if (nse == null) {
            type = TYPE_FRAGMENT;
        } else {
            type = nse.getTypeDefName();
            fragment = "";
        }
    }
View Full Code Here


     */
    public List getTypes() {
      List elements = DataTransferObjectFactory.getElements(name, attributeType.getType());
        List list = new ArrayList( elements.size() );
        for( Iterator i=elements.iterator(); i.hasNext(); ){
            NameSpaceElement element = (NameSpaceElement) i.next();

            if (!element.isAbstract()) {
              list.add( element.getTypeDefName() );
            }
        }
        list.add( AttributeTypeInfoConfig.TYPE_FRAGMENT );
        return list;
    }
View Full Code Here

        dto.setMinOccurs( isManditory(schemaBase, attributeType.getName() ) ? 1: 0 );
        dto.setMaxOccurs( 1 );
        dto.setNillable( attributeType.isNillable() );
        NameSpaceTranslator xs = NameSpaceTranslatorFactory.getInstance().getNameSpaceTranslator("xs");       
        NameSpaceTranslator gml = NameSpaceTranslatorFactory.getInstance().getNameSpaceTranslator("gml");
        NameSpaceElement element;
       
        element = xs.getElement( attributeType.getType(), attributeType.getName() );               
        if(element == null) element = gml.getElement( attributeType.getType(), attributeType.getName() );
        if(element == null) element = xs.getElement( "string" );
       
//    element = xs.getElement( attributeType.getName() );               
//    if(element == null) element = gml.getElement( attributeType.getName() );
//    if(element == null) element = xs.getElement( "string" );
               
        dto.setComplex(false);
        dto.setType( element.getTypeRefName() );
        return dto;
    }
View Full Code Here

        dto.setMaxOccurs( 1 );
        dto.setNillable( true ); // nillable by default?
       
        NameSpaceTranslator xs = NameSpaceTranslatorFactory.getInstance().getNameSpaceTranslator("xs");       
        NameSpaceTranslator gml = NameSpaceTranslatorFactory.getInstance().getNameSpaceTranslator("gml");
        NameSpaceElement element;
       
        element = xs.getElement( attributeName );               
        if(element == null) element = gml.getElement( attributeName );
        if(element == null) element = xs.getElement( "string" );
               
        dto.setComplex(false);
        dto.setType( element.getTypeRefName() );
        return dto;       
    }
View Full Code Here

      s.addAll(xs.getAssociatedTypes(name));
      s.addAll(gml.getAssociatedTypes(type));
      s.addAll(gml.getAssociatedTypes(name));
      Iterator i = s.iterator();
      while(i.hasNext()){
          NameSpaceElement element = (NameSpaceElement)i.next();
          if(name.equals(element.getTypeDefName()))
            if(!result.contains(element)){
              result.add(element);
            }
          else
            if(name.equals(element.getTypeRefName()))
            if(!result.contains(element)){
              result.add(element);
            }
          else
            if(name.equals(element.getQualifiedTypeDefName()))
            if(!result.contains(element)){
              result.add(element);
            }
          else
            if(name.equals(element.getQualifiedTypeRefName()))
            if(!result.contains(element)){
              result.add(element);
            }
      }
     
      if(!Object.class.equals(type)){
        Class cls = type;
        while(!Object.class.equals(cls)){
          i = s.iterator();
          while(i.hasNext()){
            NameSpaceElement element = (NameSpaceElement)i.next();
            //   add the rest afterwards
            if(element.getJavaClass().equals(cls) && !result.contains(element)){
              result.add(element);
            }
          }
          cls = cls.getSuperclass();
        }
      }
     
    i = s.iterator();
    while(i.hasNext()){
      NameSpaceElement element = (NameSpaceElement)i.next();
      //   add the rest afterwards
      if(!result.contains(element)){
        result.add(element);
      }
    }
     
      NameSpaceElement element = xs.getElement("string");
      if(!result.contains(element)) result.add(element);
     
        return result;
    }
View Full Code Here

        assertEquals(expected, String.valueOf(value));
    }

    public void testPointPropertyTypeMappings() {
        Set expected = new HashSet();
        NameSpaceElement nse = null;
        nse = gml.getElement("PointPropertyType");
System.out.println("Expected PointPropertyType : "+nse.getTypeDefName());
        expected.add( nse );
        nse = gml.getElement("PointType");
System.out.println("Expected PointType : "+nse.getTypeDefName());
        expected.add( nse );
        nse = gml.getElement("GeometryPropertyType");
System.out.println("Expected GeometryPropertyType : "+nse.getTypeDefName());
    expected.add( nse );
    nse = gml.getElement("AbstractGeometryType");
    System.out.println("Expected AbstractGeometryType : "+nse.getTypeDefName());
        expected.add( nse );
        nse = xs.getElement("string");
System.out.println("Expected string : "+nse.getTypeDefName());
        expected.add( nse );

        List mappings = DataTransferObjectFactory.getElements("pointProperty", Point.class);
Iterator i = mappings.iterator();
while(i.hasNext()){
View Full Code Here

TOP

Related Classes of org.vfny.geoserver.global.xml.NameSpaceElement

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.