Package org.exolab.castor.xml.schema

Examples of org.exolab.castor.xml.schema.Documentation


       // to Documentation subelement of XML Schema document annotaion.
       Enumeration dtdGeneralEntities = dtd.getGeneralEntities();
       if (dtdGeneralEntities.hasMoreElements()) {
          GeneralEntity ge;
          Annotation annotation = new Annotation();
          Documentation documentation;
          String text;

          while (dtdGeneralEntities.hasMoreElements()) {
             ge = (GeneralEntity)dtdGeneralEntities.nextElement();
             documentation = new Documentation();

             text = "General Entity Declaration";
             documentation.add(text);
             documentation.add(ge);
             annotation.addDocumentation(documentation);
          }

          schema.addAnnotation(annotation);
       }
View Full Code Here


     * @param atts the AttributeList
    **/
    public DocumentationUnmarshaller(final SchemaContext schemaContext, final AttributeSet atts) {
        super(schemaContext);

        _documentation = new Documentation();

        //-- @source
        _documentation.setSource(atts.getValue(SchemaNames.SOURCE_ATTR));

        _nodes = new Stack();
View Full Code Here

        //-- process documentation elements
        enumeration = annotation.getDocumentation();
        String ELEM_DOCUMENTATION = schemaPrefix + DOCUMENTATION;
        while (enumeration.hasMoreElements()) {
            _atts.clear();
            Documentation doc = (Documentation) enumeration.nextElement();
            String source = doc.getSource();
            String sourceName = _atts.getName(0);
            boolean isSourceIsNull = (sourceName == null);
            boolean isSourceExists = false;
           
            if (!isSourceIsNull)
            {
                isSourceExists = sourceName.equals(SchemaNames.SOURCE_ATTR);
            }
            if (source != null && !isSourceExists)
            {
                _atts.addAttribute(SchemaNames.SOURCE_ATTR, CDATA,source);
            }

            _handler.startElement(ELEM_DOCUMENTATION, _atts);
            Enumeration anyNodes = doc.getObjects();
            while (anyNodes.hasMoreElements()) {
                Object obj = anyNodes.nextElement();
                if (obj instanceof AnyNode) {
                    AnyNode2SAX anyNode2SAX = new AnyNode2SAX((AnyNode)obj);
                    anyNode2SAX.setDocumentHandler(_handler);
View Full Code Here

        }
   
        Enumeration<Documentation> enumeration = annotation.getDocumentation();
        if (enumeration.hasMoreElements()) {
            //-- just use first <info>
            Documentation documentation = enumeration.nextElement();
            return normalize(documentation.getContent());
        }
        return null;
    }
View Full Code Here

            StringBuilder comment = new StringBuilder();
            while (enumeration.hasMoreElements()) {
                Annotation ann = enumeration.nextElement();
                Enumeration<Documentation> documentations = ann.getDocumentation();
                while (documentations.hasMoreElements()) {
                    Documentation documentation = documentations.nextElement();
                    String content = documentation.getContent();
                    if (content != null) {
                        comment.append(content);
                    }
                }
            }
View Full Code Here

        Enumeration<Annotation> annotations = annotated.getAnnotations();
        while (annotations.hasMoreElements()) {
            Annotation annotation = annotations.nextElement();
            Enumeration<Documentation> documentations = annotation.getDocumentation();
            while (documentations.hasMoreElements()) {
                Documentation documentation = documentations.nextElement();
                JConstructor defaultConstructor = jClass.getConstructor(0);
                String documentationContent = normalize(documentation.getContent());
                documentationContent =
                    StringUtil.replaceAll(documentationContent, "\n", "\"\n+ \" ");
                defaultConstructor.getSourceCode().add("_xmlSchemaDocumentations.put(\""
                        +  documentation.getSource() + "\", \""
                        + documentationContent + "\");");
            }
        }

        JMethod aMethod = new JMethod("getXmlSchemaDocumentations",
View Full Code Here

    public DocumentationUnmarshaller(AttributeSet atts)
        throws XMLException
    {
        super();

        _documentation = new Documentation();

        //-- handle attributes
        String attValue = null;

        //-- @source
View Full Code Here

            StringBuffer comment = new StringBuffer();
            while (enumeration.hasMoreElements()) {
                Annotation ann = (Annotation) enumeration.nextElement();
                Enumeration documentations = ann.getDocumentation();
                while (documentations.hasMoreElements()) {
                    Documentation documentation =
                        (Documentation) documentations.nextElement();
                    String content = documentation.getContent();
                    if ( content != null) comment.append(content);
                }
            }
            return normalize(comment.toString());
        }
View Full Code Here

    public DocumentationUnmarshaller(AttributeSet atts)
        throws XMLException
    {
        super();

        _documentation = new Documentation();

        //-- handle attributes
        String attValue = null;

        //-- @source
View Full Code Here

TOP

Related Classes of org.exolab.castor.xml.schema.Documentation

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.