Package org.apache.ws.jaxme.js

Examples of org.apache.ws.jaxme.js.JavaQName


    }
  }

  public JavaMethod getXMLGetMethod(TypeSG pController, JavaSource pSource,
                    String pFieldName, String pMethodName) throws SAXException {
    JavaQName runtimeType;
    if (pController.isComplex() && pFieldName.equals("value") && pController.getComplexTypeSG().hasSimpleContent()) {
      SimpleContentSG obj = pController.getComplexTypeSG().getSimpleContentSG();
      runtimeType = obj.getContentTypeSG().getRuntimeType();
      if (pController.isRestriction()) {
        if (pController.getRestrictedType().isExtension()) {
View Full Code Here


                                  String pFieldName, String pParamName,
                                  String pMethodName,
                                    boolean pSetIsSet) throws SAXException {
    if (pController.isComplex()) {
      JavaMethod jm = pSource.newJavaMethod(pMethodName, JavaQNameImpl.VOID, JavaSource.PUBLIC);
      JavaQName runtimeType;
      if (pFieldName.equals("value") && pController.getComplexTypeSG().hasSimpleContent()) {
        SimpleContentSG obj = pController.getComplexTypeSG().getSimpleContentSG();
        runtimeType = obj.getContentTypeSG().getRuntimeType();
        if (pController.isRestriction()) {
          if (pController.getRestrictedType().isExtension()) {
View Full Code Here

  private SimpleTypeSGChain newSimpleTypeSGByJavaType(JAXBJavaType pJavaType,
                                                    SGFactory pFactory,
                                                      SchemaSG pSchema,
                                                      XSType pType)
      throws SAXException {
    JavaQName qName = JavaQNameImpl.getInstance(pJavaType.getName(), true);
    if (BooleanSG.BOOLEAN_TYPE.equals(qName)) {
      return new BooleanSG(pFactory, pSchema, pType);
    } else if (BooleanSG.BOOLEAN_OBJECT_TYPE.equals(qName)) {
      BooleanSG result = new BooleanSG(pFactory, pSchema, pType);
        result.setNullable(true);
View Full Code Here

                XsQName qName = pType.isGlobal() ? pType.getName() : pController.getName();
                className = AbstractContext.getClassNameFromLocalName(pController.getLocator(),
                        qName.getLocalName(),
                        pSchema) + "Class";
            }
            JavaQName qName;
            if (classContext == null) {
                String packageName = AbstractContext.getPackageName(pSchema,
                        jaxbSchemaBindings,
                        pController.getLocator(),
                        pController.getName());
                qName = JavaQNameImpl.getInstance(packageName, className);
            } else {
                JavaQName elementClassName = classContext.getXMLInterfaceName();
                if (elementClassName == null) {
                    elementClassName = classContext.getXMLImplementationName();
                }
                qName = JavaQNameImpl.getInstance(elementClassName.getPackageName(), className);
            }
            result = new EnumerationSG(result, qName, pType);
        }
    }
   
View Full Code Here

    JAXBJavaType javaType = findJavaType(pSchema, pType);
    SimpleTypeSGChain result;
    if (javaType == null  ||  javaType.getName() == null) {
        XSSimpleType simpleType = pType.getSimpleType();
        JavaQName runtimeType;
        if (simpleType.isAtomic()) {
          result = newGlobalAtomicTypeSG(pFactory, pSchema, pType);
            if (result == null) {
                if (!simpleType.isRestriction()) {
                    throw new SAXParseException("Atomic type must be either a builtin or a restriction of another atomic type",
                                                pType.getLocator());
                }
                TypeSG type = pSchema.getType(simpleType.getRestrictedType().getName());
                runtimeType = type.getSimpleTypeSG().getRuntimeType();
                result = newAtomicTypeRestriction(pController, pFactory, pSchema, pType);
            } else {
                SimpleTypeSG simpleTypeSG = new SimpleTypeSGImpl(result);
                simpleTypeSG.init();
              runtimeType = simpleTypeSG.getRuntimeType();
            }
            if (javaType == null) {
                JAXBJavaType[] globalJavaTypes = pSchema.getJAXBJavaTypes();
                for (int i = 0;  i < globalJavaTypes.length;  i++) {
                  if (runtimeType.equals(globalJavaTypes[i].getName())) {
                        javaType = globalJavaTypes[i];
                        break;
                    }
                }
            }
View Full Code Here

    }

    private void addCall(SimpleTypeSG pController, List pList, String pMethod,
                         JavaQName pType) {
        int offset = pMethod.indexOf('.');
        JavaQName qName;
        String method;
        if (offset == -1) {
            qName = getType(pController);
            method = pMethod;
        } else {
View Full Code Here

    }

    private TypedValue getParseCall(SimpleTypeSG pController, JavaMethod pMethod,
                                Object pValue, Object pData)
            throws SAXParseException {
        JavaQName type = getType(pController);
        DirectAccessible value = getValue(pMethod, pValue, JavaQNameImpl.getInstance(String.class));

        String parseMethod = javaType.getParseMethod().trim();
        List list = new ArrayList();
        if (parseMethod.startsWith("new")
            &&  parseMethod.length() > 3
            &&  Character.isWhitespace(parseMethod.charAt(3))) {
          JavaQName qName = JavaQNameImpl.getInstance(parseMethod.substring(3).trim(), true);
            list.add("new ");
            list.add(qName);
        } else {
            addCall(pController, list, parseMethod, type);
        }
View Full Code Here

    return new TypedValueImpl(list, type);
    }

    private TypedValue getPrintCall(SimpleTypeSG pController, JavaMethod pMethod,
                                Object pValue, Object pData) {
      JavaQName type = getType(pController);
        LocalJavaField f = pMethod.newJavaField(String.class);
        DirectAccessible value = getValue(pMethod, pValue, type);
        List list = new ArrayList();
        addCall(pController, list, javaType.getPrintMethod(), type);
        addValues(list, value, pData);
View Full Code Here

  public JavaField getXMLField(TypeSG pController, JavaSource pSource,
                                 String pFieldName, String pDefaultValue) throws SAXException {
    if (pSource.isInterface()) {
      return null;
    } else {
      JavaQName runtimeType;
      if (pController.isComplex() && pFieldName.equals("value") && pController.getComplexTypeSG().hasSimpleContent()) {
        SimpleContentSG obj = pController.getComplexTypeSG().getSimpleContentSG();
        runtimeType = obj.getContentTypeSG().getRuntimeType();
        if (pController.isRestriction()) {
          if (pController.getRestrictedType().isExtension()) {
View Full Code Here

    Object result = new Object[]{"new ", itemType.getSimpleTypeSG().getRuntimeType(), "[]{", list, "}"};
    String collectionType = pController.getCollectionType();
    if ("indexed".equals(collectionType)) {
      return new TypedValueImpl(result, itemType.getSimpleTypeSG().getRuntimeType());
    } else {
      JavaQName myListType = JavaQNameImpl.getInstance(collectionType, true);
      return new TypedValueImpl(new Object[]{"(new ", myListType, "(", Arrays.class, ".asList(", result, ")))"}, myListType);
    }
  }
View Full Code Here

TOP

Related Classes of org.apache.ws.jaxme.js.JavaQName

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.