Class PerspectiveDocument
- java.lang.Object
-
- net.splitcells.dem.lang.perspective.PerspectiveDocument
-
- All Implemented Interfaces:
Discoverable
public class PerspectiveDocument extends Object implements Discoverable
Instances of this class represent XML/JSON like files. XSD Schema functionality can be created via special classes, that wrap perspectives.
XML is used for simple documents, because it provides things in order support needed functionality: it supports namespaces, XSL, XSD and XPATH. The only downside is, that defining schemas with XSD and validating files with these schemas is complicated, costly and 2 languages (Java and XML) need to be supported for things like automatic refactoring. Especially the integration of XSD files into editors is not as easy as one might think. The best way to solve this, is to automatically apply schema validation any time that XML files are processed.
When these downside are too big,
PerspectiveDocument
is used instead. Also keep in mind, that some XML files or just some content may always be XML files, because there may be no alternative format definition.Currently
PerspectiveDocument
andPerspective
usage are based on XML, because XML is the base of all syntax tree currently. In other wordsPerspectiveDocument
andPerspective
are compatible to XML, because it can be rendered as XML, but the other way around is not the case. This class will probably be a replacement for XML, if XML does cause to much problems or costs to much development resources. If and when this is the case, a slow migration process will take place, where XML will be made compatible toPerspectiveDocument
andPerspective
, by providing an conversion function from XML toPerspectiveDocument
andPerspective
. Compatibility between these system will not be removed after that, because this can be used as bridge with extern file formats.Extending classes should always provide an empty constructor, because this is just data and not something like a template.
-
-
Field Summary
-
Fields inherited from interface net.splitcells.dem.object.Discoverable
NO_CONTEXT
-
-
Constructor Summary
Constructors Constructor Description PerspectiveDocument(List<String> path)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description Perspective
createPerspective()
List<String>
path()
Perspective
perspective()
-
-
-
Method Detail
-
createPerspective
public Perspective createPerspective()
-
path
public List<String> path()
- Specified by:
path
in interfaceDiscoverable
-
perspective
public Perspective perspective()
-
-