Package org.codehaus.enunciate.contract.jaxb

Examples of org.codehaus.enunciate.contract.jaxb.Accessor


   * @return The adapter type, or null if none was specified.
   */
  public static AdapterType findAdapterType(Declaration declaration) {
    if (declaration instanceof Accessor) {
      //jaxb accessor can be adapted.
      Accessor accessor = ((Accessor) declaration);
      return findAdapterType(accessor.getAccessorType(), accessor, accessor.getDeclaringType().getPackage());
    }
    else if (declaration instanceof MethodDeclaration) {
      //assume the return type of the method is adaptable (e.g. web results, fault bean getters).
      MethodDeclaration method = ((MethodDeclaration) declaration);
      return findAdapterType(method.getReturnType(), method, method.getDeclaringType().getPackage());
View Full Code Here


    TemplateModel from = (TemplateModel) list.get(0);
    Object unwrapped = BeansWrapper.getDefaultInstance().unwrap(from);
    String name;
    if (unwrapped instanceof Accessor) {
      Accessor accessor = (Accessor) unwrapped;
      name = accessor.getClientSimpleName();
      if (this.clientNames.containsKey(name)) {
        name = this.clientNames.get(name);
      }
    }
    else if (unwrapped instanceof AnyElement) {
      AnyElement accessor = (AnyElement) unwrapped;
      name = accessor.getClientSimpleName();
      if (this.clientNames.containsKey(name)) {
        name = this.clientNames.get(name);
      }
    }
    else {
View Full Code Here

    TemplateModel from = (TemplateModel) list.get(0);
    Object unwrapped = BeansWrapper.getDefaultInstance().unwrap(from);
    TypeMirror typeMirror;
    if (unwrapped instanceof Accessor) {
      Accessor accessor = (Accessor) unwrapped;
      if (accessor.isAdapted()) {
        typeMirror = accessor.getAdapterType().getAdaptingType(accessor.getAccessorType());
      }
      else {
        typeMirror = accessor.getAccessorType();
      }
    }
    else if (unwrapped instanceof TypeMirror) {
      typeMirror = (TypeMirror) unwrapped;
    }
View Full Code Here

    }

    TemplateModel from = (TemplateModel) list.get(0);
    Object unwrapped = BeansWrapper.getDefaultInstance().unwrap(from);
    if (Accessor.class.isInstance(unwrapped)) {
      Accessor accessor = (Accessor) unwrapped;
      DecoratedTypeMirror decorated = (DecoratedTypeMirror) TypeMirrorDecorator.decorate(accessor.getAccessorType());
      if (decorated.isPrimitive()) {
        return ((PrimitiveType) decorated).getKind() == PrimitiveType.Kind.LONG;
      }
      else if (decorated.isInstanceOf(Long.class.getName())) {
        return true;
View Full Code Here

    model.add(new ComplexTypeDefinition((ClassDeclaration) getDeclaration("org.codehaus.enunciate.samples.anotherschema.AdaptedBeanTwo")));

    ClassDeclaration adaptedBeanExamplesDeclaration = (ClassDeclaration) getDeclaration("org.codehaus.enunciate.samples.anotherschema.AdaptedBeanExamples");
    ComplexTypeDefinition examples = new ComplexTypeDefinition(adaptedBeanExamplesDeclaration);
    Accessor beanOneField = null;
    Accessor beanThreeField = null;
    Accessor beanFourField = null;
    Accessor stringBufferField = null;
    for (Accessor fieldDeclaration : examples.getElements()) {
      if ("adaptedBeanOne".equals(fieldDeclaration.getSimpleName())) {
        beanOneField = fieldDeclaration;
      }
      else if ("adaptedBeanThree".equals(fieldDeclaration.getSimpleName())) {
View Full Code Here

TOP

Related Classes of org.codehaus.enunciate.contract.jaxb.Accessor

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.