Package org.apache.ws.jaxme.xs.jaxb

Examples of org.apache.ws.jaxme.xs.jaxb.JAXBGlobalBindings


  public JAXBJavaType[] getJAXBJavaTypes(SchemaSG pController) {
    XSSchema schema = getXSSchema();
    if (schema instanceof JAXBSchema) {
      JAXBSchema jaxbSchema = (JAXBSchema) schema;
      JAXBGlobalBindings globalBindings = jaxbSchema.getJAXBGlobalBindings();
      if (globalBindings != null) {
        return globalBindings.getJavaType();
      }
    }
    return new JAXBJavaType[0];
  }
View Full Code Here


  public XsQName[] getTypesafeEnumBase(SchemaSG pController) {
    XSSchema schema = getXSSchema();
    if (schema instanceof JAXBSchema) {
      JAXBSchema jaxbSchema = (JAXBSchema) schema;
      JAXBGlobalBindings globalBindings = jaxbSchema.getJAXBGlobalBindings();
      if (globalBindings != null) {
        return globalBindings.getTypesafeEnumBase();
      }
    }
    return new XsQName[]{XSNCName.getInstance().getName()};
  }
View Full Code Here

   
    JAXBParser parser = newJAXBParser();
    InputSource isource = new InputSource(new StringReader(schemaSource));
    isource.setSystemId("testGlobalBindingsDefaults.xsd");
    JAXBSchema schema = (JAXBSchema) parser.parse(isource);
    JAXBGlobalBindings globalBindings = schema.getJAXBGlobalBindings();
    String collectionType = globalBindings.getCollectionType();
    assertNull(collectionType);
    JAXBJavaType[] javaTypes = globalBindings.getJavaType();
    assertNotNull(javaTypes);
    assertEquals(0, javaTypes.length);
    XsQName[] typesafeEnumBase = globalBindings.getTypesafeEnumBase();
    assertNotNull(typesafeEnumBase);
    assertEquals(1, typesafeEnumBase.length);
    XsQName qName = typesafeEnumBase[0];
    assertEquals(XSNCName.getInstance().getName(), qName);
    boolean bindingStyleModelGroup = globalBindings.isBindingStyleModelGroup();
    assertTrue(!bindingStyleModelGroup);
    boolean choiceContentProperty = globalBindings.isChoiceContentProperty();
    assertTrue(!choiceContentProperty);
    boolean enableFailFastCheck = globalBindings.isEnableFailFastCheck();
    assertTrue(!enableFailFastCheck);
    boolean enableJavaNamingConventions = globalBindings.isEnableJavaNamingConventions();
    assertTrue(enableJavaNamingConventions);
    boolean fixedAttributeAsConstantProperty = globalBindings.isFixedAttributeAsConstantProperty();
    assertTrue(!fixedAttributeAsConstantProperty);
    boolean generateIsSetMethod = globalBindings.isGenerateIsSetMethod();
    assertTrue(!generateIsSetMethod);
    JAXBGlobalBindings.UnderscoreBinding underscoreBinding = globalBindings.getUnderscoreBinding();
    assertEquals(JAXBGlobalBindings.UnderscoreBinding.AS_WORD_SEPARATOR, underscoreBinding);
  }
View Full Code Here

   
    JAXBParser parser = newJAXBParser();
    InputSource isource = new InputSource(new StringReader(schemaSource));
    isource.setSystemId("testGlobalBindingsDefaults.xsd");
    JAXBSchema schema = (JAXBSchema) parser.parse(isource);
    JAXBGlobalBindings globalBindings = schema.getJAXBGlobalBindings();
    String collectionType = globalBindings.getCollectionType();
    assertEquals("java.util.ArrayList", collectionType);
 
    XsQName[] typesafeEnumBase = globalBindings.getTypesafeEnumBase();
    assertNotNull(typesafeEnumBase);
    assertEquals(2, typesafeEnumBase.length);
    XsQName qName = typesafeEnumBase[0];
    assertEquals(qName, XSString.getInstance().getName());
    qName = typesafeEnumBase[1];
    assertEquals(qName, XSNCName.getInstance().getName());
 
    boolean bindingStyleModelGroup = globalBindings.isBindingStyleModelGroup();
    assertTrue(bindingStyleModelGroup);
 
    boolean choiceContentProperty = globalBindings.isChoiceContentProperty();
    assertTrue(choiceContentProperty);
 
    boolean enableFailFastCheck = globalBindings.isEnableFailFastCheck();
    assertTrue(enableFailFastCheck);
 
    boolean enableJavaNamingConventions = globalBindings.isEnableJavaNamingConventions();
    assertTrue(!enableJavaNamingConventions);
 
    boolean fixedAttributeAsConstantProperty = globalBindings.isFixedAttributeAsConstantProperty();
    assertTrue(fixedAttributeAsConstantProperty);
 
    boolean generateIsSetMethod = globalBindings.isGenerateIsSetMethod();
    assertTrue(generateIsSetMethod);
 
    JAXBGlobalBindings.UnderscoreBinding underscoreBinding = globalBindings.getUnderscoreBinding();
    assertEquals(JAXBGlobalBindings.UnderscoreBinding.AS_CHAR_IN_WORD, underscoreBinding);
 
    JAXBJavaType[] javaTypes = globalBindings.getJavaType();
    assertNotNull(javaTypes);
    assertEquals(0, javaTypes.length);
  }
View Full Code Here

  public void validate() throws SAXException {
    if (isValidated()) {
      return;
    }
    super.validate();
    JAXBGlobalBindings gBindings = (JAXBGlobalBindings) XSUtil.getSingleAppinfo(getAnnotations(), JAXBGlobalBindings.class);
    globalBindings = gBindings == null ?
      ((JAXBXsObjectFactory) getXsESchema().getObjectFactory()).newJAXBGlobalBindings(getXsESchema()) : gBindings;
  }
View Full Code Here

  public String getCollectionType(SchemaSG pController) {
    XSSchema schema = getXSSchema();
    if (schema instanceof JAXBSchema) {
      JAXBSchema jaxbSchema = (JAXBSchema) schema;
      JAXBGlobalBindings globalBindings = jaxbSchema.getJAXBGlobalBindings();
      if (globalBindings != null) {
        String result = globalBindings.getCollectionType();
        if (result != null) {
          return result;
        }
      }
    }
View Full Code Here

  public boolean isBindingStyleModelGroup(SchemaSG pController) {
    XSSchema schema = getXSSchema();
    if (schema instanceof JAXBSchema) {
      JAXBSchema jaxbSchema = (JAXBSchema) schema;
      JAXBGlobalBindings globalBindings = jaxbSchema.getJAXBGlobalBindings();
      if (globalBindings != null) {
        return globalBindings.isBindingStyleModelGroup();
      }
    }
    return false;
  }
View Full Code Here

  public boolean isChoiceContentProperty(SchemaSG pController) {
    XSSchema schema = getXSSchema();
    if (schema instanceof JAXBSchema) {
      JAXBSchema jaxbSchema = (JAXBSchema) schema;
      JAXBGlobalBindings globalBindings = jaxbSchema.getJAXBGlobalBindings();
      if (globalBindings != null) {
        return globalBindings.isChoiceContentProperty();
      }
    }
    return false;
  }
View Full Code Here

  public boolean isFailFastCheckEnabled(SchemaSG pController) {
    XSSchema schema = getXSSchema();
    if (schema instanceof JAXBSchema) {
      JAXBSchema jaxbSchema = (JAXBSchema) schema;
      JAXBGlobalBindings globalBindings = jaxbSchema.getJAXBGlobalBindings();
      if (globalBindings != null) {
        return globalBindings.isEnableFailFastCheck();
      }
    }
    return false;
  }
View Full Code Here

  public boolean isJavaNamingConventionsEnabled(SchemaSG pController) {
    XSSchema schema = getXSSchema();
    if (schema instanceof JAXBSchema) {
      JAXBSchema jaxbSchema = (JAXBSchema) schema;
      JAXBGlobalBindings globalBindings = jaxbSchema.getJAXBGlobalBindings();
      if (globalBindings != null) {
        return globalBindings.isEnableJavaNamingConventions();
      }
    }
    return true;
  }
View Full Code Here

TOP

Related Classes of org.apache.ws.jaxme.xs.jaxb.JAXBGlobalBindings

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.